|
// PugXMLNode.h: interface for the CPugXMLNode class.
// Copyright (C) 2003, by John Crane
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PUGXMLNODE_H__5CFCBE10_9047_4EA3_A97B_791F66418629__INCLUDED_)
#define AFX_PUGXMLNODE_H__5CFCBE10_9047_4EA3_A97B_791F66418629__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Include the Pug XML library.
#define _CRT_SECURE_NO_WARNINGS 1
#include "platform.h"
#include "Array.h"
#include "BString.h"
#include "pugxml.h"
#include <sstream>
#include <io.h>
#include <sys\stat.h>
using namespace std;
using namespace pug;
using namespace blue;
using namespace blue::common;
//
// CPugXMLNode class wraps xml_node and provides
// XPATH functionality.
//
class CPugXMLNode : public xml_node
{
public:
CPugXMLNode();
CPugXMLNode(xml_node_struct* p);
CPugXMLNode(const xml_node& r);
virtual ~CPugXMLNode();
// Query functions
Array <xml_node_struct*> FindNodes(const char* srch);
xml_node_struct* FindNode(const char* srch);
Array<BString> FindValues(const char* srch);
BString FindValue(const char* srch);
// Copies an existing tree under a node
void AppendTree(xml_node& node);
// Shorthand for something we will do all the time
xml_node_struct* append_child_element(LPCTSTR szName)
{
xml_node node = xml_node::append_child(node_element);
node.name(szName);
return (xml_node_struct*) node;
}
protected:
};
class CAddAttributeNodes : public xml_tree_walker
{
public:
virtual bool for_each(xml_node& node);
};
class CDelAttributeNodes : public xml_tree_walker
{
public:
virtual bool for_each(xml_node& node);
};
#endif // !defined(AFX_PUGXMLNODE_H__5CFCBE10_9047_4EA3_A97B_791F66418629__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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.