Annotation of parser3/src/types/pa_vresponse.C, revision 1.17.2.6.2.5
1.1 paf 1: /** @file
2: Parser: @b response class.
3:
1.17.2.4 paf 4: Copyright(c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.4 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.6 paf 6: */
1.1 paf 7:
1.17.2.6.2.5! paf 8: static const char* IDENT_VRESPONSE_C="$Date: 2003/03/21 16:16:44 $";
1.1 paf 9:
10: #include "pa_vresponse.h"
1.17.2.5 paf 11: #include "pa_request_charsets.h"
1.1 paf 12: #include "pa_charsets.h"
13: #include "pa_charset.h"
14: #include "pa_vstring.h"
1.11 paf 15: #include "pa_vdate.h"
1.1 paf 16:
1.17.2.6.2.3 paf 17: Value* VResponse::get_element(const String& aname, Value& aself, bool looking_up) {
1.1 paf 18: // $charset
1.17.2.6.2.3 paf 19: if(aname==CHARSET_NAME)
1.17.2.6.2.5! paf 20: return new VString(fcharsets.client().name());
1.8 paf 21:
22: // $method
1.17.2.6.2.3 paf 23: if(Value* result=VStateless_object::get_element(aname, aself, looking_up))
1.8 paf 24: return result;
25:
26: // $field
1.17.2.6.2.5! paf 27: return ffields.get(aname.change_case(fcharsets.source(), String::CC_LOWER));
1.1 paf 28: }
29:
1.17.2.6.2.3 paf 30: bool VResponse::put_element(const String& aname, Value* avalue, bool /*replace*/) {
1.1 paf 31: // guard charset change
1.17.2.6.2.3 paf 32: if(aname==CHARSET_NAME)
1.17.2.6.2.4 paf 33: fcharsets.set_client(charsets.get(avalue->as_string()));
1.2 paf 34: else
1.17.2.6.2.5! paf 35: ffields.put(aname.change_case(fcharsets.source(), String::CC_LOWER), avalue);
1.8 paf 36:
37: return true;
1.11 paf 38: }
E-mail: