Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

jscript_object_navigator.hpp

Go to the documentation of this file.
00001 // See ../license.txt for license information.
00002 //
00003 // jscript_object_navigator.hpp
00004 //
00005 // 8-Jul-2003  phamilton  Created
00006 //
00007 
00008 #ifndef incREFLECT_JSCRIPT_OBJECT_NAVIGATOR
00009 #define incREFLECT_JSCRIPT_OBJECT_NAVIGATOR
00010 
00011 // forwards
00012 #include "object_navigator.hpp"
00013 
00014 namespace ph {
00015 namespace common {
00016 class object_base;
00017 };
00018 namespace reflect {
00019 
00020 class REFLECT_DECL jscript_object_navigator : public object_navigator
00021 /**
00022         Concrete subclass of object_navigator for Jscript-like object navigation.
00023 */
00024 {
00025 public:
00026         jscript_object_navigator(const ph::common::object_base *root, std::ostream *console, bool silent=false, bool debug=false) :
00027                 object_navigator(root, console), _silent(silent), _debug(debug)
00028                         {};
00029                         
00030         // object_navigator overrides
00031         virtual ph::common::object_base *navigate(const ph::common::object_base *obj, const std::string &path);
00032 
00033 private:
00034         bool _silent;
00035         bool _debug;
00036         
00037         const ph::common::object_base *get_sub_object(const ph::common::object_base *parent, const std::string &path);
00038         int  find_span_quotes(const std::string &s, char c);
00039         void error(const std::string &msg, const std::string &name);
00040         const ph::common::object_base *skip_composite(const ph::common::object_base *obj);
00041         const ph::common::object_base *go_parent(const ph::common::object_base *obj);
00042         const ph::common::object_base *get_composite(const ph::common::object_base *obj, const std::string &name);
00043         const ph::common::object_base *get_obj(const ph::common::object_base *obj, const std::string &name);
00044         const ph::common::object_base *get_nth_obj(const ph::common::object_base *obj, int n);
00045 };
00046 
00047 class REFLECT_DECL jscript_object_navigator_factory : public object_navigator_factory
00048 {
00049 public:
00050         jscript_object_navigator_factory(std::ostream *console, bool silent=false, bool debug=false) :
00051                 object_navigator_factory(console), _silent(silent), _debug(debug)
00052                         {};
00053                         
00054         // object_navigator_factory overrides
00055         virtual object_navigator *create(const ph::common::object_base *root);
00056         
00057 private:
00058         bool _silent;
00059         bool _debug;
00060 };
00061 
00062 }; // reflect
00063 }; // ph
00064 
00065 #endif // incREFLECT_JSCRIPT_OBJECT_NAVIGATOR

Generated on Wed Apr 5 22:03:24 2006 for cppxmlobj by  doxygen 1.4.3