📄 xmlepg.h
字号:
// XmlEPG.h: interface for the XmlEPG class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_XMLEPG_H__DF103F7F_B383_4699_922D_00E6C4FBE364__INCLUDED_)
#define AFX_XMLEPG_H__DF103F7F_B383_4699_922D_00E6C4FBE364__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "tinyxml.h"
#include "EpgStruct.h"
//#include <string>
//using namespace std;
typedef enum
{
XML_SUCCESS = 0,
XML_ERROR_COMM,
XML_ERROR_ADD,
XML_ERROR_DEL,
XML_ERROR_GET
} XML_ERROR_T;
class XmlEPG
{
public:
TiXmlDocument m_doc;
XmlEPG(const char* docName);
virtual ~XmlEPG();
// file operations
XML_ERROR_T XmlDocInit();
XML_ERROR_T XmlWriteFile(const char *fileName = NULL);
XML_ERROR_T XmlLoad(const char *fileName);
// some basic methods for XML files
// Get the values of attributes
XML_ERROR_T XmlGETi(const char* labelname, const char* attriname, int* iVal);
XML_ERROR_T XmlGETs(const char* labelname, const char* attriname, char* sVal, int lenth);
XML_ERROR_T XmlGETAll(const char* labelname, EPGPROGRAM* Pro);
XML_ERROR_T XmlGETDigChan(const char* labelname, DIGITAL_PGROGRAM* DigChan);
XML_ERROR_T XmlGETFastList(int* DigAdd, int len, int type);
// Modify the values of attributes
XML_ERROR_T XmlMODi(const char* labelname, const char* attriname, int iVal);
XML_ERROR_T XmlMODs(const char* labelname, const char* attriname, char* sVal);
// Delete the childrens of one node
XML_ERROR_T XmlDEL(const char* labelname);
// Add one child of one node
XML_ERROR_T XmlADD_NET_INFO(NET_INFO info, const char* labelname, const char* disname);
XML_ERROR_T XmlADD_PHYSICAL_INFO(PHYSICAL_CHANNAL info, const char* labelname, const char* disname);
XML_ERROR_T XmlADD_DIGITAL_INFO(DIGITAL_PGROGRAM info, const char* labelname, const char* disname);
XML_ERROR_T XmlADD_EPG_PROGRAM(EPGPROGRAM info, const char* labelname, const char* disname);
XML_ERROR_T XmlADD_BOOKED_EVENT(BOOKED_EVENT info, const char* labelname, const char* disname);
XML_ERROR_T XmlADD_FASTLIST(ProgramIndex info, const char* disname);
XML_ERROR_T XmlADD_CURPRG_INFO(Cur_Prg_Info info, const char* disname);
// Count the number and the values of the children
XML_ERROR_T XmlCOUNT(const char* labelname, int* count, const char** nametag );
private:
TiXmlElement *XmlLocate(const char* labelname);
};
#endif // !defined(AFX_XMLEPG_H__DF103F7F_B383_4699_922D_00E6C4FBE364__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -