--- parser3/src/main/pa_string.C 2001/01/29 12:21:35 1.12 +++ parser3/src/main/pa_string.C 2001/01/29 15:56:04 1.14 @@ -1,9 +1,10 @@ /* - $Id: pa_string.C,v 1.12 2001/01/29 12:21:35 paf Exp $ + $Id: pa_string.C,v 1.14 2001/01/29 15:56:04 paf Exp $ */ #include +#include "pa_pool.h" #include "pa_string.h" #include "pa_hash.h" @@ -11,8 +12,8 @@ void *String::operator new(size_t size, return apool->malloc(size); } -void String::construct(Pool *apool) { - pool=apool; +String::String(Pool *apool) : + pool(apool) { head.count=curr_chunk_rows=CR_PREALLOCATED_COUNT; append_here=head.rows; head.preallocated_link=0; @@ -31,8 +32,8 @@ void String::expand() { link_row->link=0; } -String::String(String& src) { - pool=src.pool; +String::String(String& src) : + pool(src.pool) { head.count=CR_PREALLOCATED_COUNT; int src_used_rows=src.used_rows(); @@ -89,7 +90,7 @@ String::String(String& src) { fsize=src.fsize; } -String& String::operator += (char *src) { +String& String::real_append(STRING_APPEND_PARAMS) { if(!src) return *this; int len=strlen(src); @@ -101,6 +102,10 @@ String& String::operator += (char *src) append_here->item.ptr=src; fsize+=append_here->item.size=len; +#ifndef NO_STRING_ORIGIN + append_here->item.origin.file=file; + append_here->item.origin.line=line; +#endif append_here++; fused_rows++; return *this;