Annotation of parser3/src/types/pa_vresponse.C, revision 1.4

1.1       paf         1: /** @file
                      2:        Parser: @b response class.
                      3: 
1.3       paf         4:        Copyright(c) 2001, 2002 ArtLebedev Group(http://www.artlebedev.com)
1.4     ! paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: 
1.4     ! paf         7:        $Id: pa_vresponse.C,v 1.3 2002/02/08 07:27:54 paf Exp $
1.1       paf         8: */
                      9: 
                     10: #include "pa_vresponse.h"
                     11: #include "pa_charsets.h"
                     12: #include "pa_charset.h"
                     13: #include "pa_vstring.h"
                     14: 
                     15: Value *VResponse::get_element(const String& name) {
                     16:        // $charset
                     17:        if(name==CHARSET_NAME)
                     18:                return NEW VString(pool().get_client_charset().name());
                     19:        else {
                     20:                // $method
                     21:                if(Value *result=VStateless_object::get_element(name))
                     22:                        return result;
                     23:                
                     24:                // $field
                     25:                return static_cast<Value *>(ffields.get(name));
                     26:        }
                     27: }
                     28: 
                     29: void VResponse::put_element(const String& name, Value *value) { 
                     30:        // guard charset change
1.2       paf        31:        if(name==CHARSET_NAME)
                     32:                pool().set_client_charset(charsets->get_charset(value->as_string()));
                     33:        else
1.1       paf        34:                ffields.put(name, value);               
                     35: }
                     36: 

E-mail: