1 2 #ifndef _XML_WRITER_ 3 #define _XML_WRITER_ 4 5 class xml_writer { 6 public: 7 xml_writer(); 8 ~xml_writer(); 9 BOOL OpenFile(const CString &pathname); 10 void OpenMemFile(CFile *file); 11 void CloseFile(void); 12 void WriteHeader(const char *docType); 13 void WriteInt(const char *name, int val); 14 void WriteUByte(const char *name, GX_UBYTE val); 15 void WriteUnsigned(const char *name, ULONG val); 16 void WriteHex(const char *name, ULONG val); 17 void WriteBool(const char *name, BOOL val); 18 void WriteString(const char *name, const char *val, BOOL bForce = FALSE); 19 void WriteString(const char *name, const CString &val, BOOL bForce = FALSE); 20 void WriteRect(const char *name, GX_RECTANGLE &rect); 21 void WritePathInfo(const PATHINFO &info); 22 void OpenTag(const char *tag, BOOL has_value = FALSE); 23 void OpenTag(const char *tag, CString &tag_data); 24 void CloseTag(const char *tag); 25 26 27 28 private: 29 CFile *mpFile; 30 BOOL UsingMemFile; 31 void StringToFile(LPCTSTR str); 32 }; 33 34 #endif