?? xml.h
字號:
#ifndef _XML_H
#define _XML_H
#define TAG_LENGTH 64
#define ATTRNAME_LENGTH 64
#define MAX_TOKEN_LEN 256
#define MAX_TEXT_LEN 2048
class TXMLExcept
{
public:
char pStr[512];
TXMLExcept() { pStr[0]=0; }
TXMLExcept(char *str) { strcpy(pStr,str); }
};
class TXMLAttr
{
public:
TXMLAttr *brother;
int lineNo;
TXMLAttr();
~TXMLAttr();
void setName(const char* src);
char* getName();
void setValue(const char* src);
char* getValue();
TXMLAttr* dup();
char* toStr();
private:
char m_strName[ATTRNAME_LENGTH+1];
char* m_strValue;
};
class TXMLElem
{
public:
TXMLElem* child;
TXMLElem* brother;
TXMLElem* parent;
TXMLAttr *attr;
int lineNo;
TXMLElem();
~TXMLElem();
void Read();
int ReadBeginTag(); //1 include content, 0 no include
void ReadAttribute();
void ReadContent();
void ReadEndTag();
int deleteChild(TXMLElem* child);
void addChild(TXMLElem* child,int mode=1);
void addBrother(TXMLElem* elem,int mode);
void addBrother(TXMLElem* elem);
void addAttr(TXMLAttr* attr);
void addAttr(const char *name,const char *value);
void setAttr(const char *name,const char *value);
char* GetAttrValue(const char *name);
int GetAttrNum();
TXMLAttr *GetAttr(const char *name);
TXMLAttr *GetAttr(int i);
int GetSubElemNum();
int GetSubElemNumByTag(char* strTag);
TXMLElem *GetSubElem(const char *tag);
TXMLElem *GetSubElem(int i);
int GetSubElemName(int i,char* value);
TXMLElem *GetSubElem(const char *tag, int i);
TXMLElem *GetSubElem(const char *tag, const char *attrName, const char *attrValue);
TXMLElem* dup(TXMLElem* parent);
void setTag(const char*);
char* getTag();
void setContent(const char*);
char* getContent();
char* toStr();
private:
char m_strTag[TAG_LENGTH+1];
char* m_strContent;
};
void XMLERROR(const char* fmt, ...);
TXMLElem* ParseXML(char*);
TXMLElem* GetXMLElem(TXMLElem* handle, char* path);
void xmlTextDecode(char*);
char* xmlTextEncode(char* xmlText);
void TrimAll(char* sour);
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -