Mobile API Reference  MicroStrategy 2019
Binary.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : Binary.h
3 // AUTHOR : Yuxiao Xiao
4 // CREATION : 8/24/01
5 // Copyright (C) MicroStrategy, Inc. 2001
6 //==============================================================================================
7 #ifndef MDataType_Binary_h
8 #define MDataType_Binary_h
9 
10 #include "DataType.h"
11 #include "Base/Defines/StrongPtr.h"
12 #include "Base/Defines/ReturnPtr.h"
13 #include "PDCtypes.h"
14 
15 namespace MBase
16 {
17  class Buffer;
18 }
19 
20 namespace MDataType
21 {
23 
33  class Binary
34  {
35  public:
36 
37  // a virtual destructor is a must
38  virtual ~Binary() throw()
39  {
40  }
41 
44 
46 
53  virtual void SetBinary(const void* ipData, size_t iSize) = 0;
54 
55 
57  virtual bool operator == (const Binary& irBinary) const = 0;
58 
61  virtual bool operator < (const Binary& irBinary) const = 0;
62 
64  virtual size_t GetSize() const = 0;
65 
67  virtual const void* c_ptr() const = 0;
68 
73  virtual void ZapTail(size_t iHowManyBytes) = 0;
74 
79  virtual void ZapHead(size_t iHowManyBytes) = 0;
80 
84  virtual void UnZap() = 0;
85 
90  virtual char* GiveUpBinary() = 0;
91  };
92 
93  // this typedef is obsolete, use Binary::Ptr instead
95 
97 
104 
106 
113  DLL_DATATYPE_EXIM Binary* CreateBinary(const void* ipData, size_t iSize, MBase::Buffer* ipBuffer = NULL);
114 
116 
123  DLL_DATATYPE_EXIM Binary* CreateBinary(size_t iSize, MBase::Buffer* ipBuffer = NULL);
124 }
125 
126 #endif // MDataType_Binary_h
MDataType::Binary represents binary data.
Definition: Binary.h:33
virtual void ZapTail(size_t iHowManyBytes)=0
virtual bool operator==(const Binary &irBinary) const =0
Operator == does an efficient deep comparison. Returns true if equal.
Definition: Buffer.h:58
virtual char * GiveUpBinary()=0
#define DLL_DATATYPE_EXIM
Definition: DataType.h:22
Definition: BigDecimal.h:18
virtual const void * c_ptr() const =0
c_ptr returns a weak reference to the internal buffer. Do not try to delete the pointer.
virtual size_t GetSize() const =0
GetSize returns the number of bytes of the internal buffer.
MBase::StrongPtr< Binary > Ptr
Definition: Binary.h:42
virtual void SetBinary(const void *ipData, size_t iSize)=0
SetBinary allocates a new buffer.
Definition: Allocator.h:47
MBase::ReturnPtr< Binary > ReturnPtr
Definition: Binary.h:43
DLL_DATATYPE_EXIM Binary * CreateBinary(MBase::Buffer *ipBuffer=NULL)
CreateBinary instantiates a new MDataType::Binary object.
virtual void UnZap()=0
virtual void ZapHead(size_t iHowManyBytes)=0
virtual ~Binary()
Definition: Binary.h:38
#define NULL
Definition: Null.h:10
virtual bool operator<(const Binary &irBinary) const =0
Definition: ReturnPtr.h:22
MBase::StrongPtr< Binary > BinaryPtr
Definition: Binary.h:94