18 #ifndef INCLUDED_PARAMNODE
19 #define INCLUDED_PARAMNODE
171 const std::wstring&
ToString()
const;
176 const std::string
ToUTF8()
const;
207 std::wstring
ToXML()
const;
212 void ToXML(std::wostream& strm)
const;
223 jsval
ToJSVal(JSContext* cx,
bool cacheValue)
const;
262 #endif // INCLUDED_PARAMNODE
An entity initialisation parameter node.
CParamNode(bool isOk=true)
Constructs a new, empty node.
A simple fixed-point number class.
jsval ConstructJSVal(JSContext *cx) const
bool ToBool() const
Parses the content of this node as a boolean ("true" == true, anything else == false) ...
void ApplyLayer(const XMBFile &xmb, const XMBElement &element, const wchar_t *sourceIdentifier=NULL)
Overlays the specified data onto this node.
static std::wstring EscapeXMLString(const std::wstring &str)
Escapes a string so that it is well-formed XML content/attribute text.
const std::wstring & ToString() const
Returns the content of this node as a string.
const std::string ToUTF8() const
Returns the content of this node as an 8-bit string.
bool IsOk() const
Returns true if this is a valid CParamNode, false if it represents a non-existent node...
int ToInt() const
Parses the content of this node as an integer.
const ChildrenMap & GetChildren() const
Returns the names/nodes of the children of this node, ordered by name.
fixed ToFixed() const
Parses the content of this node as a fixed-point number.
static void LoadXML(CParamNode &ret, const XMBFile &file, const wchar_t *sourceIdentifier=NULL)
Loads the XML data specified by file into the node ret.
const CParamNode & GetChild(const char *name) const
Returns the (unique) child node with the given name, or a node with IsOk() == false if there is none...
float ToFloat() const
Parses the content of this node as a floating-point number.
static PSRETURN LoadXMLString(CParamNode &ret, const char *xml, const wchar_t *sourceIdentifier=NULL)
See LoadXML, but parses the XML string xml.
void CopyFilteredChildrenOfChild(const CParamNode &src, const char *name, const std::set< std::string > &permitted)
Finds the childs named name from src and from this, and copies the source child's children which are ...
CScriptValRooted m_ScriptVal
Caches the ToJSVal script representation of this node.
const CStrIntern ToUTF8Intern() const
Returns the content of this node as an internalized 8-bit string.
std::wstring ToXML() const
Returns the content of this node and its children as an XML string.
std::map< std::string, CParamNode > ChildrenMap
jsval ToJSVal(JSContext *cx, bool cacheValue) const
Returns a jsval representation of this node and its children.