|
// Xml.h: interface for the CXml class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_XML_H__FA31F9F4_F031_4B0A_8B37_3ABD6AB598ED__INCLUDED_)
#define AFX_XML_H__FA31F9F4_F031_4B0A_8B37_3ABD6AB598ED__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "common.h"
#include "syslog.h"
#include "assert.h"
#include "mem.h"
#include "memfile.h"
#include "xmlreader.h"
#include "file.h"
#include "mem_tool.h"
class CXmlNode{
public:
CMem *mem_name;
CMemFile *mf_attrib;
CMemFile *mf_value;
int value_type;
public:
CXmlNode *parent;
CXmlNode *child;
CXmlNode *next;
public:
CXmlNode * GetChildByName(char *child_name);
int GetAttrib(char *name, CFileBase *val);
char * GetName();
CXmlNode * GetNodeByPath(char *path);
int GetPath(CFileBase *path);
int GetPathToStk(CMemStk *ss);
int WriteToFile(CFileBase *file);
int AddValueData(char *str);
int AddAttrib(CFileBase *file);
int AddValueData(CFileBase *file);
int AddAttrib(char *attrib,char *val);
int SetValueType(int type);
int SetName(char *name);
CXmlNode();
~CXmlNode();
int Init();
int Destroy();
int Print();
static CXmlNode * Alloc();
static int Free(CXmlNode *p);
CXmlNode * FindChildTail();
int AddChild(CXmlNode *node);
CXmlNode * GetChild(int i);
CXmlNode *GetParent();
};
class CXml{
public:
CXmlNode *root;
public:
int LoadXml(char *fn);
CXmlNode * GetNodeByPath(char *path);
int WriteToFile(char *fn);
int WriteToFile(CFileBase *mf);
int LoadXml(CFileBase *file);
CXml();
~CXml();
int Init();
int Destroy();
CXmlNode * GetRoot();
int AddRoot(CXmlNode *node);
};
#endif // !defined(AFX_XML_H__FA31F9F4_F031_4B0A_8B37_3ABD6AB598ED__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.