Click here to Skip to main content
11,634,815 members (69,836 online)
Click here to Skip to main content
Add your own
alternative version

A STL based XML Config Tool

, 19 Jun 2005 54.1K 835 37
Writing multiple enumerated configuration entries.
xmlconfig.zip
Source
Tool Classes
ParamIO
XmlConfig
XmlReadWrite
XmlReadWrite.cpp_
XmlReadWrite.dsp
XmlReadWrite.dsw
Makefile.win
StdAfx.o
XmlReadWrite.dev
#if !defined(XmlUtil_H)
#define XmlUtil_H


/////////////////////////////////////////////////////////////////////////
// define tag markers

#define idTagLeft	"<"
#define idTagRight	">"
#define idTagEnd	"</"
#define idTagNoData "/>"


#define idTagLeftLength		1
#define idTagRightLength	1
#define idTagEndLength		2


#include <string>

//////////////////////////////////////////////////////////////////////////////////
// XmlUtil
//
// Purpose:		provides xml utility methods

class XmlUtil
{

	// tag helper methods
	static std::string getStartTag ( std::string & text )
	{
		std::string tag = idTagLeft;
		tag += text;
		tag += idTagRight;

		return std::string(tag);
	}

	// static helper methods
	static std::string getEndTag ( std::string & text )
	{
		std::string tag = idTagEnd;
		tag += text;
		tag += idTagRight;

		return std::string(tag);
	}

	static std::string getStartTag ( const char *text )
	{
		std::string tag = idTagLeft;
		tag += text;
		tag += idTagRight;

		return std::string(tag);
	}

	static std::string getEndTag ( const char *text )
	{
		std::string tag = idTagEnd;
		tag += text;
		tag += idTagRight;

		return std::string(tag);
	}
};


#endif

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Tobias Wenig
Software Developer
Germany Germany
Studying and having a degree of medical engineering, but decided to work as a software developer writing medical applications for image processing.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150728.1 | Last Updated 20 Jun 2005
Article Copyright 2004 by Tobias Wenig
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid