props_io.hxx File Reference

Interface definition for property list io. More...

#include <simgear/compiler.h>
#include <simgear/props/props.hxx>
#include <stdio.h>
#include <vector>
#include <map>

Go to the source code of this file.

Functions

void readProperties (istream &input, SGPropertyNode *start_node, const string &base="", int default_mode=0)
 Read properties from an XML input stream.
void readProperties (const string &file, SGPropertyNode *start_node, int default_mode=0)
 Read properties from an XML file.
void readProperties (const char *buf, const int size, SGPropertyNode *start_node, int default_mode=0)
 Read properties from an in-memory buffer.
void writeProperties (ostream &output, const SGPropertyNode *start_node, bool write_all=false, SGPropertyNode::Attribute archive_flag=SGPropertyNode::ARCHIVE)
 Write properties to an XML output stream.
void writeProperties (const string &file, const SGPropertyNode *start_node, bool write_all=false, SGPropertyNode::Attribute archive_flag=SGPropertyNode::ARCHIVE)
 Write properties to an XML file.
bool copyProperties (const SGPropertyNode *in, SGPropertyNode *out)
 Copy properties from one node to another.


Detailed Description

Interface definition for property list io.

Started Fall 2000 by David Megginson, david@megginson.com This code is released into the Public Domain.

See props.html for documentation [replace with URL when available].

Id
props_io.hxx,v 1.3 2005-12-17 15:11:37 ehofman Exp

Definition in file props_io.hxx.


Function Documentation

bool copyProperties ( const SGPropertyNode in,
SGPropertyNode out 
)

Copy properties from one node to another.

Parameters:
in The source property tree.
out The destination property tree.
Returns:
true if all properties were copied, false if some failed (for example, if the property's value is tied read-only).

Definition at line 589 of file props_io.cxx.

References copyProperties(), SGPropertyNode::getAttributes(), SGPropertyNode::getBoolValue(), SGPropertyNode::getChild(), SGPropertyNode::getDoubleValue(), SGPropertyNode::getFloatValue(), SGPropertyNode::getIntValue(), SGPropertyNode::getLongValue(), SGPropertyNode::getStringValue(), SGPropertyNode::getType(), SGPropertyNode::hasValue(), SGPropertyNode::isAlias(), SGPropertyNode::nChildren(), SGPropertyNode::setAttributes(), SGPropertyNode::setBoolValue(), SGPropertyNode::setDoubleValue(), SGPropertyNode::setFloatValue(), SGPropertyNode::setIntValue(), SGPropertyNode::setLongValue(), SGPropertyNode::setStringValue(), and SGPropertyNode::setUnspecifiedValue().

Referenced by copyProperties(), and PropsVisitor::startElement().

void readProperties ( const char *  buf,
const int  size,
SGPropertyNode start_node,
int  default_mode 
)

Read properties from an in-memory buffer.

Parameters:
buf A character buffer containing the xml data.
size The size/length of the buffer in bytes
start_node The root node for reading properties.
Returns:
true if the read succeeded, false otherwise.

Definition at line 371 of file props_io.cxx.

References PropsVisitor::getException(), PropsVisitor::hasException(), and XMLVisitor::readXML().

void readProperties ( const string &  file,
SGPropertyNode start_node,
int  default_mode 
)

Read properties from an XML file.

Parameters:
file A string containing the file path.
start_node The root node for reading properties.
Returns:
true if the read succeeded, false otherwise.

Definition at line 353 of file props_io.cxx.

References PropsVisitor::getException(), PropsVisitor::hasException(), and XMLVisitor::readXML().

void readProperties ( istream &  input,
SGPropertyNode start_node,
const string &  base,
int  default_mode 
)

Read properties from an XML input stream.

Parameters:
input The input stream containing an XML property file.
start_node The root node for reading properties.
base A base path for resolving external include references.
Returns:
true if the read succeeded, false otherwise.

Definition at line 335 of file props_io.cxx.

References PropsVisitor::getException(), PropsVisitor::hasException(), and XMLVisitor::readXML().


Generated on Mon Dec 17 09:30:56 2007 for SimGear by  doxygen 1.5.1