From: <sg...@us...> - 2003-11-17 22:00:55
|
Update of /cvsroot/libfunutil/libfunutil/client/s11nconvert In directory sc8-pr-cvs1:/tmp/cvs-serv18024/client/s11nconvert Modified Files: Makefile ns.AltSerializable.cpp ns.AltSerializable.h ns.BarClass.cpp ns.BarClass.h ns.FooClass.cpp ns.FooClass.h ns.LoadableClass.h ns.main.cpp ns.maser.cpp Log Message: s11n finally integrated into fun namespace. Still a few filename stepping-on-toes problems to solve. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 17 Nov 2003 20:53:53 -0000 1.4 +++ Makefile 17 Nov 2003 22:00:45 -0000 1.5 @@ -28,7 +28,7 @@ @echo -e "tip: build with\n\tALTS11N=classname ${MAKE}\nto set the default Serializable implementation used (e.g.) by the -d option.";\ echo "The current Serializable type is $(SERIALIZABLE_TYPE)." -SERIALIZABLE_TYPE = s11n::Serializable +SERIALIZABLE_TYPE = $(S11N_NAMESPACE)::Serializable ifeq (1,${ALTS11N}) SERIALIZABLE_TYPE = alts11n::AltSerializable else Index: ns.AltSerializable.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.AltSerializable.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.AltSerializable.cpp 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.AltSerializable.cpp 17 Nov 2003 22:00:45 -0000 1.2 @@ -1,14 +1,14 @@ #include "AltSerializable.h" -#include <s11n/debuggering_macros.h> // COUT/CERR -#include <s11n/class_loader.h> // COUT/CERR -#include <s11n/argv_parser.h> // COUT/CERR +#include <S11N_NAMESPACE/debuggering_macros.h> // COUT/CERR +#include <S11N_NAMESPACE/class_loader.h> // COUT/CERR +#include <S11N_NAMESPACE/argv_parser.h> // COUT/CERR -#define VERBOSE if (s11n::argv_parser::args().get_bool( "v", false ) ) CERR +#define VERBOSE if (S11N_NAMESPACE::argv_parser::args().get_bool( "v", false ) ) CERR /** A test class for demonstrating the ability to use - non-s11n::Serializable types with the s11n framework. + non-S11N_NAMESPACE::Serializable types with the s11n framework. */ namespace alts11n { AltSerializable::AltSerializable(){}; @@ -90,4 +90,4 @@ return b; } }; - // namespace alts11n:: + // namespace alts11n Index: ns.AltSerializable.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.AltSerializable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.AltSerializable.h 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.AltSerializable.h 17 Nov 2003 22:00:45 -0000 1.2 @@ -2,10 +2,10 @@ #define ALTS11N_ALTSERIALIZABLE_H_INCLUDED 1 #include <string> -#include <s11n/s11n_node.h> +#include <S11N_NAMESPACE/s11n_node.h> /** A test class for demonstrating the ability to use - non-s11n::Serializable types with the s11n framework. + non-S11N_NAMESPACE::Serializable types with the s11n framework. */ namespace alts11n { class AltSerializable @@ -15,7 +15,7 @@ public: AltSerializable(); virtual ~AltSerializable(); - typedef s11n::s11n_node state; + typedef S11N_NAMESPACE::s11n_node state; virtual bool save_state( state & node ) const; virtual bool load_state( const state & node ); void bogo_method(std::string str= ""); @@ -34,10 +34,10 @@ virtual ~AltSubSub(); virtual bool load_state( const AltSerializable::state & node ); }; -} // namespace alts11n:: +} // namespace alts11n -#include <s11n/serializable_adapter.h> +#include <S11N_NAMESPACE/serializable_adapter.h> /** This creates the required serializable_adapter<AltSerializable> specializations to map the AltSerializable API to @@ -47,7 +47,7 @@ de/serialize() function signatures differ from the defaults. It also registers the types with the appropriate - s11n::class_loader and sets up s11n::class_name<> + S11N_NAMESPACE::class_loader and sets up S11N_NAMESPACE::class_name<> specializations. */ #define EASY_WAY 0 @@ -57,7 +57,7 @@ CLASSLOADER_REGISTER(alts11n::AltSerializable,alts11n::AltSerializable); CLASS_NAME(alts11n::AltSerializable); namespace { - typedef s11n::s11n_node node_type; + typedef S11N_NAMESPACE::s11n_node node_type; template <> struct serializable_adapter<alts11n::AltSerializable,node_type> { typedef alts11n::AltSerializable serializable_type; Index: ns.BarClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.BarClass.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.BarClass.cpp 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.BarClass.cpp 17 Nov 2003 22:00:45 -0000 1.2 @@ -1,9 +1,9 @@ -#include <s11n/s11n-macros.h> // COUT/CERR +#include <S11N_NAMESPACE/s11n-macros.h> // COUT/CERR #include "BarClass.h" -using namespace s11n; +using namespace S11N_NAMESPACE; using namespace std; Index: ns.BarClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.BarClass.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.BarClass.h 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.BarClass.h 17 Nov 2003 22:00:46 -0000 1.2 @@ -1,19 +1,19 @@ -#include <s11n/s11n-macros.h> // COUT/CERR -#include <s11n/s11n_node.h> +#include <S11N_NAMESPACE/s11n-macros.h> // COUT/CERR +#include <S11N_NAMESPACE/s11n_node.h> -using namespace s11n; +using namespace S11N_NAMESPACE; using namespace std; -// #include <s11n/serializable_adapter.h> -#include <s11n/Serializable.h> +// #include <S11N_NAMESPACE/serializable_adapter.h> +#include <S11N_NAMESPACE/Serializable.h> -struct BarClass: public s11n::Serializable +struct BarClass: public S11N_NAMESPACE::Serializable { std::string name; int magic_number; BarClass( ); virtual ~ BarClass( ); - virtual bool s7e( s11n::s11n_node & ser ) const; - virtual bool d9e( const s11n::s11n_node & node ); + virtual bool s7e( S11N_NAMESPACE::s11n_node & ser ) const; + virtual bool d9e( const S11N_NAMESPACE::s11n_node & node ); }; -SERIALIZABLE_REGISTER(s11n::Serializable,BarClass); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,BarClass); Index: ns.FooClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.FooClass.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.FooClass.cpp 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.FooClass.cpp 17 Nov 2003 22:00:46 -0000 1.2 @@ -1,16 +1,16 @@ -#include <s11n/s11n-macros.h> // COUT/CERR -#include <s11n/s11n_globals.h> // registration-related macros -// #include <s11n/class_loader.h> -// #include <s11n/instantiator.h> +#include <S11N_NAMESPACE/s11n-macros.h> // COUT/CERR +#include <S11N_NAMESPACE/s11n_globals.h> // registration-related macros +// #include <S11N_NAMESPACE/class_loader.h> +// #include <S11N_NAMESPACE/instantiator.h> #include "FooClass.h" -using namespace s11n; +using namespace S11N_NAMESPACE; using namespace std; namespace foo { - using namespace s11n; + using namespace S11N_NAMESPACE; using namespace std; struct Baz : public foo::FooClass @@ -24,8 +24,8 @@ } // namespace foo -SERIALIZABLE_REGISTER(s11n::Serializable,foo::BarClass); -SERIALIZABLE_REGISTER(s11n::Serializable,foo::Baz); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,foo::BarClass); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,foo::Baz); namespace { @@ -37,7 +37,7 @@ int dll_loader_bootstrap() { CERR << "dll_loader_bootstrap()" << endl; - typedef s11n::class_loader<s11n::Serializable> CL; + typedef S11N_NAMESPACE::class_loader<S11N_NAMESPACE::Serializable> CL; CL::register_subtype<foo::FooClass>("foo::WonderBra"); return 0; } @@ -45,7 +45,7 @@ } namespace foo { -using namespace s11n; +using namespace S11N_NAMESPACE; using namespace std; FooClass::FooClass() Index: ns.FooClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.FooClass.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.FooClass.h 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.FooClass.h 17 Nov 2003 22:00:46 -0000 1.2 @@ -1,19 +1,19 @@ #ifndef FOO_H_INCLUDED #define FOO_H_INCLUDED 1 -#include <s11n/s11n_node.h> -#include <s11n/Serializable.h> +#include <S11N_NAMESPACE/s11n_node.h> +#include <S11N_NAMESPACE/Serializable.h> #include <vector> namespace foo { - struct FooClass : public s11n::Serializable + struct FooClass : public S11N_NAMESPACE::Serializable { std::vector<int> m_vec; std::string name; FooClass( ); virtual ~ FooClass( ); - virtual bool s7e( s11n::s11n_node & ser ) const; - virtual bool d9e( const s11n::s11n_node & ser ); + virtual bool s7e( S11N_NAMESPACE::s11n_node & ser ) const; + virtual bool d9e( const S11N_NAMESPACE::s11n_node & ser ); // private: // void bogosity(){} @@ -21,6 +21,6 @@ }; }; // namespace foo -SERIALIZABLE_REGISTER(s11n::Serializable,foo::FooClass); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,foo::FooClass); #endif // FOO_H_INCLUDED Index: ns.LoadableClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.LoadableClass.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.LoadableClass.h 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.LoadableClass.h 17 Nov 2003 22:00:47 -0000 1.2 @@ -2,7 +2,7 @@ #define LOADABLECLASS_H_INCLUDED 1 #include <iostream> -#include <s11n/s11n-macros.h> // COUT +#include <S11N_NAMESPACE/s11n-macros.h> // COUT struct LoadableClass { Index: ns.main.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.main.cpp 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.main.cpp 17 Nov 2003 22:00:47 -0000 1.2 @@ -11,31 +11,31 @@ #include <time.h> // time() #include <unistd.h> // isatty() -#include <s11n/argv_parser.h> +#include <S11N_NAMESPACE/argv_parser.h> // #include <iterator> // for use with std::copy() -#include <s11n/s11n-macros.h> // COUT/CERR -#include <s11n/s11n_globals.h> // library_version() -#include <s11n/s11n_node.h> +#include <S11N_NAMESPACE/s11n-macros.h> // COUT/CERR +#include <S11N_NAMESPACE/s11n_globals.h> // library_version() +#include <S11N_NAMESPACE/s11n_node.h> -#include <s11n/eprintf.h> // efstring() -#include <s11n/pointer_list.h> -#include <s11n/property_store.h> -#include <s11n/class_loader.h> -#include <s11n/class_name.h> -#include <s11n/instantiator.h> +// #include <S11N_NAMESPACE/eprintf.h> // efstring() +#include <S11N_NAMESPACE/pointer_list.h> +#include <S11N_NAMESPACE/property_store.h> +#include <S11N_NAMESPACE/class_loader.h> +#include <S11N_NAMESPACE/class_name.h> +#include <S11N_NAMESPACE/instantiator.h> -#include <s11n/s11n_io.h> -#include <s11n/serializer_loader.h> -#include <s11n/node_loader.h> +#include <S11N_NAMESPACE/s11n_io.h> +#include <S11N_NAMESPACE/serializer_loader.h> +#include <S11N_NAMESPACE/node_loader.h> -#include <s11n/Serializable.h> -// #include <s11n/serializable_adapter.h> -// SERIALIZABLE_ADAPTER(s11n::Serializable,s7e,d9e); +#include <S11N_NAMESPACE/Serializable.h> +// #include <S11N_NAMESPACE/serializable_adapter.h> +// SERIALIZABLE_ADAPTER(S11N_NAMESPACE::Serializable,s7e,d9e); -// #include <s11n/include_from_main.h> +// #include <S11N_NAMESPACE/include_from_main.h> #if HAVE_CONFIG_H # include "config.h" // S11N_LIBRARY_VERSION, PACKAGE_{VERSION,NAME} @@ -44,26 +44,28 @@ # error S11N_LIBRARY_VERSION must be set! #endif +#ifndef PACKAGE_LICENSE +#define PACKAGE_LICENSE "Public Domain" +#endif #if HAVE_ZLIB -# include <s11n/gzstream.h> +# include <S11N_NAMESPACE/gzstream.h> #endif #if HAVE_BZLIB -# include <s11n/bzstream.h> +# include <S11N_NAMESPACE/bzstream.h> #endif #ifndef SERIALIZABLE_TYPE -# define SERIALIZABLE_TYPE s11n::Serializable +# define SERIALIZABLE_TYPE S11N_NAMESPACE::Serializable #endif #ifndef SERIALIZABLE_TYPE_STRING -# define SERIALIZABLE_TYPE_STRING "s11n::Serializable" +# define SERIALIZABLE_TYPE_STRING "S11N_NAMESPACE::Serializable" #endif #include "AltSerializable.h" -using namespace s11n; -using namespace s11n; +using namespace S11N_NAMESPACE; using namespace std; @@ -73,7 +75,7 @@ #define VERBOSE if( ARGV::args().get_bool( "v", ARGV::args().get_bool( "verbose", false ) ) ) CERR #define GIGOVERBOSE VERBOSE << "id["<<this->m_id<<"@"<<depth<<"] " -typedef s11n::argv_parser ARGV; +typedef S11N_NAMESPACE::argv_parser ARGV; #define QUIETLY if( ! ARGV::args().get_bool( "q", ARGV::args().get_bool( "quiet", false ) ) ) CERR // ^^^^ output unless -q is set @@ -97,7 +99,7 @@ Garbage In, Garbage Out. For generating lots of junk serialized data quickly. */ -class GIGO : public s11n::Serializable +class GIGO : public S11N_NAMESPACE::Serializable { public: typedef std::map<int,std::string> IntStrMap; @@ -106,11 +108,11 @@ static unsigned long total_inst_count; IntStrMap istrmap; DblStrMap dstrmap; - typedef s11n::pointer_list<GIGO> list_type; + typedef S11N_NAMESPACE::pointer_list<GIGO> list_type; typedef std::list<std::string> SL; SL slist; list_type childs; - s11n::property_store props; + S11N_NAMESPACE::property_store props; unsigned long m_id; GIGO() { @@ -152,11 +154,11 @@ } int rnd = random() % 10; - std::string pname; + std::string pname = "property"; std::string pval; for( int i = 0; i < rnd; i++ ) { - pname = s11n::efstring( "property",i ); +// pname = S11N_NAMESPACE::efstring( "property",i ); pval = random_ascii( random() % 50 ); props.set( pname, pval ); } @@ -230,7 +232,7 @@ /** Register with the framework: */ -SERIALIZABLE_REGISTER(s11n::Serializable,GIGO); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,GIGO); /** A test namespace. @@ -240,14 +242,14 @@ /** A test class. */ - struct FakeRoot : public s11n::Serializable + struct FakeRoot : public S11N_NAMESPACE::Serializable { std::string m_foo; std::string m_bar; typedef std::map<double,std::string> IntStrMap; typedef std::map<double,std::string> DblStrMap; - typedef pointer_list < s11n::Serializable > FakeVec; + typedef pointer_list < S11N_NAMESPACE::Serializable > FakeVec; //typedef std::vector<BarClass *> FakeVec; FakeVec m_vec; FakeRoot() @@ -278,7 +280,7 @@ VERBOSE << "theother=="<<std::hex<<theother<<std::endl; delete( theother ); m_vec.delete_all(); - // node.deserialize_children<s11n::Serializable>( "foo_child", m_vec ); + // node.deserialize_children<S11N_NAMESPACE::Serializable>( "foo_child", m_vec ); unsigned long count = 0; count = node.deserialize_children( "foo_child", m_vec ); VERBOSE << "deser: foo_child count: "<<count<<", and m_vec.size() says: " << m_vec.size() << std::endl; @@ -309,13 +311,13 @@ }; }; // namespace fake -SERIALIZABLE_REGISTER(s11n::Serializable,fake::FakeRoot); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,fake::FakeRoot); s11n_node *gigo( unsigned int gcount ) { - s11n::pointer_list<GIGO> gc; + S11N_NAMESPACE::pointer_list<GIGO> gc; gc.auto_delete( true ); GIGO * g = new GIGO(); gc.push_back( g ); @@ -339,7 +341,7 @@ out << APP_NAME << " " << APP_VERSION << std::endl; out << "s11n library version: " << std::endl; out << "\tCompiled for: " << S11N_LIBRARY_VERSION << std::endl; - out << "\tRunning with: " << s11n::library_version() << std::endl; + out << "\tRunning with: " << S11N_NAMESPACE::library_version() << std::endl; out << "Serializer interface: " << SERIALIZABLE_TYPE_STRING << std::endl; out << "License: " << PACKAGE_LICENSE << std::endl; @@ -350,11 +352,11 @@ CERR << "load_serializable<"<<# ST<<">("<<FN<<") = " << std::hex<<root << std::endl; \ delete( root ); - s11n::Serializable * root = 0; + S11N_NAMESPACE::Serializable * root = 0; // fake::FakeRoot * root = 0; std::string infile = "in.s11n"; LOAD_SERIALIZABLE(fake::FakeRoot,infile); - LOAD_SERIALIZABLE(s11n::Serializable,"in.s11n"); + LOAD_SERIALIZABLE(S11N_NAMESPACE::Serializable,"in.s11n"); // fake::FakeRoot root; // s11n_node node; @@ -372,10 +374,10 @@ #define TEST_ANY 0 #if TEST_ANY -#include <s11n/any.h> +#include <S11N_NAMESPACE/any.h> void any_test() { - using s11n::any; + using S11N_NAMESPACE::any; any a = "12.12"; #define TESTANY(vaL,typE,defaulT) a = vaL; CERR << "any("<<a<<").get<"<<#typE<<">(err=["<<defaulT<<"]) = " << a.get<typE>(defaulT) << std::endl; TESTANY(17.17,double,-1.0); @@ -412,7 +414,7 @@ // SHOW_CLASS_NAME(alts11n::AltSubSub); // SHOW_CLASS_NAME(alts11n::AltSerializable); - if( S11N_LIBRARY_VERSION != s11n::library_version() ) + if( S11N_LIBRARY_VERSION != S11N_NAMESPACE::library_version() ) { CERR << "Warning: your libs11n does not match the one this was compiled against. " << "This might not work at all!" << std::endl; @@ -431,7 +433,7 @@ ErrorCloningFailed = 6 }; - s11n::argv_parser & args = s11n::argv_parser::args( argc, argv ); + S11N_NAMESPACE::argv_parser & args = S11N_NAMESPACE::argv_parser::args( argc, argv ); args.set_help( "f filename", "input filename. Same as --file." ); args.set_help( "o filename", "output filename. Filename of - means stdout. Remember to also use -oFORMAT" ); @@ -444,10 +446,10 @@ args.set_help( "ot", "output in fun::txt format" ); args.set_help( "ox", "output in fun::xml format" ); - args.set_help( "osx", "output in s11n::simplexml format" ); - args.set_help( "op", "output in s11n::parens format" ); - args.set_help( "oh", "output in s11n::hex format" ); - args.set_help( "oc", "output in s11n::compact format" ); + args.set_help( "osx", "output in S11N_NAMESPACE::simplexml format" ); + args.set_help( "op", "output in S11N_NAMESPACE::parens format" ); + args.set_help( "oh", "output in S11N_NAMESPACE::hex format" ); + args.set_help( "oc", "output in S11N_NAMESPACE::compact format" ); args.set_help( "q, quiet", "disable some warnings." ); @@ -457,7 +459,7 @@ args.set_help( "nodedebug", "enable s11n_node debug output" ); - if( "s11n::Serializable" == SERIALIZABLE_TYPE_STRING ) + if( "S11N_NAMESPACE::Serializable" == SERIALIZABLE_TYPE_STRING ) { args.set_help( "sopath path", "Sets the classloader path. Use a :-delimited list." ); } @@ -514,11 +516,11 @@ #endif // set library-wide compression policy: - if( args.get_bool( "z", false ) ) s11n::compression_policy( s11n::GZipCompression ); - else if( args.get_bool( "bz", false ) ) s11n::compression_policy( s11n::BZipCompression ); + if( args.get_bool( "z", false ) ) S11N_NAMESPACE::compression_policy( S11N_NAMESPACE::GZipCompression ); + else if( args.get_bool( "bz", false ) ) S11N_NAMESPACE::compression_policy( S11N_NAMESPACE::BZipCompression ); s11n_node::debug_level( args.get_bool( "nodedebug", false ) ? 1 : 0 ); - s11n::class_loader_debug_level( args.get_bool( "cldebug", false ) ? 1 : 0 ); + S11N_NAMESPACE::class_loader_debug_level( args.get_bool( "cldebug", false ) ? 1 : 0 ); // CERR << "debug level: " << s11n_node::debug_level() << std::endl; @@ -606,7 +608,7 @@ } else { - os = s11n::get_ostream( ofilename ); // possibly returns a compressor stream. + os = S11N_NAMESPACE::get_ostream( ofilename ); // possibly returns a compressor stream. warnonsavefail = true; } @@ -627,7 +629,7 @@ { // deserialize the data? // typedef class_loader<base_serializable_adapter> AdCL; -// AdCL::value_type * whoa = AdCL::load_class( //"serializable_adapter<s11n::Serializable>" +// AdCL::value_type * whoa = AdCL::load_class( //"serializable_adapter<S11N_NAMESPACE::Serializable>" // std::string( "serializable_adapter<" ) + // std::string( SERIALIZABLE_TYPE_STRING ) + // std::string( ">" ) @@ -656,7 +658,7 @@ serializable_type * clone = 0; if( args.get_bool( "dc", false ) ) { - clone = s11n::s11n_clone( *ser ); + clone = S11N_NAMESPACE::s11n_clone( *ser ); CERR << "s11n_clone()"<< (clone ? "worked" : "failed" ) << std::endl; if( ! clone ) return ErrorCloningFailed; } Index: ns.maser.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.maser.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.maser.cpp 17 Nov 2003 20:53:43 -0000 1.1 +++ ns.maser.cpp 17 Nov 2003 22:00:48 -0000 1.2 @@ -17,35 +17,35 @@ #include <time.h> // time() #include <unistd.h> // isatty() -#include <s11n/argv_parser.h> -#include <s11n/string_util.h> // translate_entities() +#include <S11N_NAMESPACE/argv_parser.h> +#include <S11N_NAMESPACE/string_util.h> // translate_entities() // #include <iterator> // for use with std::copy() -// #include <s11n/s11n_io.h> -#include <s11n/s11n-macros.h> // COUT/CERR -#include <s11n/s11n_globals.h> // library_version() -#include <s11n/s11n_node.h> +// #include <S11N_NAMESPACE/s11n_io.h> +#include <S11N_NAMESPACE/s11n-macros.h> // COUT/CERR +#include <S11N_NAMESPACE/s11n_globals.h> // library_version() +#include <S11N_NAMESPACE/s11n_node.h> -#include <s11n/node_loader.h> +#include <S11N_NAMESPACE/node_loader.h> -#include <s11n/Serializable.h> -#include <s11n/Serializer.h> +#include <S11N_NAMESPACE/Serializable.h> +#include <S11N_NAMESPACE/Serializer.h> #if HAVE_CONFIG_H # include "config.h" // S11N_LIBRARY_VERSION, PACKAGE_{VERSION,NAME} #endif #ifndef SERIALIZABLE_TYPE -# define SERIALIZABLE_TYPE s11n::Serializable +# define SERIALIZABLE_TYPE S11N_NAMESPACE::Serializable #endif #ifndef SERIALIZABLE_TYPE_STRING -# define SERIALIZABLE_TYPE_STRING "s11n::Serializable" +# define SERIALIZABLE_TYPE_STRING "S11N_NAMESPACE::Serializable" #endif -using namespace s11n; -using namespace s11n; +using namespace S11N_NAMESPACE; +using namespace S11N_NAMESPACE; using namespace std; @@ -54,7 +54,7 @@ #define VERBOSE if( ARGV::args().get_bool( "v", ARGV::args().get_bool( "verbose", false ) ) ) CERR -typedef s11n::argv_parser ARGV; +typedef S11N_NAMESPACE::argv_parser ARGV; #define QUIETLY if( ! ARGV::args().get_bool( "q", ARGV::args().get_bool( "quiet", false ) ) ) CERR // ^^^^ output unless -q is set @@ -134,7 +134,7 @@ xmap["\n"] = std::string("\n") + prefix; } - s11n::translate_entities( cmt, xmap ); + S11N_NAMESPACE::translate_entities( cmt, xmap ); os << cmt << std::endl; } @@ -232,7 +232,7 @@ out << APP_NAME << " " << APP_VERSION << std::endl; out << "s11n library version: " << std::endl; out << "\tCompiled for: " << S11N_LIBRARY_VERSION << std::endl; - out << "\tRunning with: " << s11n::library_version() << std::endl; + out << "\tRunning with: " << S11N_NAMESPACE::library_version() << std::endl; out << "Serializer interface: " << SERIALIZABLE_TYPE_STRING << std::endl; out << "License: " << PACKAGE_LICENSE << std::endl; } @@ -244,7 +244,7 @@ srandom( ::time(NULL) ); - if( S11N_LIBRARY_VERSION != s11n::library_version() ) + if( S11N_LIBRARY_VERSION != S11N_NAMESPACE::library_version() ) { CERR << "Warning: your libs11n does not match the one this was compiled against. " << "This might not work at all!" << std::endl; @@ -261,7 +261,7 @@ ErrorNoFileSpecified = 4 }; - s11n::argv_parser & args = s11n::argv_parser::args( argc, argv ); + S11N_NAMESPACE::argv_parser & args = S11N_NAMESPACE::argv_parser::args( argc, argv ); args.set_help( "f filename", "input filename. Same as --file." ); args.set_help( "o filename", "output filename. Filename of - means stdout. Remember to also use -oFORMAT" ); @@ -269,7 +269,7 @@ args.set_help( "q, quiet", "disable some warnings." ); args.set_help( "v, verbose", "enable some extra output." ); - if( "s11n::Serializable" == SERIALIZABLE_TYPE_STRING ) + if( "S11N_NAMESPACE::Serializable" == SERIALIZABLE_TYPE_STRING ) { args.set_help( "sopath path", "Sets the classloader path. Use a :-delimited list." ); } @@ -315,7 +315,7 @@ } typedef auto_ptr<s11n_node> NODE; - NODE node = NODE( s11n::node_loader::load_node( infilename ) ); + NODE node = NODE( S11N_NAMESPACE::node_loader::load_node( infilename ) ); if( ! node.get() ) { CERR << "Error loading file '"<<infilename<<"'!"<<std::endl; |