00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef INCLUDE_RSRC_DB_DATA
00013 #define INCLUDE_RSRC_DB_DATA
00014
00015 #include <malloc.h>
00016 #include <string.h>
00017
00018 #define DB_NONEVALUE "\0"
00019
00020
00021
00022
00023 class DataBaseData
00024 {
00025 private :
00026 int Size;
00027 char *Data;
00028
00029 public :
00030
00031
00032 DataBaseData()
00033 {
00034 Size = 0;
00035 Data = NULL;
00036 };
00037
00038
00039
00040 ~DataBaseData()
00041 {
00042 delete [] Data;
00043 };
00044
00045
00046
00047
00048
00049
00050
00051
00052 inline char *SetData(char *pData, int iSize = 0)
00053 {
00054 if(!iSize)
00055 iSize = strlen(pData);
00056
00057 if(iSize != Size)
00058 {
00059 delete [] Data;
00060 Data = new char[iSize + 1];
00061 Size = iSize;
00062 }
00063
00064 return strncpy(Data, pData, Size);
00065 };
00066
00067
00068
00069
00070
00071
00072 inline char *GetData()
00073 {
00074 if(Data && Size)
00075 return Data;
00076 else
00077 return DB_NONEVALUE;
00078 };
00079
00080
00081
00082
00083
00084
00085 inline int GetSize()
00086 {
00087 return Size;
00088 };
00089 };
00090
00091 #endif
00092