#ifndef BOOST_TINY_XML_H
#define BOOST_TINY_XML_H
#include "boost/smart_ptr.hpp"
#include "boost/utility.hpp"
#include <list>
#include <iostream>
#include <string>
namespace boost
{
namespace tiny_xml
{
class element;
struct attribute
{
std::string name;
std::string value;
attribute(){}
attribute( const std::string & name, const std::string & value )
: name(name), value(value) {}
};
typedef boost::shared_ptr< element > element_ptr;
typedef boost::weak_ptr< element > weak_element_ptr;
typedef std::list< element_ptr > element_list;
typedef std::list< attribute > attribute_list;
class element
: private boost::noncopyable {
public:
std::string name;
attribute_list attributes;
element_list elements;
std::string content;
weak_element_ptr parent;
element() {}
explicit element( const std::string & name ) : name(name) {}
};
element_ptr parse( std::istream & in, const std::string & msg );
void write( const element & e, std::ostream & out );
}
}
#endif