DATAKIT API  V2025.4
dtk_stream.hpp
Go to the documentation of this file.
1 #ifndef __UTIL_DTK_STREAM_HPP__
2 #define __UTIL_DTK_STREAM_HPP__
3 
4 #include "def/define.h"
7 #include "util/util_ptr_dtk.hpp"
8 
9 
14 
15 class Dtk_Stream : public Dtk_Object
16 {
17 public:
19  {
24  };
25 protected:
26  struct Dtk_Handle; // Not defined here
27  Dtk_Handle *_Private; // Handle
28  enum
29  {
31  };
32  // \sa Create( const Dtk_string &, const Dtk_Char8 *const, const Dtk_Size_t&, Dtk_StreamType )
33  Dtk_Stream(const Dtk_string &inName, const Dtk_Char8 *const inBinaryContent,
34  const Dtk_Size_t & inBinaryContentSize, Dtk_StreamType inType);
35  // \sa Create( const Dtk_Stream & )
36  Dtk_Stream(const Dtk_Stream &in);
37 
40 
41  inline virtual Dtk_Object* Clone()
42  {
43  return new Dtk_Stream(*this);
44  }
45 
46 private:
47  void _Init();
48  void _Copy(const Dtk_Stream &o);
49  void _Reset();
50  friend class Dtk_SmartPtr<Dtk_Stream>;
51 public:
52 
55 
58 
62  static Dtk_StreamPtr Create(const Dtk_string &inName, const Dtk_Char8 *const inBinaryContent,
63  const Dtk_Size_t & inBinaryContentSize, Dtk_StreamType inType);
64 
66  static Dtk_StreamPtr Create(const Dtk_Stream &in);
67 
69  {
70  return DTK_TYPE_STREAM;
71  }
72 
78  const Dtk_Char8 *const GetBinaryContent() const;
79 
83  void SetBinaryContent(const Dtk_Char8 *const inNewContent,
84  const Dtk_Size_t inNewContentSize);
85 
88 
89 
90 
91 };
92 
93 #endif
Dtk_Stream::DtkDynamicType
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Dtk_Stream::SetBinaryContent
void SetBinaryContent(const Dtk_Char8 *const inNewContent, const Dtk_Size_t inNewContentSize)
Set the file data.
Dtk_Stream::GetBinaryContent
const Dtk_Char8 *const GetBinaryContent() const
Returns the file size.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:714
Dtk_Stream::Dtk_StreamType
Dtk_StreamType
Definition: dtk_stream.hpp:19
Dtk_Stream::Dtk_Stream
Dtk_Stream(const Dtk_string &inName, const Dtk_Char8 *const inBinaryContent, const Dtk_Size_t &inBinaryContentSize, Dtk_StreamType inType)
Dtk_Stream
This is the Dtk_Stream Class. The Dtk_Stream object is used to store any informations about stream fi...
Definition: dtk_stream.hpp:16
Dtk_Stream::DTK_STREAM_JT
@ DTK_STREAM_JT
Definition: dtk_stream.hpp:22
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:689
Dtk_Stream::DTK_STREAM_UNKNOWN
@ DTK_STREAM_UNKNOWN
Definition: dtk_stream.hpp:20
Dtk_Char8
char Dtk_Char8
Definition: define.h:699
Dtk_Stream::Create
static Dtk_StreamPtr Create(const Dtk_Stream &in)
Calls copy constructor to allocate a new object.
Dtk_Stream::~Dtk_Stream
~Dtk_Stream()
Destructor.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_Stream::GetName
Dtk_string GetName() const
Returns the file name.
Dtk_Stream::DTK_STREAM_XMM_B
@ DTK_STREAM_XMM_B
Definition: dtk_stream.hpp:23
DTK_TYPE_STREAM
@ DTK_TYPE_STREAM
Definition: define.h:621
Dtk_Stream::DTK_STREAM_X_B
@ DTK_STREAM_X_B
Definition: dtk_stream.hpp:21
Dtk_Stream::_typeID
@ _typeID
Definition: dtk_stream.hpp:30
type_detk
type_detk
Definition: define.h:32
Dtk_Stream::Create
static Dtk_StreamPtr Create(const Dtk_string &inName, const Dtk_Char8 *const inBinaryContent, const Dtk_Size_t &inBinaryContentSize, Dtk_StreamType inType)
Create a Dtk_StreamPtr.
util_ptr_dtk.hpp
define.h
Dtk_Stream::Clone
virtual Dtk_Object * Clone()
Definition: dtk_stream.hpp:41
Dtk_Stream::DtkDynamicCast
static Dtk_Stream * DtkDynamicCast(Dtk_Object *o)
Performs a dynamic cast - doesn't need RTTI -.
Dtk_Stream::GetStreamType
Dtk_StreamType GetStreamType() const
Returns the stream type.
Dtk_Stream::Dtk_Stream
Dtk_Stream(const Dtk_Stream &in)
Dtk_Object
Definition: dtk_object.hpp:8
dtk_string.hpp
Dtk_Stream::get_type_detk
type_detk get_type_detk() const
Definition: dtk_stream.hpp:68
Dtk_Stream::_Private
Dtk_Handle * _Private
Definition: dtk_stream.hpp:26
Dtk_Stream::GetBinaryContentSize
const Dtk_Size_t GetBinaryContentSize() const
Returns the file data.
dtk_object.hpp