Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef lgrDynStrings_H_
00010 #define lgrDynStrings_H_
00011
00012 #include "lgrSim.h"
00013 #include <string>
00014
00015 #if 0
00016
00017 class DT_DLL_LGRSIM DtToCaseBuff
00018 {
00019 public:
00021 DtToCaseBuff();
00023 virtual ~DtToCaseBuff();
00025 DtToCaseBuff( const DtToCaseBuff& src );
00027 DtToCaseBuff& operator=( const DtToCaseBuff& src );
00028
00029 public:
00030 const char* tolower( const char* str );
00031 const char* toupper( const char* str );
00032 inline int len() const { return myLn; }
00033
00034 protected:
00035 int resize( int sz = 0 );
00036
00037 protected:
00038 char* myBuff;
00039 int myLn, mySz;
00040 };
00041
00042
00043 class DT_DLL_LGRSIM DtWStringConv
00044 {
00045 public:
00047 DtWStringConv();
00049 virtual ~DtWStringConv();
00051 DtWStringConv( const DtWStringConv& src );
00053 DtWStringConv& operator=( const DtWStringConv& src );
00054
00055 public:
00057 bool operator==( const DtWStringConv& rhs ) const;
00058 bool operator!=( const DtWStringConv& rhs ) const;
00059
00060 public:
00061 bool initFromCharArr( const char* str, int len = -1 );
00062 bool initFromWString( const std::wstring& str );
00063 void copyToWString( std::wstring& str );
00064
00065 public:
00066 inline const char* data() const;
00067 inline int length() const;
00068
00069 protected:
00070 int resize( int sz = 0 );
00071
00072 protected:
00073 char* myBuff;
00074 int myLn, mySz;
00075 };
00076
00077
00078 inline const char* DtWStringConv::data() const
00079 {
00080 return myBuff;
00081 }
00082
00083
00084 inline int DtWStringConv::length() const
00085 {
00086 return myLn;
00087 }
00088
00095 class DT_DLL_LGRSIM DtVarLengthBuffer
00096 {
00097 public:
00099 DtVarLengthBuffer();
00101 virtual ~DtVarLengthBuffer();
00103 DtVarLengthBuffer( const DtVarLengthBuffer& src );
00105 DtVarLengthBuffer& operator=( const DtVarLengthBuffer& src );
00106
00107 public:
00109 bool operator==( const DtVarLengthBuffer& rhs ) const;
00110 bool operator!=( const DtVarLengthBuffer& rhs ) const;
00111
00112 public:
00117 bool init( const void* data, int dataSize, bool isString = false );
00118
00119 bool setIsString( bool yesNo );
00120 inline bool isString() const;
00121
00122 bool setLength( int _length );
00123 inline int length() const;
00124
00125 inline const void* data() const;
00126
00127 inline int bfSize() const;
00128
00129 protected:
00130 int resize( int sz = 0 );
00131
00132 protected:
00133 char* myBuff;
00134 int myLn, mySz;
00135 bool myIsString;
00136 };
00137
00138
00139 inline bool DtVarLengthBuffer::isString() const
00140 {
00141 return myIsString;
00142 }
00143
00144
00145 inline int DtVarLengthBuffer::length() const
00146 {
00147 return myLn;
00148 }
00149
00150
00151 inline const void* DtVarLengthBuffer::data() const
00152 {
00153 return myBuff;
00154 }
00155
00156
00157 inline int DtVarLengthBuffer::bfSize() const
00158 {
00159 return mySz;
00160 }
00161
00162 #endif
00163
00169 class DT_DLL_LGRSIM DtDynamicBuffer
00170 {
00171 public:
00173 DtDynamicBuffer();
00175 ~DtDynamicBuffer();
00177 DtDynamicBuffer( const DtDynamicBuffer& );
00179 DtDynamicBuffer& operator=( const DtDynamicBuffer& );
00180
00181 int resize( int sz = 0 );
00182
00183 public:
00184 char* myBuff;
00185 int mySz;
00186 };
00187
00188 #endif