--- parser3/src/include/pa_string.h 2001/01/29 15:56:03 1.10 +++ parser3/src/include/pa_string.h 2001/01/29 20:46:22 1.12 @@ -1,5 +1,5 @@ /* - $Id: pa_string.h,v 1.10 2001/01/29 15:56:03 paf Exp $ + $Id: pa_string.h,v 1.12 2001/01/29 20:46:22 paf Exp $ */ /* @@ -29,10 +29,10 @@ class Pool; #ifndef NO_STRING_ORIGIN -# define STRING_APPEND_PARAMS char *src, char *file, uint line +# define STRING_APPEND_PARAMS const char *src, char *file, uint line # define APPEND(src, file, line) real_append(src, file, line) #else -# define STRING_APPEND_PARAMS char *src +# define STRING_APPEND_PARAMS const char *src # define APPEND(src, file, line) real_append(src) #endif @@ -46,12 +46,12 @@ public: public: - void *operator new(size_t size, Pool *apool); - String(Pool *apool); + void *operator new(size_t size, Pool& apool); + String(Pool& apool); String(String& src); size_t size() { return fsize; } int used_rows() { return fused_rows; } - char *c_str(); + char *cstr(); String& real_append(STRING_APPEND_PARAMS); bool operator == (String& src); @@ -60,7 +60,7 @@ public: protected: // the pool I'm allocated on - Pool *pool; + Pool& pool; private: @@ -70,7 +70,7 @@ private: union Row { // chunk item struct { - char *ptr; // pointer to the start of string fragment + const char *ptr; // pointer to the start of string fragment size_t size; // length of the fragment Origin origin; // origin of this fragment } item; @@ -107,7 +107,7 @@ private: private: //disabled - String& operator = (String&) { return *this; } + String& operator = (const String&) { return *this; } };