|
|
| version 1.4, 2001/03/08 12:19:21 | version 1.9, 2001/03/10 12:12:51 |
|---|---|
| Line 6 | Line 6 |
| #include "pa_exception.h" | #include "pa_exception.h" |
| // appends a fstring to result | // appends a fstring to result |
| void WContext::write(String *astring) { | void WContext::write(const String& astring, String::Untaint_lang lang) { |
| if(!astring) | fstring.append(astring, lang); |
| return; | |
| fstring+=*astring; | |
| } | } |
| // if value is VString writes fstring, | // if value is VString writes fstring, |
| // else writes Value; raises an error if already | // else writes Value; raises an error if already |
| void WContext::write(Value *avalue) { | void WContext::write(Value& avalue, String::Untaint_lang lang) { |
| if(!avalue) | const String *fstring=avalue.get_string(); |
| return; | |
| String *fstring=avalue->get_string(); | |
| if(fstring) | if(fstring) |
| write(fstring); | write(*fstring, lang); |
| else | else |
| if(fvalue) // already have value? | if(fvalue) // already have value? |
| THROW(0,0, // must not construct twice | THROW(0,0, // must not construct twice |
| &fvalue->name(), | &avalue.name(), |
| "value already assigned, use constructor to reassign it"); | "(%s) illegal assignment attempt to '%s' (%s), use constructor instead", |
| avalue.type(), fvalue->name().cstr(), fvalue->type()); | |
| else | else |
| fvalue=avalue; | fvalue=&avalue; |
| } | } |