DATAKIT SDK  V2026.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 #include <memory>
9 
10 
11 //! \class Dtk_Stream
12 //! \brief This is the Dtk_Stream Class.\n
13 //! The Dtk_Stream object is used to store any informations about stream file
14 //! \SmartPtr{Dtk_StreamPtr}
15 
16 class Dtk_Stream : public Dtk_Object
17 {
18 public:
20  {
25  };
26 protected:
27  struct Dtk_Handle; // Not defined here
28  std::unique_ptr<Dtk_Handle> _Private; // Handle
29  enum
30  {
32  };
33  // \sa Create( const Dtk_string &, const Dtk_Char8 *const, const Dtk_Size_t&, Dtk_StreamType )
34  Dtk_Stream(const Dtk_string &inName, const Dtk_Char8 *const inBinaryContent,
35  const Dtk_Size_t & inBinaryContentSize, Dtk_StreamType inType);
36  // \sa Create( const Dtk_Stream & )
37  Dtk_Stream(const Dtk_Stream &in);
39  //! \BaseDestructor
41 
42  inline virtual Dtk_Object* Clone()
43  {
44  return new Dtk_Stream(*this);
45  }
46 
47 private:
48  friend class Dtk_SmartPtr<Dtk_Stream>;
49 public:
50 
51  //! \DtkDynamicType
53 
54  //! \DtkDynamicCast
56 
57  //! \brief Create a Dtk_StreamPtr.
58  //! \param binaryContent file data.
59  //! \param binaryContentSize file size.
60  static Dtk_StreamPtr Create(const Dtk_string &inName, const Dtk_Char8 *const inBinaryContent,
61  const Dtk_Size_t & inBinaryContentSize, Dtk_StreamType inType);
62 
63  //! \CreateCopy{in}
64  static Dtk_StreamPtr Create(const Dtk_Stream &in);
65 
67  {
68  return DTK_TYPE_STREAM;
69  }
70 
71  //! \brief Returns the file name.
73  //! \brief Returns the file data.
75  //! \brief Returns the file size.
76  const Dtk_Char8 *const GetBinaryContent() const;
77 
78  //! \brief Set the file data.
79  //! \param inNewContent The file data.
80  //! \param inNewContentSize The file data size.
81  void SetBinaryContent(const Dtk_Char8 *const inNewContent,
82  const Dtk_Size_t inNewContentSize);
83 
84  //! \brief Returns the stream type.
86 
87 
88 
89 };
90 
91 #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::_Private
std::unique_ptr< Dtk_Handle > _Private
Definition: dtk_stream.hpp:27
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:53
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:711
Dtk_Stream::Dtk_StreamType
Dtk_StreamType
Definition: dtk_stream.hpp:20
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:17
Dtk_Stream::DTK_STREAM_JT
@ DTK_STREAM_JT
Definition: dtk_stream.hpp:23
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:686
Dtk_Stream::DTK_STREAM_UNKNOWN
@ DTK_STREAM_UNKNOWN
Definition: dtk_stream.hpp:21
Dtk_Char8
char Dtk_Char8
Definition: define.h:696
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(Dtk_Stream &&o) DTK_NOEXCEPT
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:24
DTK_TYPE_STREAM
@ DTK_TYPE_STREAM
Definition: define.h:610
Dtk_Stream::DTK_STREAM_X_B
@ DTK_STREAM_X_B
Definition: dtk_stream.hpp:22
Dtk_Stream::_typeID
@ _typeID
Definition: dtk_stream.hpp:31
type_detk
type_detk
Definition: define.h:21
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:42
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:66
Dtk_Stream::GetBinaryContentSize
const Dtk_Size_t GetBinaryContentSize() const
Returns the file data.
dtk_object.hpp
DTK_NOEXCEPT
#define DTK_NOEXCEPT
Definition: config.hpp:20