From 918f8a3ed4510909041029f26107096b75279c26 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 15 Mar 2002 23:16:46 +0000 Subject: [PATCH] Patches from Tony Peden to separate property XML I/O operations into a separate header file. This change will help integrate properties into JSBSim. --- simgear/misc/Makefile.am | 1 + simgear/misc/commands.cxx | 1 + simgear/misc/props.hxx | 40 ---------------------- simgear/misc/props_io.cxx | 1 + simgear/misc/props_io.hxx | 68 +++++++++++++++++++++++++++++++++++++ simgear/misc/props_test.cxx | 1 + 6 files changed, 72 insertions(+), 40 deletions(-) create mode 100644 simgear/misc/props_io.hxx diff --git a/simgear/misc/Makefile.am b/simgear/misc/Makefile.am index 3c846bf9..865678b3 100644 --- a/simgear/misc/Makefile.am +++ b/simgear/misc/Makefile.am @@ -6,6 +6,7 @@ include_HEADERS = \ commands.hxx \ exception.hxx \ props.hxx \ + props_io.hxx \ sg_path.hxx \ sgstream.hxx \ stopwatch.hxx \ diff --git a/simgear/misc/commands.cxx b/simgear/misc/commands.cxx index 2280b664..a4669f35 100644 --- a/simgear/misc/commands.cxx +++ b/simgear/misc/commands.cxx @@ -5,6 +5,7 @@ // $Id$ #include "commands.hxx" +#include "props_io.hxx" diff --git a/simgear/misc/props.hxx b/simgear/misc/props.hxx index 977edca1..0bd2f333 100644 --- a/simgear/misc/props.hxx +++ b/simgear/misc/props.hxx @@ -1108,46 +1108,6 @@ private: }; - - -//////////////////////////////////////////////////////////////////////// -// I/O functions. -//////////////////////////////////////////////////////////////////////// - - -/** - * Read properties from an XML input stream. - */ -void readProperties (istream &input, SGPropertyNode * start_node, - const string &base = ""); - - -/** - * Read properties from an XML file. - */ -void readProperties (const string &file, SGPropertyNode * start_node); - - -/** - * Write properties to an XML output stream. - */ -void writeProperties (ostream &output, const SGPropertyNode * start_node, - bool write_all = false); - - -/** - * Write properties to an XML file. - */ -void writeProperties (const string &file, const SGPropertyNode * start_node, - bool write_all = false); - - -/** - * Copy properties from one node to another. - */ -bool copyProperties (const SGPropertyNode *in, SGPropertyNode *out); - - #endif // __PROPS_HXX // end of props.hxx diff --git a/simgear/misc/props_io.cxx b/simgear/misc/props_io.cxx index 54080292..706ab6b8 100644 --- a/simgear/misc/props_io.cxx +++ b/simgear/misc/props_io.cxx @@ -9,6 +9,7 @@ #include "sg_path.hxx" #include "props.hxx" +#include "props_io.hxx" #include STL_IOSTREAM #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS) diff --git a/simgear/misc/props_io.hxx b/simgear/misc/props_io.hxx new file mode 100644 index 00000000..f5ed425f --- /dev/null +++ b/simgear/misc/props_io.hxx @@ -0,0 +1,68 @@ +/** + * \file props_io.hxx + * 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$ + */ + +#ifndef __PROPS_IO_HXX +#define __PROPS_IO_HXX + +#include +#include + +#include + +#include STL_STRING +#include +#include +#include STL_IOSTREAM + +SG_USING_STD(string); +SG_USING_STD(vector); +SG_USING_STD(map); +#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS) +SG_USING_STD(istream); +SG_USING_STD(ostream); +#endif + +/** + * Read properties from an XML input stream. + */ +void readProperties (istream &input, SGPropertyNode * start_node, + const string &base = ""); + + +/** + * Read properties from an XML file. + */ +void readProperties (const string &file, SGPropertyNode * start_node); + + +/** + * Write properties to an XML output stream. + */ +void writeProperties (ostream &output, const SGPropertyNode * start_node, + bool write_all = false); + + +/** + * Write properties to an XML file. + */ +void writeProperties (const string &file, const SGPropertyNode * start_node, + bool write_all = false); + + +/** + * Copy properties from one node to another. + */ +bool copyProperties (const SGPropertyNode *in, SGPropertyNode *out); + + +#endif // __PROPS_IO_HXX + +// end of props_io.hxx diff --git a/simgear/misc/props_test.cxx b/simgear/misc/props_test.cxx index 15a48abc..6f847b55 100644 --- a/simgear/misc/props_test.cxx +++ b/simgear/misc/props_test.cxx @@ -7,6 +7,7 @@ #include STL_IOSTREAM #include "props.hxx" +#include "props_io.hxx" #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); -- 2.39.5