00001
00002 #ifndef MiX_MISC_H_
00003 #define MiX_MISC_H_
00004
00009 #include "classes.h"
00010
00011 #include "DefaultTraits.h"
00012
00013 namespace MiX{
00020 enum NodeType{
00021 Node_Document = 0x40,
00022 Node_Element = 0x60,
00023 Node_Attribute = 0x30,
00024 Node_Text = 0x10,
00025 Node_Comment = 0x11,
00026
00027 Node_NodeContainer = 0x40,
00028 Node_NamedNode = 0x20,
00029 Node_Value = 0x10,
00030 };
00031
00033 enum ErrorType{
00034
00035 UnexpectedToken = 0,
00036 XMLDeclarationNotFound,
00037 InternalError,
00038 UnexpectedEOD,
00039 InvalidHandler,
00040 InvalidDeclaration,
00041 MismatchTag,
00042
00043 NullException,
00044 NodeNotFound,
00045 NodeDuplication,
00046 InvalidNodeFound,
00047 NamespaceNotDefined,
00048
00049 InvalidXPathResult,
00050 InvalidDocument
00051 };
00052
00054 template<class charT,class traitsT>
00055 XMLString<charT,traitsT> make_indent(int off,const XMLString<charT,traitsT>& idt){
00056 XMLString<charT,traitsT> ret;
00057 for( int i=0 ; i<off ; ++i ) ret+=idt;
00058 return ret;
00059 }
00060
00061
00062
00063
00064
00065
00066
00067 #define MiX_Template_Typedef(C,T,X) typedef C char_type; \
00068 typedef T char_traits_type; \
00069 typedef X xml_traits_type; \
00070 typedef Node<C,T,X> node_type; \
00071 typedef NodeContainer<C,T,X> nodecontainer_type; \
00072 typedef NamedNode<C,T,X> namednode_type; \
00073 typedef Value<C,T,X> value_type; \
00074 typedef Document<C,T,X> document_type; \
00075 typedef Element<C,T,X> element_type; \
00076 typedef Attribute<C,T,X> attribute_type; \
00077 typedef Text<C,T,X> text_type; \
00078 typedef Comment<C,T,X> comment_type; \
00079 typedef AttrMap<C,T,X> attrmap_type; \
00080 typedef XMLString<C,T,X> string_type; \
00081 typedef NodeList<C,T,X> nodelist_type; \
00082 typedef DOM_Exception<C,T,X> dom_exception_type; \
00083 typedef XPathAtom<C,T,X> xpathatom_type; \
00084 typedef XPathResult<C,T,X> xpathresult_type; \
00085 typedef XPathException<C,T,X> xpathexception_type
00086 }
00087
00088 #endif