--- parser3/src/main/pa_string.C 2001/03/18 20:31:27 1.43 +++ parser3/src/main/pa_string.C 2001/03/19 17:42:16 1.46 @@ -1,9 +1,11 @@ -/* - Parser +/** @file + Parser: string class. @see untaint.C. + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.C,v 1.43 2001/03/18 20:31:27 paf Exp $ + $Id: pa_string.C,v 1.46 2001/03/19 17:42:16 paf Exp $ */ #include @@ -45,7 +47,7 @@ void String::expand() { String::String(const String& src) : Pooled(src.pool()) { head.count=CR_PREALLOCATED_COUNT; - int src_used_rows=src.used_rows(); + int src_used_rows=src.fused_rows; if(src_used_rows<=head.count) { // all new rows fit into preallocated area int curr_chunk_rows=head.count; @@ -100,7 +102,7 @@ String::String(const String& src) : Pool } String& String::append(const String& src, Untaint_lang lang, bool forced) { - int src_used_rows=src.used_rows(); + int src_used_rows=src.fused_rows; int dst_free_rows=link_row-append_here; if(src_used_rows<=dst_free_rows) { @@ -332,3 +334,14 @@ bool String::operator == (const char* b_ } return a_break==b_break; } + +#ifndef NO_STRING_ORIGIN +const Origin& String::origin() const { + if(!fused_rows) + THROW(0, 0, + 0, + "String::origin() of empty string called"); + + return head.rows[0].item.origin; +} +#endif