00001 #ifndef xmlwriter_h 00002 #define xmlwriter_h 00003 00004 #include<iostream> 00005 #include<string> 00006 #include<vector> 00007 #include <stack> 00008 #include <stdio.h> 00009 using namespace std; 00010 typedef stack<string> StackStrings; 00011 00012 00013 class xmlwriter{ 00014 public: 00015 xmlwriter(string sTmp); 00016 ~xmlwriter(); 00017 void CreateChild(string sTag,string sValue); 00018 void CreateTag(string sTag); 00019 void CreateEmptyElement(string sTag); 00020 void CloseTag(); 00021 void CloseTag(std::string sTag); 00022 void CloseAlltags(); 00023 void AddAttributes(string sAttrName, string sAttrvalue); 00024 void AddComment(string sComment); 00025 void AddString(string str); 00026 private: 00027 string sXmlFile; 00028 vector<string> vectAttrData; 00029 int iLevel; 00030 FILE *fp; 00031 StackStrings sTagStack; 00032 void NewLine(); 00033 }; 00034 00035 #endif // xmlwriter_h 00036 00037