Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Read and Write application parameters in XML

, 30 Jun 2003
This article provides an easy way to load and save the parameters of an application in XML format.
#if !defined(XmlStream_H)
#define XmlStream_H

#include "XmlParser.h"
#include "XmlNotify.h"

#include <string>
#include <iostream>
#include <list>

//////////////////////////////////////////////////////////////////////////////
// XmlStream
//
// Purpose: stores a string that contain start,end tag delimited value


class XmlStream : public std::string
{
public:

	XmlStream ();

	virtual ~XmlStream ();

	// release resources
	bool create ();

	bool create ( char * buffer, long len );

	void release ();

	// notify methods
	void foundNode		( std::string & name, std::string & attributes );
	void endNode		( std::string & name, std::string & attributes ); // ARNAUD
	void foundElement	( std::string & name, std::string & value, std::string & attributes );

	// parse the current buffer
	bool parse			();
	bool parse			( const char * buffer, long parseLength );
	bool parseNodes		( XmlParser & parser, const char * buffer, long parseLength );

	// get/set subscriber
	bool hasSubscriber ();

	XmlNotify * getSubscriber ();

	void setSubscriber ( XmlNotify & set );

	// get ref to tag stream
	XmlStream & getTagStream ();


	// get string ref
	std::string & str();
private:
		XmlNotify *_subscriber;	// notification subscriber
};



#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

Arnaud Brejeon
Web Developer
China China
I've been living & working in Tokyo since 2000 . I'm currently working in Gentech Corp. (www.gen.co.jp), developing computer vision applications, especially in the field of face detection.
 
I've been interested in C++ for quite a while and recently discovered Ruby.
 
My hobbies are trekking, japanese food, yoga & onsens.

| Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 1 Jul 2003
Article Copyright 2001 by Arnaud Brejeon
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid