8 extern std::string working_directory
;
11 InitWorkingDirectory();
22 std::vector
<std::string
> path
;
24 Path(); // initializes path to getcwd();
25 Path ( const Path
& cwd
, const std::string
& filename
);
26 std::string
Fixup ( const std::string
& filename
, bool include_filename
) const;
28 std::string
RelativeFromWorkingDirectory ();
29 static std::string
RelativeFromWorkingDirectory ( const std::string
& path
);
31 static void Split ( std::vector
<std::string
>& out
,
32 const std::string
& path
,
41 std::string topIncludeFilename
;
44 XMLInclude ( XMLElement
* e_
, const Path
& path_
, const std::string topIncludeFilename_
)
45 : e ( e_
), path ( path_
), topIncludeFilename ( topIncludeFilename_
)
50 class XMLIncludes
: public std::vector
<XMLInclude
*>
58 friend class XMLElement
;
62 bool open(const std::string
& filename
);
66 bool get_token(std::string
& token
);
67 const std::string
& filename() { return _filename
; }
68 std::string
Location() const;
71 std::string _buf
, _filename
;
73 const char *_p
, *_end
;
84 XMLAttribute ( const std::string
& name_
, const std::string
& value_
);
85 XMLAttribute ( const XMLAttribute
& );
86 XMLAttribute
& operator = ( const XMLAttribute
& );
96 std::vector
<XMLAttribute
*> attributes
;
97 XMLElement
* parentElement
;
98 std::vector
<XMLElement
*> subElements
;
101 XMLElement ( XMLFile
* xmlFile
,
102 const std::string
& location
);
104 bool Parse(const std::string
& token
,
106 void AddSubElement ( XMLElement
* e
);
107 XMLAttribute
* GetAttribute ( const std::string
& attribute
,
109 const XMLAttribute
* GetAttribute ( const std::string
& attribute
,
110 bool required
) const;
114 XMLLoadFile ( const std::string
& filename
,
116 XMLIncludes
& includes
);