00001
#ifndef ECONFBASE_H
00002
#define ECONFBASE_H
00003
00004
#include "expat.h"
00005
#include "mnstream.h"
00006
00011 class EConfBase
00012 {
00013
protected:
00014 char*
_name;
00015 EConfBase*
_recurs;
00016 bool _set;
00017 bool _has_default;
00018 char*
_comment;
00019
00020
public:
00021
EConfBase(
const char* name,
00022
bool has_default=
false,
00023
const char* comment=NULL );
00024
EConfBase(
const EConfBase& orig );
00025
00026
EConfBase&
operator=(
const EConfBase& );
00027
00028
virtual ~EConfBase( );
00029
00030 inline bool set( )
const {
00031
return _set;
00032 }
00033
00034
bool start_element(
const char* name,
00035
const char** atts,
00036 XML_Parser p );
00037
bool end_element(
const char* name, XML_Parser p );
00038
00039
virtual bool start_child_element(
const char* name,
00040
const char** atts,
00041 XML_Parser p ) = 0;
00042
virtual bool end_child_element(
const char* name, XML_Parser p ) = 0;
00043
00044
virtual void parse(
const char** atts, XML_Parser p );
00045
virtual bool begin_parse(
const char* name,
const char** atts, XML_Parser p ) = 0;
00046
virtual bool end_parse(
const char* name, XML_Parser p );
00047
00048
virtual void dump(
int depth, ostream& ostr,
bool complete ) = 0;
00049
00050 ostream&
indent(
int depth, ostream& ostr )
const;
00051 ostream&
comment(
int depth, ostream& ostr,
bool complete )
const;
00052
00053
private:
00054
EConfBase( );
00055 };
00056
00058
00059
#endif
00060