00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef IWORKXMLCONTEXT_H_INCLUDED
00011 #define IWORKXMLCONTEXT_H_INCLUDED
00012
00013 #include <boost/shared_ptr.hpp>
00014
00015 namespace libetonyek
00016 {
00017
00018 class IWORKXMLContext;
00019
00020 typedef boost::shared_ptr<IWORKXMLContext> IWORKXMLContextPtr_t;
00021
00022 class IWORKXMLContext
00023 {
00024 public:
00025 virtual ~IWORKXMLContext() = 0;
00026
00032 virtual void startOfElement() = 0;
00033
00038 virtual void attribute(int name, const char *value) = 0;
00039
00045 virtual IWORKXMLContextPtr_t element(int name) = 0;
00046
00052 virtual void text(const char *value) = 0;
00053
00056 virtual void endOfElement() = 0;
00057 };
00058
00059 template<typename Context, typename Arg>
00060 IWORKXMLContextPtr_t makeContext(Arg &arg)
00061 {
00062 return IWORKXMLContextPtr_t(new Context(arg));
00063 }
00064
00065 template<typename Context, typename Arg1, typename Arg2>
00066 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2)
00067 {
00068 return IWORKXMLContextPtr_t(new Context(arg1, arg2));
00069 }
00070
00071 template<typename Context, typename Arg1, typename Arg2>
00072 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2)
00073 {
00074 return IWORKXMLContextPtr_t(new Context(arg1, arg2));
00075 }
00076
00077 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
00078 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2, const Arg3 &arg3)
00079 {
00080 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
00081 }
00082
00083 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
00084 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2, Arg3 &arg3)
00085 {
00086 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
00087 }
00088
00089 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
00090 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2, Arg3 &arg3)
00091 {
00092 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
00093 }
00094
00095 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
00096 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
00097 {
00098 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
00099 }
00100
00101 template<typename Context, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
00102 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
00103 {
00104 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3, arg4));
00105 }
00106
00107 template<typename Context, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
00108 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
00109 {
00110 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3, arg4));
00111 }
00112
00113 }
00114
00115 #endif // IWORKXMLCONTEXT_H_INCLUDED
00116
00117