Annotation of parser3/src/types/pa_vobject.h, revision 1.54
1.6 paf 1: /** @file
1.7 paf 2: Parser: @b object class decl.
3:
1.50 misha 4: Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com)
1.16 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1 paf 6: */
7:
8: #ifndef PA_VOBJECT_H
9: #define PA_VOBJECT_H
10:
1.54 ! misha 11: static const char * const IDENT_VOBJECT_H="$Date: 2009-08-08 13:30:21 $";
1.39 paf 12:
13: // includes
1.19 paf 14:
1.1 paf 15: #include "pa_vjunction.h"
16: #include "pa_vclass.h"
1.4 paf 17: #include "pa_vstateless_object.h"
1.39 paf 18: #include "pa_vfile.h"
1.6 paf 19:
1.23 paf 20: // defines
21:
22: #define BASE_NAME "BASE"
23:
1.26 paf 24: /** parser class instance, stores
25: - class VObject::fclass;
26: - fields VObject::ffields (dynamic, not static, which are stored in class).
1.6 paf 27: */
1.53 misha 28: class VObject: public Value {
1.39 paf 29:
30: VStateless_class& fclass;
1.53 misha 31: HashStringValue ffields;
1.39 paf 32:
1.1 paf 33: public: // Value
34:
1.39 paf 35: const char* type() const { return fclass.name_cstr(); }
1.53 misha 36: override Value* as(const char* atype);
1.12 parser 37:
1.25 paf 38: /// VObject: fclass
1.39 paf 39: override VStateless_class *get_class() { return &fclass; }
40:
41: override bool is_defined() const;
42: override Value& as_expr_result(bool);
43: override int as_int() const;
1.49 misha 44: override double as_double() const;
1.39 paf 45: override bool as_bool() const;
1.52 misha 46: override VFile* as_vfile(String::Language lang, const Request_charsets *charsets=0);
1.33 paf 47:
1.39 paf 48: override HashStringValue* get_hash();
49: override Table *get_table();
1.33 paf 50:
1.53 misha 51: override Value* get_element(const String& aname);
52: override const VJunction* put_element(const String& name, Value* value, bool replace);
1.24 paf 53:
1.1 paf 54: public: // creation
55:
1.53 misha 56: VObject(VStateless_class& aclass): fclass(aclass){}
1.1 paf 57:
58: private:
59:
1.54 ! misha 60: Value* get_scalar_value(char* as_something) const;
1.49 misha 61:
1.1 paf 62: };
63:
64: #endif
E-mail: