src/lstring.h

См. документацию.
00001 //
00002 // C++ Interface: lstring
00003 //
00004 // Description: 
00005 //
00006 //
00007 // Author: yessss <gennadiyesss@mail.ru>, (C) 2007
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 
00013 #ifndef LSTRING_H
00014 #define LSTRING_H
00015 
00016 class lstring {
00017 public:
00018      const char* value;
00019      lstring(const char* c) {
00020           char* cc = (char*)malloc(strlen(c)*sizeof(char));
00021           strcpy(cc, c);
00022           value = cc;
00023      };
00024      lstring(): value(NULL) {};
00025      ~lstring() {
00026           if(value)
00027                free((void*)value);
00028      }
00029      inline int length() const {
00030           return strlen(value);
00031      }
00032      inline void append(const char* c, int len){
00033           printf("value: <%s>\n", value);
00034           int l = length();
00035           char* cc = (char*)malloc(l + len + 1);
00036           strcpy(cc, value);
00037           memcpy(&cc[l], c, len);
00038           cc[l + len] = 0;
00039           if(value && *value != 0)
00040                free((void*)value);
00041           value = cc;
00042      }
00043 };
00044 
00045 #endif //LSTRING_H

Документация по XDataServer. Последние изменения: Thu Jul 12 11:49:42 2007. Создано системой  doxygen 1.5.2