You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(58) |
Sep
(79) |
Oct
(41) |
Nov
(80) |
Dec
(23) |
---|
From: <sg...@us...> - 2003-11-20 12:51:44
|
Update of /cvsroot/libfunutil/libfunutil/toc/make In directory sc8-pr-cvs1:/tmp/cvs-serv449 Modified Files: PCH.make Log Message: doh. had wrong naming convention for pch files. RTFM, man. Index: PCH.make =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/make/PCH.make,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PCH.make 20 Nov 2003 12:32:10 -0000 1.1 +++ PCH.make 20 Nov 2003 12:51:02 -0000 1.2 @@ -1,23 +1,25 @@ #!/do/not/make ############################################################ -# EXPERIMENTAL .pch support (20.11.2003) +# EXPERIMENTAL .gch support (20.11.2003) # # Clients must define: # # PRECOMPILED_HEADERS_CXX = list of C++ headers # PRECOMPILED_HEADERS_C = list of C headers # -# Running the PCH target will create *.pch for each *.h +# Running the PCH target will create *.gch for each *.h + +PCH_SUFFIX ?= .gch COMPILE_COMMAND_CXX_PCH = $(CXX) $(CXXFLAGS) \ - $(CPPFLAGS) -xc++ $(TARGET_ARCH) -c -o $(1) $(patsubst %.pch,%.h,$(1)) + $(CPPFLAGS) -xc++ $(TARGET_ARCH) -c -o $(1) $(patsubst %$(PCH_SUFFIX),%,$(1)) COMPILE_COMMAND_C_PCH = $(CC) $(CFLAGS) \ - $(CPPFLAGS) -xc $(TARGET_ARCH) -c -o $(1) $(patsubst %.pch,%.h,$(1)) + $(CPPFLAGS) -xc $(TARGET_ARCH) -c -o $(1) $(patsubst %$(PCH_SUFFIX),%,$(1)) -%.pch: %.h -PCH_CXX = $(patsubst %.h,%.pch,$(PRECOMPILED_HEADERS_CXX)) +PCH_CXX = $(addsuffix $(PCH_SUFFIX),$(PRECOMPILED_HEADERS_CXX)) + $(PCH_CXX): ifeq (1,$(configure_build_quietly)) @echo "Precompiling $@..."; \ @@ -26,7 +28,7 @@ $(call COMPILE_COMMAND_CXX_PCH,$@) endif -PCH_C = $(patsubst %.h,%.pch,$(PRECOMPILED_HEADERS_C)) +PCH_C = $(patsubst %.h,%$(PCH_SUFFIX),$(PRECOMPILED_HEADERS_C)) $(PCH_C): ifeq (1,$(configure_build_quietly)) @echo "Precompiling $<..."; \ @@ -35,5 +37,15 @@ $(call COMPILE_COMMAND_C_PCH,$@) endif +PCH_MAKEFILE = $(toc_makesdir)/PCH.make +PCH_RULES = .toc.PCH.make +$(PCH_RULES): $(PCH_MAKEFILE) Makefile + @echo "Creating precomiled headers rules ($@)..." + @echo '' > $@ + @for x in $(PCH_C) $(PCH_CXX); do \ + foo=$$x; foo=$${foo%%$(PCH_SUFFIX)}; \ + echo "$$x: $$foo" >> $@; \ + done + CLEAN_FILES += $(PCH_CXX) $(PCH_C) -PCH: $(PCH_CXX) $(PCH_C) +PCH: $(PCH_RULES) $(PCH_CXX) $(PCH_C) |
From: <sg...@us...> - 2003-11-20 12:32:51
|
Update of /cvsroot/libfunutil/libfunutil/toc/make In directory sc8-pr-cvs1:/tmp/cvs-serv30134 Added Files: PCH.make Log Message: egg --- NEW FILE: PCH.make --- #!/do/not/make ############################################################ # EXPERIMENTAL .pch support (20.11.2003) # # Clients must define: # # PRECOMPILED_HEADERS_CXX = list of C++ headers # PRECOMPILED_HEADERS_C = list of C headers # # Running the PCH target will create *.pch for each *.h COMPILE_COMMAND_CXX_PCH = $(CXX) $(CXXFLAGS) \ $(CPPFLAGS) -xc++ $(TARGET_ARCH) -c -o $(1) $(patsubst %.pch,%.h,$(1)) COMPILE_COMMAND_C_PCH = $(CC) $(CFLAGS) \ $(CPPFLAGS) -xc $(TARGET_ARCH) -c -o $(1) $(patsubst %.pch,%.h,$(1)) %.pch: %.h PCH_CXX = $(patsubst %.h,%.pch,$(PRECOMPILED_HEADERS_CXX)) $(PCH_CXX): ifeq (1,$(configure_build_quietly)) @echo "Precompiling $@..."; \ $(call COMPILE_COMMAND_CXX_PCH,$@) else $(call COMPILE_COMMAND_CXX_PCH,$@) endif PCH_C = $(patsubst %.h,%.pch,$(PRECOMPILED_HEADERS_C)) $(PCH_C): ifeq (1,$(configure_build_quietly)) @echo "Precompiling $<..."; \ $(call COMPILE_COMMAND_C_PCH,$@) else $(call COMPILE_COMMAND_C_PCH,$@) endif CLEAN_FILES += $(PCH_CXX) $(PCH_C) PCH: $(PCH_CXX) $(PCH_C) |
Update of /cvsroot/libfunutil/libfunutil/client/s11nconvert In directory sc8-pr-cvs1:/tmp/cvs-serv7754 Modified Files: Makefile ns.AltSerializable.cpp ns.AltSerializable.h ns.BarClass.cpp ns.BarClass.h ns.FooClass.cpp ns.FooClass.h ns.main.cpp ns.maser.cpp Log Message: build fixes Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 17 Nov 2003 22:00:45 -0000 1.5 +++ Makefile 19 Nov 2003 23:08:33 -0000 1.6 @@ -25,10 +25,10 @@ CLEAN_FILES += main2.* main.o: Makefile tip: FORCE - @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)." + @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_NAMESPACE)::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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.AltSerializable.cpp 17 Nov 2003 22:00:45 -0000 1.2 +++ ns.AltSerializable.cpp 19 Nov 2003 23:08:33 -0000 1.3 @@ -8,7 +8,7 @@ /** A test class for demonstrating the ability to use - non-S11N_NAMESPACE::Serializable types with the s11n framework. + non-S11N_NAMESPACE::serializable types with the s11n framework. */ namespace alts11n { AltSerializable::AltSerializable(){}; Index: ns.AltSerializable.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.AltSerializable.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.AltSerializable.h 17 Nov 2003 22:00:45 -0000 1.2 +++ ns.AltSerializable.h 19 Nov 2003 23:08:33 -0000 1.3 @@ -5,7 +5,7 @@ #include <S11N_NAMESPACE/s11n_node.h> /** A test class for demonstrating the ability to use - non-S11N_NAMESPACE::Serializable types with the s11n framework. + non-S11N_NAMESPACE::serializable types with the s11n framework. */ namespace alts11n { class AltSerializable @@ -41,7 +41,7 @@ /** This creates the required serializable_adapter<AltSerializable> specializations to map the AltSerializable API to - Serializable's. This is all it takes to make the framework able to + serializable's. This is all it takes to make the framework able to use AltSerializable. You may provide your own implementation, instead of using this macro, and you must do so if your de/serialize() function signatures differ from the defaults. Index: ns.BarClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.BarClass.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.BarClass.cpp 17 Nov 2003 22:00:45 -0000 1.2 +++ ns.BarClass.cpp 19 Nov 2003 23:08:33 -0000 1.3 @@ -21,7 +21,7 @@ bool BarClass::s7e( s11n_node & ser ) const { - if ( !this->Serializable::s7e( ser ) ) + if ( !this->serializable::s7e( ser ) ) return false; ser.set( "name", this->name ); ser.set( "magic_number", magic_number ); Index: ns.BarClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.BarClass.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.BarClass.h 17 Nov 2003 22:00:46 -0000 1.2 +++ ns.BarClass.h 19 Nov 2003 23:08:33 -0000 1.3 @@ -4,9 +4,9 @@ using namespace S11N_NAMESPACE; using namespace std; // #include <S11N_NAMESPACE/serializable_adapter.h> -#include <S11N_NAMESPACE/Serializable.h> +#include <S11N_NAMESPACE/serializable.h> -struct BarClass: public S11N_NAMESPACE::Serializable +struct BarClass: public S11N_NAMESPACE::serializable { std::string name; int magic_number; @@ -16,4 +16,4 @@ virtual bool d9e( const S11N_NAMESPACE::s11n_node & node ); }; -SERIALIZABLE_REGISTER(S11N_NAMESPACE::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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.FooClass.cpp 17 Nov 2003 22:00:46 -0000 1.2 +++ ns.FooClass.cpp 19 Nov 2003 23:08:33 -0000 1.3 @@ -24,8 +24,8 @@ } // namespace foo -SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,foo::BarClass); -SERIALIZABLE_REGISTER(S11N_NAMESPACE::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_NAMESPACE::class_loader<S11N_NAMESPACE::Serializable> CL; + typedef S11N_NAMESPACE::class_loader<S11N_NAMESPACE::serializable> CL; CL::register_subtype<foo::FooClass>("foo::WonderBra"); return 0; } @@ -63,7 +63,7 @@ bool FooClass::s7e( s11n_node & node ) const { - if ( !this->Serializable::s7e( node ) ) return false; + if ( !this->serializable::s7e( node ) ) return false; node.set( "name", this->name ); node.serialize_list( "vector", this->m_vec ); return true; @@ -74,7 +74,7 @@ { this->m_vec.clear(); CERR <<"deserialize() impl_class="<<node.impl_class() << std::endl; - if ( !this->Serializable::d9e( node ) ) return false; + if ( !this->serializable::d9e( node ) ) return false; this->name = node.get( "name", "<unnamed>" ); node.deserialize_list( "vector", this->m_vec ); CERR << "m_vec size = " << m_vec.size() << std::endl; Index: ns.FooClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.FooClass.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.FooClass.h 17 Nov 2003 22:00:46 -0000 1.2 +++ ns.FooClass.h 19 Nov 2003 23:08:33 -0000 1.3 @@ -2,11 +2,11 @@ #define FOO_H_INCLUDED 1 #include <S11N_NAMESPACE/s11n_node.h> -#include <S11N_NAMESPACE/Serializable.h> +#include <S11N_NAMESPACE/serializable.h> #include <vector> namespace foo { - struct FooClass : public S11N_NAMESPACE::Serializable + struct FooClass : public S11N_NAMESPACE::serializable { std::vector<int> m_vec; std::string name; @@ -21,6 +21,6 @@ }; }; // namespace foo -SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,foo::FooClass); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::serializable,foo::FooClass); #endif // FOO_H_INCLUDED Index: ns.main.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.main.cpp 17 Nov 2003 22:00:47 -0000 1.2 +++ ns.main.cpp 19 Nov 2003 23:08:33 -0000 1.3 @@ -30,9 +30,9 @@ #include <S11N_NAMESPACE/serializer_loader.h> #include <S11N_NAMESPACE/node_loader.h> -#include <S11N_NAMESPACE/Serializable.h> +#include <S11N_NAMESPACE/serializable.h> // #include <S11N_NAMESPACE/serializable_adapter.h> -// SERIALIZABLE_ADAPTER(S11N_NAMESPACE::Serializable,s7e,d9e); +// SERIALIZABLE_ADAPTER(S11N_NAMESPACE::serializable,s7e,d9e); // #include <S11N_NAMESPACE/include_from_main.h> @@ -56,10 +56,10 @@ #endif #ifndef SERIALIZABLE_TYPE -# define SERIALIZABLE_TYPE S11N_NAMESPACE::Serializable +# define SERIALIZABLE_TYPE S11N_NAMESPACE::serializable #endif #ifndef SERIALIZABLE_TYPE_STRING -# define SERIALIZABLE_TYPE_STRING "S11N_NAMESPACE::Serializable" +# define SERIALIZABLE_TYPE_STRING "S11N_NAMESPACE::serializable" #endif @@ -99,7 +99,7 @@ Garbage In, Garbage Out. For generating lots of junk serialized data quickly. */ -class GIGO : public S11N_NAMESPACE::Serializable +class GIGO : public S11N_NAMESPACE::serializable { public: typedef std::map<int,std::string> IntStrMap; @@ -176,7 +176,7 @@ virtual bool s7e( s11n_node & node ) const { - if( ! this->Serializable::s7e( node ) ) return false; + if( ! this->serializable::s7e( node ) ) return false; static long depth = 0; ++depth; GIGOVERBOSE << "GIG0::serialize()" << std::endl; @@ -192,7 +192,7 @@ } virtual bool d9e( const s11n_node & node ) { - if( ! this->Serializable::d9e( node ) ) return false; + if( ! this->serializable::d9e( node ) ) return false; static long depth = 0; ++depth; @@ -232,7 +232,7 @@ /** Register with the framework: */ -SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,GIGO); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::serializable,GIGO); /** A test namespace. @@ -242,14 +242,14 @@ /** A test class. */ - struct FakeRoot : public S11N_NAMESPACE::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_NAMESPACE::Serializable > FakeVec; + typedef pointer_list < S11N_NAMESPACE::serializable > FakeVec; //typedef std::vector<BarClass *> FakeVec; FakeVec m_vec; FakeRoot() @@ -263,7 +263,7 @@ virtual bool s7e( s11n_node & node ) const { VERBOSE << "FakeRoot::serialize()" << std::endl; - if ( !this->Serializable::s7e( node ) ) return false; + if ( !this->serializable::s7e( node ) ) return false; node.set( "foo", m_foo ); node.set( "bar", m_bar ); node.serialize_children( "childs", m_vec ); @@ -280,7 +280,7 @@ VERBOSE << "theother=="<<std::hex<<theother<<std::endl; delete( theother ); m_vec.delete_all(); - // node.deserialize_children<S11N_NAMESPACE::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; @@ -311,7 +311,7 @@ }; }; // namespace fake -SERIALIZABLE_REGISTER(S11N_NAMESPACE::Serializable,fake::FakeRoot); +SERIALIZABLE_REGISTER(S11N_NAMESPACE::serializable,fake::FakeRoot); s11n_node *gigo( unsigned int gcount ) @@ -342,7 +342,7 @@ out << "s11n library version: " << std::endl; out << "\tCompiled for: " << S11N_LIBRARY_VERSION << std::endl; out << "\tRunning with: " << S11N_NAMESPACE::library_version() << std::endl; - out << "Serializer interface: " << SERIALIZABLE_TYPE_STRING << std::endl; + out << "serializer interface: " << SERIALIZABLE_TYPE_STRING << std::endl; out << "License: " << PACKAGE_LICENSE << std::endl; #define VERSION_SHORTCUT 0 @@ -352,17 +352,17 @@ CERR << "load_serializable<"<<# ST<<">("<<FN<<") = " << std::hex<<root << std::endl; \ delete( root ); - S11N_NAMESPACE::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_NAMESPACE::Serializable,"in.s11n"); + LOAD_SERIALIZABLE(S11N_NAMESPACE::serializable,"in.s11n"); // fake::FakeRoot root; // s11n_node node; // node.serialize( "fake", root ); // node.serialize( "gigo", GIGO() ); -// ParenSerializer serializer; +// paren_serializer serializer; // serializer.serialize( node, std::cerr ); // fake::FakeRoot * clone = s11n_clone( root ); // serializer.basic_serializer::serialize( "boo", *clone, std::cerr ); // WTF must i qualify that??? @@ -459,7 +459,7 @@ args.set_help( "nodedebug", "enable s11n_node debug output" ); - if( "S11N_NAMESPACE::Serializable" == SERIALIZABLE_TYPE_STRING ) + if( "S11N_NAMESPACE::serializable" == SERIALIZABLE_TYPE_STRING ) { args.set_help( "sopath path", "Sets the classloader path. Use a :-delimited list." ); } @@ -501,7 +501,7 @@ ERRUR(ErrorMultipleCompressors,"Both -bz and -z were specified."); #endif ERRUR(ErrorCloningFailed,"the -dc command failed."); - std::cout << "\n[Serializer interface=" << SERIALIZABLE_TYPE_STRING << "]"<<std::endl; + std::cout << "\n[serializer interface=" << SERIALIZABLE_TYPE_STRING << "]"<<std::endl; std::cout << std::endl; return ErrorHelp; @@ -619,9 +619,9 @@ S8rLoader::register_subtype<FunXMLSerializer>( XMLFormat ); S8rLoader::register_subtype<SimpleXMLSerializer>( SimpleXMLFormat ); S8rLoader::register_subtype<FunTxtSerializer>( TextFormat ); - S8rLoader::register_subtype<ParenSerializer>( ParenFormat ); -// S8rLoader::register_subtype<HexSerializer>( HexFormat ); - S8rLoader::register_subtype<CompactSerializer>( CompactFormat ); + S8rLoader::register_subtype<paren_serializer>( ParenFormat ); +// S8rLoader::register_subtype<hex_serializer>( HexFormat ); + S8rLoader::register_subtype<compact_serializer>( CompactFormat ); serializer = S8rLoader::load_class( outmode ); @@ -629,7 +629,7 @@ { // deserialize the data? // typedef class_loader<base_serializable_adapter> AdCL; -// AdCL::value_type * whoa = AdCL::load_class( //"serializable_adapter<S11N_NAMESPACE::Serializable>" +// AdCL::value_type * whoa = AdCL::load_class( //"serializable_adapter<S11N_NAMESPACE::serializable>" // std::string( "serializable_adapter<" ) + // std::string( SERIALIZABLE_TYPE_STRING ) + // std::string( ">" ) @@ -638,7 +638,7 @@ // CERR << "impl_class()="<<whoa->impl_class() << std::endl; // CERR <<typeid(*whoa).name() << std::endl; // now what? we still can't get the exact TYPE we need at runtime, because - // various Serializables necessarily decend from different bases :( + // various serializables necessarily decend from different bases :( //typedef alts11n::AltSerializable serializable_type; typedef SERIALIZABLE_TYPE serializable_type; @@ -688,7 +688,7 @@ else if( serializer ) { workie = serializer->serialize( *root, *os ); - if( ! workie ) failreason = "Serializer's serialize() failed!"; + if( ! workie ) failreason = "serializer's serialize() failed!"; } Index: ns.maser.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/ns.maser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ns.maser.cpp 17 Nov 2003 22:00:48 -0000 1.2 +++ ns.maser.cpp 19 Nov 2003 23:08:33 -0000 1.3 @@ -29,18 +29,18 @@ #include <S11N_NAMESPACE/node_loader.h> -#include <S11N_NAMESPACE/Serializable.h> -#include <S11N_NAMESPACE/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_NAMESPACE::Serializable +# define SERIALIZABLE_TYPE S11N_NAMESPACE::serializable #endif #ifndef SERIALIZABLE_TYPE_STRING -# define SERIALIZABLE_TYPE_STRING "S11N_NAMESPACE::Serializable" +# define SERIALIZABLE_TYPE_STRING "S11N_NAMESPACE::serializable" #endif @@ -233,7 +233,7 @@ out << "s11n library version: " << std::endl; out << "\tCompiled for: " << S11N_LIBRARY_VERSION << std::endl; out << "\tRunning with: " << S11N_NAMESPACE::library_version() << std::endl; - out << "Serializer interface: " << SERIALIZABLE_TYPE_STRING << std::endl; + out << "serializer interface: " << SERIALIZABLE_TYPE_STRING << std::endl; out << "License: " << PACKAGE_LICENSE << std::endl; } @@ -269,7 +269,7 @@ args.set_help( "q, quiet", "disable some warnings." ); args.set_help( "v, verbose", "enable some extra output." ); - if( "S11N_NAMESPACE::Serializable" == SERIALIZABLE_TYPE_STRING ) + if( "S11N_NAMESPACE::serializable" == SERIALIZABLE_TYPE_STRING ) { args.set_help( "sopath path", "Sets the classloader path. Use a :-delimited list." ); } |
From: <sg...@us...> - 2003-11-19 23:08:57
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv7724 Modified Files: toc.s11n.make.at Log Message: another build fix Index: toc.s11n.make.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc.s11n.make.at,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- toc.s11n.make.at 19 Nov 2003 22:40:09 -0000 1.4 +++ toc.s11n.make.at 19 Nov 2003 23:08:14 -0000 1.5 @@ -34,10 +34,10 @@ ${MAKE} -C $(S11N_LIBDIR) L_S11N = -L$(S11N_LIBDIR) -l$(S11N_LIBNAME) S11N_CLIENT_LDADD = $(L_S11N) $(LIBCL_CLIENT_LDADD) -ifeq (1,$(configure_enable_zlib)) +ifeq (1,$(HAVE_ZLIB)) S11N_CLIENT_LDADD += -lz endif -ifeq (1,$(configure_enable_bzlib)) +ifeq (1,$(HAVE_BZLIB)) S11N_CLIENT_LDADD += -lbz2 endif |
From: <sg...@us...> - 2003-11-19 22:49:25
|
Update of /cvsroot/libfunutil/libfunutil/lib/toolbox In directory sc8-pr-cvs1:/tmp/cvs-serv3795 Modified Files: Makefile Log Message: fixed a build bug which only showed up once the code was moved outside of the s11n tree Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/toolbox/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 17 Nov 2003 19:22:36 -0000 1.2 +++ Makefile 19 Nov 2003 22:48:42 -0000 1.3 @@ -36,14 +36,14 @@ ns.type_traits.h -ifeq (1,$(configure_enable_zlib)) +#ifeq (1,$(configure_enable_zlib)) NS_SOURCES += ns.gzstream.cpp NS_HEADERS += ns.gzstream.h -endif -ifeq (1,$(configure_enable_bzlib)) +#endif +#ifeq (1,$(configure_enable_bzlib)) NS_SOURCES += ns.bzstream.cpp NS_HEADERS += ns.bzstream.h -endif +#endif SOURCES = $(patsubst ns.%,%,$(NS_SOURCES)) HEADERS = $(patsubst ns.%,%,$(NS_HEADERS)) |
From: <sg...@us...> - 2003-11-19 22:42:04
|
Update of /cvsroot/libfunutil/libfunutil/include/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv2646/s11n Removed Files: Makefile Log Message: no longer needed --- Makefile DELETED --- |
From: <sg...@us...> - 2003-11-19 22:41:55
|
Update of /cvsroot/libfunutil/libfunutil/include In directory sc8-pr-cvs1:/tmp/cvs-serv2612 Modified Files: Makefile Log Message: removed s11n subdir Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/include/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 27 Sep 2003 22:39:43 -0000 1.5 +++ Makefile 19 Nov 2003 22:41:10 -0000 1.6 @@ -2,10 +2,6 @@ SUBDIRS = fun include toc.make -ifeq (1,$(configure_enable_s11n)) -SUBDIRS += s11n -endif - DIST_FILES += config.h.at DISTCLEAN_FILES += config.h |
From: <sg...@us...> - 2003-11-19 22:40:53
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv2339 Modified Files: configure.s11n toc.libfunUtil.make.at toc.s11n.make.at Log Message: some build changes for s11n which i forgot to commit the other day. :/ Index: configure.s11n =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/configure.s11n,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- configure.s11n 17 Nov 2003 20:27:18 -0000 1.3 +++ configure.s11n 19 Nov 2003 22:40:09 -0000 1.4 @@ -2,6 +2,7 @@ echo "==================== s11n-specific checks:" toc_run_failok bzlib +toc_run_failok zlib toc_run_failok lyxport Index: toc.libfunUtil.make.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc.libfunUtil.make.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- toc.libfunUtil.make.at 19 Nov 2003 22:20:14 -0000 1.1 +++ toc.libfunUtil.make.at 19 Nov 2003 22:40:09 -0000 1.2 @@ -2,3 +2,9 @@ #^^^ only to help emacs out. CLEAN_FILES += $(wildcard *.o *~) + +configure_enable_s11n = @configure_enable_s11n@ + +ifeq (1,$(configure_enable_s11n)) +include $(top_srcdir)/toc.s11n.make +endif \ No newline at end of file Index: toc.s11n.make.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc.s11n.make.at,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- toc.s11n.make.at 17 Nov 2003 22:00:44 -0000 1.3 +++ toc.s11n.make.at 19 Nov 2003 22:40:09 -0000 1.4 @@ -1,6 +1,9 @@ #!/do/not/make #^^^ only to help emacs out. +HAVE_BZLIB = @HAVE_BZLIB@ +HAVE_ZLIB = @HAVE_ZLIB@ + ################# from libltdl test: HAVE_LIBLTDL = @HAVE_LIBLTDL@ HAVE_LIBDL = @HAVE_LIBDL@ |
From: <sg...@us...> - 2003-11-19 22:40:49
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n/parsers In directory sc8-pr-cvs1:/tmp/cvs-serv2339/lib/s11n/parsers Modified Files: hex.flex.at Log Message: some build changes for s11n which i forgot to commit the other day. :/ Index: hex.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/hex.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- hex.flex.at 14 Oct 2003 20:37:50 -0000 1.1 +++ hex.flex.at 19 Nov 2003 22:40:09 -0000 1.2 @@ -2,7 +2,7 @@ %{ // // LICENSE: Public Domain -// Author: stephan - sg...@us... +// Author: stephan - st...@s1... // #define YY_SKIP_YYWRAP 1 @@ -14,18 +14,18 @@ #include <string> #include <deque> -#include <s11n/s11n-macros.h> // COUT/CERR +#include <fun/s11n-macros.h> // COUT/CERR #define PCERR CERR << "hex.flex error:" -// #include <toolbox/string_util.h> // trim_string() +// #include <fun/string_util.h> // trim_string() -// #include <toolbox/PropertyStore.h> -// #include <toolbox/ClassLoader.h> -// #include <toolbox/Instantiator.h> -// #include <toolbox/KeyValueParser.h> +// #include <fun/property_store.h> +// #include <fun/class_loader.h> +// #include <fun/instantiator.h> +// #include <fun/key_value_parser.h> -#include <s11n/node_builder.h> -#include <s11n/flex_lexers.h> -#include <toolbox/string_util.h> // hex2int() +#include <fun/node_builder.h> +#include <fun/flex_lexers.h> +#include <fun/string_util.h> // hex2int() using std::cin; using std::cerr; @@ -56,11 +56,11 @@ bool in_prop; unsigned int decval = 0; unsigned int lcv = 0; - s11n::node_builder * serbuilder = 0; + fun::node_builder * serbuilder = 0; } -namespace s11n { +namespace fun { FlexLexer * HexTreeBuilder::lexer() { @@ -81,7 +81,7 @@ serbuilder = this->builder(); node_depth = 0; } -} // namespace s11n +} // namespace fun @@ -95,7 +95,7 @@ if( 0 == inchar ) {word=""; return 0;} \ word += inchar; \ };\ - decval = toolbox::hex2int(word);\ + decval = fun::hex2int(word);\ if( 0 == decval ) { PCERR << "Error reading word (size="<<SZ<<"). Maybe reached end of input?" << endl; return 0; } @@ -103,7 +103,7 @@ HEX_DIGIT ([a-fA-F0-9]) WORD2 {HEX_DIGIT}{2} - // maintenance note: these hex codes must be kept in sync with those from HexSerializer's enum + // maintenance note: these hex codes must be kept in sync with those from hex_serializer's enum NODE_OPEN 11 NODE_CLOSE 10 PROP_OPEN 21 @@ -186,19 +186,19 @@ %% #if HEX_DO_MAIN -#include <s11n/s11n_io.h> // HexSerializer -// #include <s11n/FlexShell.h> -// #include <s11n/ELib.h> -using namespace s11n; +#include <fun/s11n_io.h> // hex_serializer +// #include <fun/FlexShell.h> +// #include <fun/ELib.h> +using namespace fun; int main( int argc, char ** argv ) { - s11n::HexTreeBuilder bob; + fun::HexTreeBuilder bob; FlexLexer * lexer = bob.lexer(); // FlexLexer * lexer = new hexFlexLexer(); while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { - s11n::ParenSerializer ser; + fun::paren_serializer ser; ser.serialize( *(bob.root_node()), std::cout ); } return 0; |
From: <sg...@us...> - 2003-11-19 22:28:09
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv31916 Removed Files: configure.libfunUtil Log Message: doh! this should not have been added. --- configure.libfunUtil DELETED --- |
From: <sg...@us...> - 2003-11-19 22:25:11
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv31407 Added Files: configure.libfunUtil Log Message: egg --- NEW FILE: configure.libfunUtil --- #!/do/not/bash # ^^^^ to help out emacs # package-specific configure script for libfunutil toc_run_failok check_dist_md5s # toc_run_failok buildtool toc_add_config PACKAGE_COPYRIGHT="GNU General Public License, version 2. Copyright (c) 2000-2003 Rusty Ballinger (bo...@so...) and stephan beal (sg...@us...)." INCLUDES="$INCLUDES -I\$(top_srcdir)/include" # XXX this one is temporary LDFLAGS="$LDFLAGS -L\$(top_srcdir)/lib/fun" toc_run_fail gnu_cpp_tools toc_run_failok readline toc_run_failok zlib toc_run_failok bzlib toc_add_config_h PACKAGE_EMAIL_ADDRESS=lib...@li... PACKAGE_URL=http://libfunutil.sourceforge.net/ toc_add_config_h PACKAGE_URL=${PACKAGE_URL} toc_add_config_h PACKAGE_RELEASE_CODENAME="Are we having Fun yet?" toc_add_config_h "BUILD_HOST=${BUILD_HOST-$HOSTNAME}" toc_add_config_h "BUILD_USER=${BUILD_USER-$USER}" toc_add_make configure_enable_cppdeps=1 toc_run_failok doxygen toc_run_failok lyxport configure_with_qt=${configure_with_qt-1} toc_run_fail qt_if_enabled '3.x' '3.*' # If we're building with Qt, see whether we're also building std::string API's if test "${configure_with_qt}" = "1"; then FUN_UTIL_WITH_QT=1 FUN_API_QSTRING=1 if test "${configure_with_string}" = 1; then FUN_API_STD_STRING=1 else FUN_API_STD_STRING=0 fi else FUN_UTIL_WITH_QT=0 FUN_API_QSTRING=0 FUN_API_STD_STRING=1 fi # These actually wind up in fun-config.h, but they get there by being passed # to atsign_parse through the Makefile. toc_add_make FUN_UTIL_WITH_QT="$FUN_UTIL_WITH_QT" toc_add_make FUN_API_QSTRING="$FUN_API_QSTRING" toc_add_make FUN_API_STD_STRING="$FUN_API_STD_STRING" configure_developer_script=configure.user.$USER test -f ${configure_developer_script} && { toc_boldecho "Running $USER's tests..." source ${configure_developer_script} || toc_die $? "${configure_developer_script} failed" } configure_enable_s11n=${configure_enable_s11n-1} toc_add_config configure_enable_s11n=${configure_enable_s11n} test x1 = "x${configure_enable_s11n}" && { source configure.s11n } echo ============================================================== echo "${PACKAGE_NAME} configuration checks completed." echo ============================================================== toc_run_fail toc_project_makefile return 0 |
From: <sg...@us...> - 2003-11-19 22:20:37
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv30436 Added Files: toc.libfunUtil.make.at Log Message: egg --- NEW FILE: toc.libfunUtil.make.at --- #!/do/not/make #^^^ only to help emacs out. CLEAN_FILES += $(wildcard *.o *~) |
From: <sg...@us...> - 2003-11-19 22:15:14
|
Update of /cvsroot/libfunutil/libfunutil/toc/sbin In directory sc8-pr-cvs1:/tmp/cvs-serv29404 Modified Files: toc_core.sh Log Message: a local variable explicitely made local Index: toc_core.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/sbin/toc_core.sh,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- toc_core.sh 17 Nov 2003 19:07:17 -0000 1.29 +++ toc_core.sh 19 Nov 2003 22:15:09 -0000 1.30 @@ -66,7 +66,7 @@ TOC_BOLD_=${TOC_BOLD_-""} function toc_boldecho { - args= + local args= for i in n e; do if test "$1" = "-${i}"; then args="$args $1" |
Update of /cvsroot/libfunutil/libfunutil/lib/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv28813 Modified Files: Makefile ns.include_from_main.h ns.node_builder.cpp ns.node_loader.cpp ns.node_loader.h ns.s11n_globals.h ns.s11n_io.h ns.s11n_node.h ns.serializable_adapter.h ns.serializer_loader.cpp ns.serializer_loader.h Added Files: ns.compact_serializer.cpp ns.hex_serializer.cpp ns.paren_serializer.cpp ns.s11n.h ns.serializable.cpp ns.serializable.h ns.serializer.cpp ns.serializer.h Removed Files: ns.Serializer.h Log Message: mass file-name changes. All classes now have stl-style names, partly for consistency, partly because that's my fad at the moment, and partly to avoid stepping on the original fun::{Serializ{er,able}}.h. --- NEW FILE: ns.compact_serializer.cpp --- #include <iostream> #include <string> #include <S11N_NAMESPACE/flex_lexers.h> #include <S11N_NAMESPACE/string_util.h> #include <S11N_NAMESPACE/serializer.h> // maintenance note: this class is about 98% identical to FunTxt. i // need a way to combine these better. namespace S11N_NAMESPACE { compact_serializer::compact_serializer() { }; compact_serializer::~compact_serializer() { }; s11n_node * compact_serializer::deserialize( std::istream & is ) { S11N_NAMESPACE::CompactTreeBuilder parser; return basic_serializer::deserialize( parser, is ); } bool compact_serializer::serialize( const s11n_node & node, std::ostream & os ) const { if ( !basic_serializer::serialize( node, os ) ) return false; static const int ctrlwidth = 2; static const int size2b = 2; static const int size8b = 8; static const int cookiewidth = 8; // static const int charwidth = 2; static unsigned int depth = 0; ++depth; std::string nname = node.name(); std::string impl = node.impl_class(); std::string::size_type sizE = 0; // WTF must all this stream manip be done on every fucking insert? #define OS_INT(C,W) os.width(W);os<<std::hex<<std::right<<(unsigned int)(C); #define INSERT(vaR,WIDTH) sizE = vaR.size(); OS_INT(sizE,WIDTH); \ for( std::string::size_type ins = 0; ins < sizE; ins++ ) {\ /*OS_INT(vaR[ins],charwidth);*/ \ os << (unsigned char) vaR[ins]; \ }; if ( 1 == depth ) { os.setf( std::ios_base::hex ); os.fill('0'); os.setf(std::ios_base::right, std::ios_base::adjustfield); OS_INT(Magic_Cookie,cookiewidth); os << '\n'; } OS_INT(Node_Open,ctrlwidth); INSERT(nname,size2b); INSERT(impl,size2b); S11N_NAMESPACE::property_store::const_iterator it = node.property_store::begin(); S11N_NAMESPACE::property_store::const_iterator et = node.property_store::end(); std::string propval; std::string propname; //bool gotprops = ( it != et ); for ( ; it != et; ++it ) { OS_INT(Prop_Open,ctrlwidth); propname = ( *it ).first; INSERT(propname,size2b); propval = ( *it ).second; INSERT(propval,size8b); //OS_INT(Prop_Close); } s11n_node::child_list_type::const_iterator cit = node.children().begin(); s11n_node::child_list_type::const_iterator cet = node.children().end(); bool ret = true; for ( ; cit != cet; ++cit ) { if ( !this->serialize( *( *cit ), os ) ) { ret = false; } //os << (out_type) '\n'; } OS_INT(Node_Close,ctrlwidth); os << '\n'; if( 1 == depth ) { OS_INT(Data_End,cookiewidth); os << std::endl; // //os << (out_type) '\n'; // os.flush(); // maintenance: os must be flush()ed or the client may be forced to do it. } --depth; return ret; } }; // namespace S11N_NAMESPACE --- NEW FILE: ns.hex_serializer.cpp --- #include <iostream> #include <string> #include <S11N_NAMESPACE/flex_lexers.h> #include <S11N_NAMESPACE/string_util.h> #include <S11N_NAMESPACE/serializer.h> // maintenance note: this class is about 98% identical to FunTxt. i // need a way to combine these better. namespace S11N_NAMESPACE { hex_serializer::hex_serializer() { }; hex_serializer::~hex_serializer() { }; s11n_node * hex_serializer::deserialize( std::istream & is ) { S11N_NAMESPACE::HexTreeBuilder parser; return basic_serializer::deserialize( parser, is ); } bool hex_serializer::serialize( const s11n_node & node, std::ostream & os ) const { if ( !basic_serializer::serialize( node, os ) ) return false; typedef unsigned int out_type; static unsigned int depth = 0; // recursion depth. // token sizes: static const int width2b = 2; static const int cookie_width = 8; static const int width8b = 8; ++depth; std::string nname = node.name(); std::string impl = node.impl_class(); std::string::size_type sizE = 0; // WTF must all this stream manip be done on every insert? #define OS_INT(C,W) os.width(W);os<<std::hex<<std::right<<(out_type)(C); #define INSERT(vaR,WIDTH) sizE = vaR.size(); OS_INT(sizE,WIDTH); \ for( std::string::size_type ins = 0; ins < sizE; ins++ ) {\ OS_INT(vaR[ins],width2b); \ } if ( 1 == depth ) { os.setf( std::ios_base::hex ); os.fill('0'); os.setf(std::ios_base::right, std::ios_base::adjustfield); OS_INT(Magic_Cookie,cookie_width); os << '\n'; } OS_INT(Node_Open,width2b); INSERT(nname,width2b); INSERT(impl,width2b); S11N_NAMESPACE::property_store::const_iterator it = node.property_store::begin(); S11N_NAMESPACE::property_store::const_iterator et = node.property_store::end(); std::string propval; std::string propname; //bool gotprops = ( it != et ); for ( ; it != et; ++it ) { OS_INT(Prop_Open,width2b); propname = ( *it ).first; INSERT(propname,width2b); propval = ( *it ).second; INSERT(propval,width8b); //OS_INT(Prop_Close); } s11n_node::child_list_type::const_iterator cit = node.children().begin(); s11n_node::child_list_type::const_iterator cet = node.children().end(); bool ret = true; for ( ; cit != cet; ++cit ) { if ( !this->serialize( *( *cit ), os ) ) { ret = false; } //os << (out_type) '\n'; } OS_INT(Node_Close,width2b); os << '\n'; if( 1 == depth ) { OS_INT(Data_End,width8b); //os << (out_type) '\n'; os << std::endl; // maintenance: os must be flush()ed or the client may be forced to do it. } --depth; return ret; } }; // namespace S11N_NAMESPACE --- NEW FILE: ns.paren_serializer.cpp --- #include <iostream> #include <string> #include <S11N_NAMESPACE/flex_lexers.h> #include <S11N_NAMESPACE/string_util.h> #include <S11N_NAMESPACE/serializer.h> // maintenance note: this class is about 98% identical to FunTxt. i // need a way to combine these better. namespace S11N_NAMESPACE { paren_serializer::paren_serializer() { }; paren_serializer::~paren_serializer() { }; const basic_serializer::translation_map & paren_serializer::translations() const { static paren_serializer::translation_map bob; static bool donethat = false; if( (!donethat) && (donethat=true) ) { // The order of these escapes is signifant. // We only do double-backslashes to accomodate // the case that the final chars in a property // is a backslash (yes, this has happened, and // it hosed the data when sending it via a // format which uses \\\n to support multi-line // values). bob["\\"] = "\\\\"; bob[")"] = "\\)"; bob["("] = "\\("; // It is not strictly necessary to escape \(, // but we do so because Parens is intended to // be easy for hand-editing, and not escaping // them confuses emacs when we have escaped // closing parens. :) } return bob; } s11n_node * paren_serializer::deserialize( std::istream & is ) { S11N_NAMESPACE::ParenTreeBuilder parser; return basic_serializer::deserialize( parser, is ); } bool paren_serializer::serialize( const s11n_node & node, std::ostream & os ) const { if ( !basic_serializer::serialize( node, os ) ) return false; static const bool indention = true; static const std::string tab = (indention ? "\t" : ""); static unsigned int depth = 0; static const char Open = '('; static const char Close = ')'; ++depth; std::string nname = node.name(); std::string impl = node.impl_class(); std::string indent; for ( unsigned int i = 1; i < depth; i++ ) indent += tab; std::string indentChild = indent + tab; std::string indentProp = " "; // indent + tab; if ( 1 == depth ) { os << "(S11N_NAMESPACE::parens)\n"; } os << nname << "="<<Open<<impl; S11N_NAMESPACE::property_store::const_iterator it = node.property_store::begin(); S11N_NAMESPACE::property_store::const_iterator et = node.property_store::end(); std::string propval; //bool gotprops = ( it != et ); for ( ; it != et; ++it ) { propval = ( *it ).second; S11N_NAMESPACE::translate_entities( propval, this->translations(), false ); os << indentProp << Open <<( *it ).first << " " << propval << Close; } s11n_node::child_list_type::const_iterator cit = node.children().begin(); s11n_node::child_list_type::const_iterator cet = node.children().end(); bool ret = true; bool gotkids = (cit != cet); if( gotkids ) os << ( indention ? "\n" : " " ); for ( ; cit != cet; ++cit ) { os << indentChild; if ( !this->serialize( *( *cit ), os ) ) { ret = false; } } if( gotkids ) os << indent; os << ")"; os << (indention ? "\n" : " "); if( 1 == depth ) { if( ! indention ) os << std::endl; else os.flush(); } --depth; // maintenance: os must be flush()ed or the client may be forced to do it (endl does the same). return ret; } }; // namespace S11N_NAMESPACE --- NEW FILE: ns.s11n.h --- // Author: stephan beal <st...@s1...> // License: Public Domain #ifndef S11N_NAMESPACE_S11N_H_INCLUDED #define S11N_NAMESPACE_S11N_H_INCLUDED 1 // please don't use this header - it's being phased out. // #include <S11N_NAMESPACE/s11n_node.h> // #include <S11N_NAMESPACE/serializable.h> // #include <S11N_NAMESPACE/serializable_adapter.h> /** The s11n serialization (s11n) framework is an object serialization framework modelled heavily off work by Rusty Ballinger (bo...@us... http://libfunutil.sourceforge.net). As far as i know Rusty was the one to coin the phrase "s11n" (short for "serialization", in the same way that i18n is short for internationalization). In addition to the class documentation, please see the library manual, available in the source tree, in the docs subdir. The most important classes for clients are: - s11n_node (and it's parent, S11N_NAMESPACE::property_store) - basic_serializer - node_loader */ namespace S11N_NAMESPACE { }; #endif // S11N_NAMESPACE_S11N_H_INCLUDED --- NEW FILE: ns.serializable.cpp --- #include <S11N_NAMESPACE/s11n-macros.h> // CERR #include <S11N_NAMESPACE/s11n_node.h> // #include <S11N_NAMESPACE/serializable_adapter.h> #include "serializable.h" #include <S11N_NAMESPACE/s11n_node.h> // make the library aware of serializable as a serializable type: namespace S11N_NAMESPACE { // static serializable_adapter<serializable> for_template_linking_reasons = serializable_adapter<serializable>(); serializable::serializable() // const std::string & implclassname ) : m_implclass( implclassname ) { } serializable::~serializable() { } bool serializable::s7e( s11n_node & node ) const { if ( node.impl_class().empty() ) { CERR << "warning: impl_class() has not been set for this class. Cannot serialize it!" << std::endl; return false; } // node.impl_class( this->impl_class() ); return true; } bool serializable::d9e( const s11n_node & ) { return true; } // void serializable::impl_class( const std::string & cn ) // { // this->m_implclass = cn; // } // std::string serializable::impl_class()const // { // return this->m_implclass; // } }; //namespace S11N_NAMESPACE --- NEW FILE: ns.serializable.h --- // // License: Public Domain // Author: st...@wa... // #ifndef S11N_NAMESPACE_SERIALIZABLE_H_INCLUDED #define S11N_NAMESPACE_SERIALIZABLE_H_INCLUDED #include <string> namespace S11N_NAMESPACE { class s11n_node; // forward decl /** serializable plays several roles: - used to develop conventions used by the de/serialize()-related functions of the core s11n classes (mainly s11n_node). - following the conventions set by s11n_node, it acts as a default base class implementation for a serializable hierarchy. - defines a reference implementation for these oft-mentioned s11n_node conventions. Client classes can immediately start subclassing this class and get to work serializing their objects. An alternative, for those who want to be serializable but not serializable, is described elsewhere. (The the lib manual.) serializable is technically not part of the core library, except in the sense that it is used as a testing ground for framework-level conventions. See the extensive docs in the library manual for more detail than you could want to know about this interface. */ class serializable { public: serializable(); // const std::string & implclassname = "S11N_NAMESPACE::serializable" ); virtual ~ serializable(); /** Serializes this object into the given node. Returns true on success and false on error. The default implementation returns false only if this->impl_class() is not set. (It /should/ return false if node.name().empty(), but that breaks some otherwise-legitimate usage.) It is important that you either call the default implementation of this function or call node.impl_class( this->impl_class() ), so that the proper implementation class name can be set for deserialization. e.g.: <pre> if( ! this->serializable::serialize( node ) ) return false; </pre> To recursively serialize child objects use one of node's various serialize() functions. This function really should be called serialize(), but it is not because: - i am attempting to keep the core library clean of serializable, and the function rename is an easy way to help enforce that. - i needed a test-bed for serializable_adapter ;) */ virtual bool s7e( S11N_NAMESPACE::s11n_node & node ) const; /** Deserializes this object from the given node. Returns true on success and false on error, in which case this object is in an undefined state and is probably best destroyed. To recursively deserialize child objects use one of node's various deserialize() functions or the child's deserialize() - the exact approach depends largely on whether you are using pointers to the children or not. See s7e() for notes regarding this function's odd name. */ virtual bool d9e( const S11N_NAMESPACE::s11n_node & ); }; }; // namespace S11N_NAMESPACE #include <S11N_NAMESPACE/serializable_adapter.h> SERIALIZABLE_ADAPTER(S11N_NAMESPACE::serializable,s7e,d9e); // this is the // only sane place to put this, i think? #endif // S11N_NAMESPACE_SERIALIZABLE_H_INCLUDED --- NEW FILE: ns.serializer.cpp --- // // Author: stephan beal <st...@s1...> // License: Public Domain // #include <iostream> #include <sstream> #include <string> #include <map> #include <S11N_NAMESPACE/class_loader.h> #include <S11N_NAMESPACE/instantiator.h> // object_factory #include <S11N_NAMESPACE/flex_lexers.h> #include <S11N_NAMESPACE/string_util.h> // escape_string(), translate_chars() #include <S11N_NAMESPACE/s11n_io.h> #include <S11N_NAMESPACE/s11n_globals.h> // xml_entity_map(). #include <S11N_NAMESPACE/debuggering_macros.h> // COUT/CERR, for debugging only. namespace S11N_NAMESPACE { basic_serializer::basic_serializer(){}; basic_serializer::~basic_serializer(){}; bool basic_serializer::serialize( const s11n_node & node, std::ostream & os ) const { if ( !os ) return false; // arguable: if ( node.name().empty() || node.impl_class().empty() ) return false; return true; } bool basic_serializer::serialize( const s11n_node & node, const std::string & filename ) const { std::auto_ptr<std::ostream> os = std::auto_ptr<std::ostream>( S11N_NAMESPACE::get_ostream( filename ) ); if ( !os.get() ) return false; return serialize( node, *os ); } s11n_node * basic_serializer::deserialize( std::istream & ) { return NULL; } s11n_node * basic_serializer::deserialize( const std::string &filename ) { std::auto_ptr<std::istream> is = std::auto_ptr<std::istream>( S11N_NAMESPACE::get_istream( filename ) ); if ( !is.get() ) return false; return deserialize( *is ); } s11n_node * basic_serializer::deserialize( FlexTreeBuilder & parser, std::istream & is ) { if ( ! is.good() ) return NULL; s11n_node * node = 0; parser.lexer()->switch_streams( &is ); parser.lexer_loop(); node = parser.root_node(); parser.builder()->auto_delete( false ); // tell it not to delete the node. return node; } const basic_serializer::translation_map & basic_serializer::translations() const { static translation_map bob; return bob; } FunTxtSerializer::FunTxtSerializer() { }; FunTxtSerializer::~FunTxtSerializer() { }; s11n_node * FunTxtSerializer::deserialize( std::istream & is ) { S11N_NAMESPACE::FunTxt parser; return basic_serializer::deserialize( parser, is ); } const basic_serializer::translation_map & FunTxtSerializer::translations() const { static basic_serializer::translation_map bob; static bool donethat = false; if( (!donethat) && (donethat=true) ) { // the order of these escapes is signifant. // We only do double-backslashes to accomodate // the case that the final char in a property // is a backslash (yes, this has happened, and // it hosed the input). bob["\\"] = "\\\\"; bob["\n"] = "\\\n"; bob["{"] = "\\{"; bob["}"] = "\\}"; } return bob; } bool FunTxtSerializer::serialize( const s11n_node & node, std::ostream & os ) const { //COUT << "serialize( s11n_node["<<node.name()<<"|"<<node.impl_class()<<"] )"<<endl; if ( !basic_serializer::serialize( node, os ) ) return false; static const std::string tab = "\t"; static unsigned int depth = 0; ++depth; std::string nname = node.name(); std::string impl = node.impl_class(); // if( nname.empty() || impl.empty() ) // { // } std::string indent; for ( unsigned int i = 1; i < depth; i++ ) indent += tab; std::string indent2 = indent + tab; if ( 1 == depth ) { os << "#SerialTree 1\n"; } if ( !nname.empty() ) os << indent << nname << " class=" << impl << "\n"; os << indent << "{\n"; S11N_NAMESPACE::property_store::const_iterator it = node.begin(); S11N_NAMESPACE::property_store::const_iterator et = node.end(); std::string propval; for ( ; it != et; ++it ) { propval = (*it).second; // arguable: S11N_NAMESPACE::trim_string( propval ); S11N_NAMESPACE::translate_entities( propval, this->translations() ); os << indent2 << ( *it ).first << " " << propval << "\n"; } s11n_node::child_list_type::const_iterator cit = node.children().begin(); s11n_node::child_list_type::const_iterator cet = node.children().end(); bool ret = true; if ( cit != cet ) { for ( ; cit != cet; ++cit ) { if ( !this->serialize( *( *cit ), os ) ) ret = false; } } os << indent << "}" << std::endl; // if we don't use endl the client is possibly forced to flush() the stream :/ //os << indent << "# end " << nname << std::endl; --depth; return ret; } FunXMLSerializer::FunXMLSerializer() { }; FunXMLSerializer::~FunXMLSerializer() { }; // bool deserialize( s11n_node & target, const std::istream & ) { return false; } const basic_serializer::translation_map & FunXMLSerializer::translations() const { static basic_serializer::translation_map bob; if( 0 == bob.size() ) { bob["&"] = "&"; bob["\""] = """; bob["'"] = "'"; bob[">"] = ">"; bob["<"] = "<"; } return bob; } bool FunXMLSerializer::serialize( const s11n_node & node, std::ostream & os ) const { if ( !basic_serializer::serialize( node, os ) ) return false; static const std::string tab = "\t"; static unsigned int depth = 0; ++depth; std::string nname = node.name(); std::string impl = node.impl_class(); std::string indent; for ( unsigned int i = 1; i < depth; i++ ) indent += tab; std::string indent2 = indent + tab; if ( 1 == depth ) { os << "<!DOCTYPE SerialTree>\n"; } os << indent << "<" << nname << " class=\"" << impl << "\">\n"; S11N_NAMESPACE::property_store::const_iterator it = node.property_store::begin(); S11N_NAMESPACE::property_store::const_iterator et = node.property_store::end(); std::string propval; if ( it != et ) { for ( ; it != et; ++it ) { propval = ( *it ).second; S11N_NAMESPACE::translate_entities( propval, this->translations(), false ); os << indent2; os << "<" << ( *it ).first << ">" << propval << "</" << ( *it ).first << ">"; os << "\n"; } } s11n_node::child_list_type::const_iterator cit = node.children().begin(); s11n_node::child_list_type::const_iterator cet = node.children().end(); if ( cit != cet ) { for ( ; cit != cet; ++cit ) { this->serialize( *( *cit ), os ); } } os << indent << "</" << nname << ">" << std::endl; // if we don't use endl the client is possibly forced to flush() the stream :/ --depth; return os; } s11n_node * FunXMLSerializer::deserialize( std::istream & is ) { S11N_NAMESPACE::FunXML parser; return basic_serializer::deserialize( parser, is ); } SimpleXMLSerializer::SimpleXMLSerializer() { }; SimpleXMLSerializer::~SimpleXMLSerializer() { }; const basic_serializer::translation_map & SimpleXMLSerializer::translations() const { static basic_serializer::translation_map bob; if( 0 == bob.size() ) { bob["&"] = "&"; bob["\n"] = "
"; bob["\""] = """; bob["'"] = "'"; bob[">"] = ">"; bob["<"] = "<"; } return bob; } bool SimpleXMLSerializer::serialize( const s11n_node & node, std::ostream & os ) const { if ( !basic_serializer::serialize( node, os ) ) return false; static const std::string tab = "\t"; static unsigned int depth = 0; ++depth; std::string nname = node.name(); std::string impl = node.impl_class(); std::string indent; for ( unsigned int i = 1; i < depth; i++ ) indent += tab; std::string indent2 = indent + tab; if ( 1 == depth ) { os << "<!DOCTYPE S11N_NAMESPACE::simplexml>\n"; } os << indent << "<" << nname; os << " s11n_class=\"" << impl << "\""; std::string pname, pval; S11N_NAMESPACE::property_store::const_iterator it = node.property_store::begin(); S11N_NAMESPACE::property_store::const_iterator et = node.property_store::end(); if ( it != et ) { for ( ; it != et; ++it ) { if ( "CDATA" == ( *it ).first ) continue; // special treatment later on pname = (*it).first; pval = (*it).second; // S11N_NAMESPACE::escape_string( pval, "\"" ); S11N_NAMESPACE::translate_entities( pval, this->translations(), false ); os << " " << pname << "=\"" << pval << "\""; } } //os << ">"; bool use_closer = false; // if false then an element can <close_itself /> if ( node.is_set( "CDATA" ) ) { os << ">"; use_closer = true; os << "<![CDATA[" << node.get_string( "CDATA" ) << "]]>"; //cdata << "<![CDATA[" << node.get_string( "CDATA" ) << "]]>"; } s11n_node::child_list_type::const_iterator cit = node.children().begin(); s11n_node::child_list_type::const_iterator cet = node.children().end(); bool tailindent = false; if ( cit != cet ) { if( ! use_closer ) os << ">"; use_closer = true; tailindent = true; for ( ; cit != cet; ++cit ) { os << "\n" << indent2; // asthetics :/ this->serialize( *( *cit ), os ); } os << "\n"; } os << ( tailindent ? indent : "" ); if( use_closer ) { os << "</" << nname << ">"; } else { os << " />"; } --depth; if( 0 == depth ) os << std::endl; // if we don't use endl the client is possibly forced to flush() the stream :/ return os; } s11n_node * SimpleXMLSerializer::deserialize( std::istream & is ) { S11N_NAMESPACE::SimpleXMLFlexer parser; return basic_serializer::deserialize( parser, is ); } }; // namespace S11N_NAMESPACE --- NEW FILE: ns.serializer.h --- #ifndef S11N_NAMESPACE_SERIALIZER_H_INCLUDED #define S11N_NAMESPACE_SERIALIZER_H_INCLUDED 1 // // Author: stephan beal <st...@s1...> // License: Public Domain // This file defines interfaces for saving/loading s11n_node and // serializable objects. // #include <sstream> #include <memory> // auto_ptr #include <iostream> #include <map> #include <S11N_NAMESPACE/file_util.h> #include <S11N_NAMESPACE/s11n_node.h> #include <S11N_NAMESPACE/flex_lexers.h> // FlexTreeBuilder namespace S11N_NAMESPACE { /** serializer defines an interface for s11n_node importers and exporters (i.e., the classes which save and load s11n_nodes to various underlying data formats). The default implementation does nothing useful, but is not pure abstract for reasons which i have yet to figure out. :/ Note that the sometimes awkward usage of this class and it's relatives is largely a side-effect of the hassle i went through to get multiple FlexLexer subclasses into the same library. Subclasses should honor the following: - De/serialized objects can always be expected to use (or have consistent access to) an s11n_node's get<>(), set<>() and children() methods, plus any of the public de/serializeXXX() functions. Any additional functionality which a de/serializer provides must be accounted for in serializable subclasses if they are expected to use this. An example of such a case is the handling of CDATA when reading XML: the s11n_node interface has no "good" place to put this, so the SimpleXMLSerializer simply puts the data in the node's CDATA property, and clients which expect CDATA at that location can use it. Likewise, the SimpleXML saver writes anything from the CDATA property as XML CDATA. - feel free to add to this interface, but be warned that getting access to a specific FlexLexer subclass in this code (required for lex-based deserialization) is annoying enough that you might not want to do so. (God, if only FlexLexer didn't rely on macros to define subclasses...) - um... there must be something else i'm forgetting to tell you. Dev/design note: it is important to me that the core s11n code never develop a dependency on any of this interface. */ class basic_serializer { public: /** A convenience typedef, mainly for subclasses. */ typedef std::map<std::string,std::string> translation_map; basic_serializer(); virtual ~basic_serializer(); /** The default implementations of de/serialize() always return true and do nothing. This function is unfortunately mis-named: s11n_node is not a serializable type. They SHOULD return false if either node.name() or node.impl_class() is empty, and that is under consideration. (todo: make sure that gets considered at some point.) */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; /** Convenience form of deserialize() which takes a filename. */ bool serialize( const s11n_node & node, const std::string & filename ) const; /** Serializes ser to the given ostream, using the node name nodename. Use this to write a serializable as a root data node without having to create an intermediary s11n_node (that will be done in this function). */ template <typename serializableType> bool serialize( const std::string & nodename, const serializableType & ser, std::ostream & os ) const { if ( !os ) return false; s11n_node root( nodename ); // , ser.impl_class() ); if( ! root.serialize( ser ) ) return false; return this->serialize( root, os ); } /** Saves the given serializable to the given filename, using a root node name of nodename. Returns true on success, false on error. In practice, s11n_node::serialize() fails very rarely, so an error is most likely indicative of a file/stream-level problem (access rights, for example). To get the exact reason for a failure the code must do the Holy Ritual of Meyers-Stallman four times successively in proper style and comfortable clothing. */ template <typename serializableType> bool serialize( const std::string & nodename, const serializableType & ser, const std::string & filename ) const { std::auto_ptr<std::ostream> os = std::auto_ptr<std::ostream>( S11N_NAMESPACE::get_ostream( filename ) ); if ( !os.get() ) return false; return serialize( nodename, ser, *os ); } /** Returns the first node extraced from the given input stream. The default implementation always returns NULL. The caller takes ownership of the returned pointer. This function is unfortunately mis-named: s11n_node is not a serializable type. */ virtual s11n_node * deserialize( std::istream & ); /** Convenience form of deserialize(), taking a filename. It handles compressed files if that is enabled in your library. */ s11n_node * deserialize( const std::string & filename ); /** Returns a map intended for use with S11N_NAMESPACE::translate_entities(). Subclasses should re-implement this to escape/unescape property values. The default implementation returns an empty map. */ virtual const translation_map & translations() const; protected: /** To reduce code duplication in subclasses. It uses the given FlexTreeBuilder to parse the given input stream and returns the top-most node in the tree. The parser is relenquished of control of the returned node, and the caller takes responsibility for it. */ s11n_node * deserialize( FlexTreeBuilder & parser, std::istream & ); }; /** De/serializes nodes to/from a simple-grammared text format. See the FunTxt class (in flex_lexers.h) for details on the data format. The lexer code lives in funtxt.flex.at. Sample: <pre> #SerialTree 1 node_name class=NodeClass { property_name property value subnode_name class=SubnodeClass { prop val prop2 values can be arbitrarily long \ and may contain backslash-escaped newlines. } } </pre> */ class FunTxtSerializer : public basic_serializer { public: FunTxtSerializer(); virtual ~ FunTxtSerializer(); /** Serializes node to the given ostream. */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; /** Tries to deserialize an s11n_node from the given istream. Returns the node extracted from the stream, or NULL on error. The caller owns the returned pointer. */ virtual s11n_node * deserialize( std::istream & ); /** Returns a map intended for use with S11N_NAMESPACE::translate_entities(). Clients may use this to escape/unescape property values. Output Translations: <pre> "\" = "\\" "\n" = "\\n" "{" = "\{" "}" = "\}" </pre> At input-time the reverse translations are applied. */ virtual const translation_map & translations() const; }; /** De/serializes nodes to/from a simple-grammared XML format. See the FunXML class (in flex_lexers.h) for details on the data format. The lexer code lives in funxml.flex.at. Sample: <pre> <!DOCTYPE SerialTree> <node_name class="NodeClass"> <property_name>property value</property_name> <subnode_name class="SubnodeClass"> <prop>val</prop> <prop2>val</prop2> </subnode_name> </node_name> </pre> */ class FunXMLSerializer : public basic_serializer { public: FunXMLSerializer(); virtual ~ FunXMLSerializer(); /** Tries to deserialize an s11n_node from the given istream. Returns the node extracted from the stream, or NULL on error. The caller owns the returned pointer. */ virtual s11n_node * deserialize( std::istream & ); /** Serializes node to the given ostream. */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; /** Returns a map intended for use with S11N_NAMESPACE::translate_entities(). Clients may use this to escape/unescape property values. Output Translations: <pre> "&" = "&" "\"" = """ "'" = "'" ">" = ">" "<" = "<" </pre> (Note: in the HTML version of these docs the above almost certainly doesn't display properly!) At input-time the reverse translations are applied. */ virtual const translation_map & translations() const; }; /** De/serializes nodes to/from a basic XML format. All s11n_node properties are stored as XML attributes, thus this format is not suitable for some complex string data. As a special case this object handles XML CDATA as described below. - Serialization: if the s11n_node.has a CDATA property that is saved as CDATA and the property is NOT saved in the attributes list. - Deserialization: if an XML has CDATA then the s11n_node's CDATA property is set to that content. (Format-neutral as it is, s11n_node has no specific place to store CDATA, thus we kludge it.) No current client code uses the CDATA property, but this seems a reasonable approach for clients who can use it. i mean, the parser parses it, so it might was well get used, right? i think the "right" thing to do is ignore the CDATA altogether and assign everything in it's own property. See the simplexml.flex.at for the supported grammar. Sample: <pre> <!DOCTYPE S11N_NAMESPACE::simplexml> <node_name s11n_class="NodeClass" property_name="property value"> <subnode_name s11n_class="SubnodeClass" prop="val" prop2="val" /> </node_name> </pre> */ class SimpleXMLSerializer:public basic_serializer { public: SimpleXMLSerializer(); virtual ~ SimpleXMLSerializer(); /** Tries to deserialize an s11n_node from the given istream. Returns the node extracted from the stream, or NULL on error. The caller owns the returned pointer. */ virtual s11n_node * deserialize( std::istream & ); /** Serializes node to the given ostream. */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; /** <pre> "&" = "&" "\"" = """ "'" = "'" ">" = ">" "<" = "<" "\n" = "
" </pre> (Note: in the HTML version of these docs the above almost certainly doesn't display properly!) */ virtual const translation_map & translations() const; }; /** paren_serializer supports an almost-like-lisp grammar. The lexer code lives in paren.flex.at. The impl for this class in in paren_serializer.cpp and the lexer is in paren.flex.at. Sample: <pre> (S11N_NAMESPACE::parens) root_node=(NodeClass (property_name property value) (* comment block *) # comment line ; comment line subnode_name=(SubnodeClass # comment to end of line (prop val) (prop2 val2) (prop_escaped \(parens in vals\) must be escaped) ) ) </pre> // Historical note: it is technical unnecessary to escape opening parens in property values, // but escaping them is "required" because this format is meant to be hand-editable and hand-editable // inherently means EMACS... the fact is, however, that if values have escaped closing parens, // yet opening parens are not escaped, emacs' auto-indention mode gets unhappy. :( */ class paren_serializer : public basic_serializer { public: paren_serializer(); virtual ~paren_serializer(); /** Tries to deserialize an s11n_node from the given istream. Returns the node extracted from the stream, or NULL on error. The caller owns the returned pointer. */ virtual s11n_node * deserialize( std::istream & ); /** Serializes node to the given ostream. */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; /** Returns a map intended for use with S11N_NAMESPACE::translate_entities(). Clients may use this to escape/unescape property values. Output Translations: <pre> "\" = "\\" "(" = "\(" ")" = "\)" </pre> At input-time the reverse translations are applied. */ virtual const translation_map & translations() const; }; #define DISABLE_HEXSERIALIZER 1 #if ! DISABLE_HEXSERIALIZER /** Reads/writes serialized data from/to a very bloated, hex-code-based format. It is not human readable and output files are significantly larger than those of most serializers. The impl for this class in in hex_serializer.cpp and the lexer is in hex.flex.at. Sample: <pre> 51190001 11096e6f64655f6e616d65094... </pre> */ class hex_serializer : public basic_serializer { public: /** This enum defines the control tokens used to delimit records. If these are changed then the input parser needs to accomodate the changes (it lives in hex.flex.at). Maintenance note: control tokens should be exactly 4 bytes long and cookies should be 8. */ enum { Magic_Cookie = 0x51190001, // that's as close as i can get to S11N Node_Open = 0x11, Node_Close = 0x10, Prop_Open = 0x21, Data_End = 0x51190000 // not strictly necessary }; hex_serializer(); virtual ~ hex_serializer(); /** Tries to deserialize an s11n_node from the given istream. Returns the node extracted from the stream, or NULL on error. The caller owns the returned pointer. */ virtual s11n_node * deserialize( std::istream & ); /** Serializes node to the given ostream. */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; }; #endif // DISABLE_HEXSERIALIZER /** Read/writes serialized data from/to an almost-binary format. The impl for this class is in compact_serializer.cpp and the lexer is in compact.flex.at Sample: <pre> 51191001 f109node_name09NodeClasse10dproperty_name0000000eproperty value... </pre> */ class compact_serializer : public basic_serializer { public: /** This enum defines the control tokens used to delimit records. If these are changed then the input parser needs to accomodate the changes (it lives in compact.flex.at). Maintenance note: control tokens should be exactly 2 bytes long and cookies should be 8. */ enum { Magic_Cookie = 0x51191001, Node_Open = 0xf1, Node_Close = 0xf0, Prop_Open = 0xe1, Data_End = 0x51191000 // not strictly necessary }; compact_serializer(); virtual ~ compact_serializer(); /** Tries to deserialize an s11n_node from the given istream. Returns the node extracted from the stream, or NULL on error. The caller owns the returned pointer. */ virtual s11n_node * deserialize( std::istream & ); /** Serializes node to the given ostream. */ virtual bool serialize( const s11n_node & node, std::ostream & os ) const; }; } // namespace S11N_NAMESPACE #endif // S11N_NAMESPACE_SERIALIZER_H_INCLUDED Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 17 Nov 2003 20:28:20 -0000 1.5 +++ Makefile 19 Nov 2003 22:11:54 -0000 1.6 @@ -4,30 +4,30 @@ S11N_NAMESPACE ?= s11n NS_SOURCES = \ - ns.CompactSerializer.cpp \ - ns.ParenSerializer.cpp \ + ns.compact_serializer.cpp \ + ns.paren_serializer.cpp \ ns.s11n_io.cpp \ ns.s11n_node.cpp \ ns.node_builder.cpp \ ns.node_loader.cpp \ - ns.Serializable.cpp \ - ns.Serializer.cpp \ + ns.serializable.cpp \ + ns.serializer.cpp \ ns.serializer_loader.cpp \ ns.s11n_globals.cpp # buggy: -# HexSerializer.cpp +# hex_serializer.cpp NS_HEADERS = \ - ns.S11n.h \ + ns.s11n.h \ ns.s11n_io.h \ ns.s11n_node.h \ ns.node_builder.h \ ns.node_loader.h \ - ns.Serializable.h \ + ns.serializable.h \ ns.serializable_adapter.h \ - ns.Serializer.h \ + ns.serializer.h \ ns.serializer_loader.h \ ns.s11n-macros.h \ ns.s11n_globals.h @@ -44,7 +44,7 @@ NAMESPACE = $(S11N_NAMESPACE) NAMESPACE_TOKEN = S11N_NAMESPACE -NAMESPACE_PREFIX = ns. +NAMESPACE_PREFIkX = ns. NAMESPACE_FILTERED_FILES = $(SOURCES) $(HEADERS) namespace: $(NAMESPACE_FILTERED_FILES) include $(toc_makesdir)/NAMESPACE.make Index: ns.include_from_main.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.include_from_main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.include_from_main.h 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.include_from_main.h 19 Nov 2003 22:11:54 -0000 1.2 @@ -2,13 +2,13 @@ #define S11N_INCLUDE_FROM_MAIN_H #include <S11N_NAMESPACE/serializable_adapter.h> -#include <S11N_NAMESPACE/Serializable.h> +#include <S11N_NAMESPACE/serializable.h> // contains code which must, for linking reasons, // be defined only once, in the client's main app. // ======= fuck: clients must include this line in their main app. -// SERIALIZABLE_ADAPTER(S11N_NAMESPACE::Serializable,s7e,d9e); +// SERIALIZABLE_ADAPTER(S11N_NAMESPACE::serializable,s7e,d9e); // ======= if they don't then they don't get this specialization // and the lib won't link, because this code won't get linked // into libs11n. Index: ns.node_builder.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.node_builder.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.node_builder.cpp 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.node_builder.cpp 19 Nov 2003 22:11:54 -0000 1.2 @@ -13,7 +13,7 @@ #include <S11N_NAMESPACE/serializable_adapter.h> #include <S11N_NAMESPACE/s11n_node.h> -#include <S11N_NAMESPACE/Serializable.h> +#include <S11N_NAMESPACE/serializable.h> #define LEXER_LOUD 0 @@ -67,7 +67,7 @@ bool node_builder::open_node( const std::string & classname, const std::string & name ) { - typedef class_loader < S11N_NAMESPACE::Serializable > SerLoader; + typedef class_loader < S11N_NAMESPACE::serializable > SerLoader; static SerLoader classLoader; ++m_node_count; Index: ns.node_loader.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.node_loader.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.node_loader.cpp 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.node_loader.cpp 19 Nov 2003 22:11:54 -0000 1.2 @@ -4,7 +4,7 @@ #include <iostream> #include <memory> // auto_ptr -#include <S11N_NAMESPACE/Serializer.h> +#include <S11N_NAMESPACE/serializer.h> // #include <S11N_NAMESPACE/s11n_io.h> #include <S11N_NAMESPACE/debuggering_macros.h> // COUT/CERR #include <S11N_NAMESPACE/string_util.h> //trim_string() @@ -52,7 +52,7 @@ std::auto_ptr<basic_serializer> ser = std::auto_ptr<basic_serializer>( bobTheLoader.load( cookie ) ); if( ! (ser.get()) ) { - CERR << "Did not find Serializer for cookie ["<<cookie<<"]."<<std::endl; + CERR << "Did not find serializer for cookie ["<<cookie<<"]."<<std::endl; return NULL; } return ser->deserialize( is ); Index: ns.node_loader.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.node_loader.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.node_loader.h 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.node_loader.h 19 Nov 2003 22:11:54 -0000 1.2 @@ -14,7 +14,7 @@ class s11n_node; // forward decl /** - node_loader is a convenience class for loading Serializables + node_loader is a convenience class for loading serializables from files. It is similar to FlexTreeBuilder::loadBuilder(), but: - operates MUCH differently. @@ -58,9 +58,9 @@ /** Looks at the first few bytes of the given stream - and tries to find a Serializer for it. If it finds + and tries to find a serializer for it. If it finds none it returns NULL. If it finds one it returns - whatever that Serializer's deserialize() method + whatever that serializer's deserialize() method returns. See S11N_NAMESPACE::basic_serializer and S11N_NAMESPACE::serializer_loader. Index: ns.s11n_globals.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.s11n_globals.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.s11n_globals.h 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.s11n_globals.h 19 Nov 2003 22:11:54 -0000 1.2 @@ -28,14 +28,14 @@ /** UNTESTED. - Tries to deserialize a SerializableT from the input + Tries to deserialize a serializableT from the input stream. Returns a new object on success and NULL on error. The caller owns the returned pointer. */ - template <typename SerializableT> - static SerializableT * load_serializable( std::istream & istr ) + template <typename serializableT> + static serializableT * load_serializable( std::istream & istr ) { static node_loader bob; std::auto_ptr<s11n_node> node = std::auto_ptr<s11n_node>( bob.load( istr ) ); @@ -43,24 +43,24 @@ { return NULL; } - return node->s11n_node::deserialize<SerializableT>(); + return node->s11n_node::deserialize<serializableT>(); } /** UNTESTED. - Tries to deserialize a SerializableT from the input + Tries to deserialize a serializableT from the input stream. Returns a new object on success and NULL on error. The caller owns the returned pointer. */ - template <typename SerializableT> - static SerializableT * load_serializable( const std::string & file ) + template <typename serializableT> + static serializableT * load_serializable( const std::string & file ) { std::auto_ptr<std::istream> istr = std::auto_ptr<std::istream>( get_istream( file ) ); if( ! (istr.get()) ) return NULL; - return load_serializable<SerializableT>( *istr ); + return load_serializable<serializableT>( *istr ); } Index: ns.s11n_io.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.s11n_io.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.s11n_io.h 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.s11n_io.h 19 Nov 2003 22:11:54 -0000 1.2 @@ -5,7 +5,7 @@ // Author: stephan beal <st...@s1...> // License: Public Domain // This file defines interfaces for saving/loading s11n_node and -// Serializable objects. +// serializable objects. // #include <sstream> @@ -17,7 +17,7 @@ // #endif #include <S11N_NAMESPACE/file_util.h> // get_ostream(), get_istream() -#include <S11N_NAMESPACE/Serializer.h> +#include <S11N_NAMESPACE/serializer.h> namespace S11N_NAMESPACE { @@ -26,17 +26,17 @@ DefaultS11nType is a typedef for default saver/loader type used by s11n_io for de/serializing from/to iostreams. - It must be an S11N_NAMESPACE::Serializer type. + It must be an S11N_NAMESPACE::serializer type. */ typedef S11N_NAMESPACE::FunXMLSerializer DefaultS11nType; /** s11n_io is a convenience (ha ha) class for saving/loading - s11n_nodes and Serializables. + s11n_nodes and serializables. - The templatized parameter, SerializerT, must be a subtype - of S11N_NAMESPACE::Serializer. + The templatized parameter, serializerT, must be a subtype + of S11N_NAMESPACE::serializer. A note about the static functions: whether they should be static or not is mainly a maintenance-related question. i @@ -61,18 +61,18 @@ determine whether to write non/compressed files, so set any preference via that function. */ - template < typename SerializerT = DefaultS11nType > + template < typename serializerT = DefaultS11nType > class s11n_io { /** Convenience typedef */ - typedef s11n_io<SerializerT> ThisType; + typedef s11n_io<serializerT> ThisType; public: /** - This type of Serializer this class uses. + This type of serializer this class uses. */ - typedef SerializerT serializer_type; + typedef serializerT serializer_type; /** Saves node to the given output stream. Returns Index: ns.s11n_node.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/ns.s11n_node.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.s11n_node.h 17 Nov 2003 20:28:22 -0000 1.1 +++ ns.s11n_node.h 19 Nov 2003 22:11:54 -0000 1.2 @@ -207,13 +207,13 @@ /** Returns the current classloader for the given - SerializableType. + serializableType. */ - template <class SerializableType> - static class_loader<SerializableType> & classloader() + template <class serializableType> + static class_loader<serializableType> & classloader() { return context_singleton< - dll_loader<SerializableType>, + dll_loader<serializableType>, s11n_node >::instance(); } @@ -221,22 +221,22 @@ /** Tries to create a new object of the type named in this->impl_class(). If that class cannot be loaded - by class_loader<SerializableType> then NULL is + by class_loader<serializableType> then NULL is returned. It next tries to deserialize() the new object, passing it (*this). If that fails, the new child is deleted and NULL is returned. - If all else goes peachy, a (SerializableType *) is + If all else goes peachy, a (serializableType *) is returned, which the caller takes ownership of. */ - template <class SerializableType> - SerializableType * deserialize() const + template <class serializableType> + serializableType * deserialize() const { const std::string classname = this->impl_class(); - SerializableType *tgt = 0; - tgt = this->classloader<SerializableType>().load( classname ); + serializableType *tgt = 0; + tgt = this->classloader<serializableType>().load( classname ); ... [truncated message content] |
Update of /cvsroot/libfunutil/libfunutil/lib/s11n/parsers In directory sc8-pr-cvs1:/tmp/cvs-serv28813/parsers Modified Files: Makefile ns.compact.flex.at ns.funtxt.flex.at ns.funxml.flex.at ns.hex.flex.at ns.paren.flex.at ns.simplexml.flex.at Log Message: mass file-name changes. All classes now have stl-style names, partly for consistency, partly because that's my fad at the moment, and partly to avoid stepping on the original fun::{Serializ{er,able}}.h. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 17 Nov 2003 20:30:37 -0000 1.4 +++ Makefile 19 Nov 2003 22:11:54 -0000 1.5 @@ -2,6 +2,8 @@ S11N_NAMESPACE ?= s11n +enable_hexed = 0 + NS_SOURCES = \ ns.flex_lexers.cpp NS_HEADERS = \ @@ -20,8 +22,10 @@ INSTALL_PACKAGE_HEADERS = $(HEADERS) FLEXES = compact paren funtxt funxml select_lexer simplexml +ifeq (0,$(enable_hexed)) +FLEXES += hex +endif CLEAN_FILES += $(addsuffix .flex.at,$(FLEXES)) -# hex SOURCES_FLEX = $(addsuffix .flex.cpp,$(FLEXES)) NAMESPACE = $(S11N_NAMESPACE) @@ -38,10 +42,13 @@ select_lexer_FLEXES_ARGS = -i -B -Pselect_lexer simplexml_FLEXES_ARGS = -B -Psimplexml paren_FLEXES_ARGS = -B -Pparen -hex_FLEXES_ARGS = -i -B -Phex compact_FLEXES_ARGS = -i -B -Pcompact +ifeq (0,$(enable_hexed)) +hex_FLEXES_ARGS = -i -B -Phex +endif include $(toc_makesdir)/flex.make + COMMON_FLEX_DEFS = common_flex_definitions.at flex_definitions = include:COMMON_DEFINITIONS=$(COMMON_FLEX_DEFS) $(COMMON_FLEX_DEFS): @@ -73,10 +80,12 @@ $(flex_definitions) \ ) || exit; touch $@ +ifeq (0,$(enable_hexed)) hex.flex: hex.flex.at $(COMMON_FLEX_DEFS) Makefile @$(call toc_atparse_file,$<,$@, \ $(flex_definitions) \ ) || exit; touch $@ +endif compact.flex: compact.flex.at $(COMMON_FLEX_DEFS) Makefile @$(call toc_atparse_file,$<,$@, \ @@ -123,11 +132,13 @@ paren: paren.flex Makefile $(call toc_compile_c_binary,paren) +ifeq (0,$(enable_hexed)) hex_bin_SOURCES = hex.flex.cpp hex_bin_CFLAGS = $(INCLUDES) -DHEX_DO_MAIN=1 -g hex_bin_LFLAGS = -lstdc++ $(S11N_CLIENT_LDADD) hex: hex.flex Makefile $(call toc_compile_c_binary,hex) +endif compact_bin_SOURCES = compact.flex.cpp compact_bin_CFLAGS = $(INCLUDES) -DCOMPACT_DO_MAIN=1 -g Index: ns.compact.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/ns.compact.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.compact.flex.at 17 Nov 2003 20:29:50 -0000 1.1 +++ ns.compact.flex.at 19 Nov 2003 22:11:54 -0000 1.2 @@ -104,7 +104,7 @@ HEX_DIGIT ([a-fA-F0-9]) WORD4 ({HEX_DIGIT}{4}) - // maintenance note: these hex codes must be kept in sync with those from HexSerializer's enum + // maintenance note: these hex codes must be kept in sync with those from hex_serializer's enum NODE_OPEN f1 NODE_CLOSE f0 PROP_OPEN e1 @@ -184,7 +184,7 @@ %% #if COMPACT_DO_MAIN -#include <S11N_NAMESPACE/s11n_io.h> // HexSerializer +#include <S11N_NAMESPACE/s11n_io.h> // hex_serializer // #include <S11N_NAMESPACE/FlexShell.h> // #include <S11N_NAMESPACE/ELib.h> using namespace S11N_NAMESPACE; @@ -196,9 +196,9 @@ while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { - S11N_NAMESPACE::ParenSerializer ser; + S11N_NAMESPACE::paren_serializer ser; ser.serialize( *(bob.root_node()), std::cout ); -// S11N_NAMESPACE::CompactSerializer compact; +// S11N_NAMESPACE::compact_serializer compact; // compact.serialize( *(bob.root_node()), std::cout ); } return 0; Index: ns.funtxt.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/ns.funtxt.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.funtxt.flex.at 17 Nov 2003 20:29:50 -0000 1.1 +++ ns.funtxt.flex.at 19 Nov 2003 22:11:54 -0000 1.2 @@ -73,7 +73,7 @@ #include <S11N_NAMESPACE/node_builder.h> #include <S11N_NAMESPACE/flex_lexers.h> -#include <S11N_NAMESPACE/Serializer.h> +#include <S11N_NAMESPACE/serializer.h> using std::cin; using std::cerr; Index: ns.funxml.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/ns.funxml.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.funxml.flex.at 17 Nov 2003 20:29:50 -0000 1.1 +++ ns.funxml.flex.at 19 Nov 2003 22:11:54 -0000 1.2 @@ -13,7 +13,7 @@ #include <S11N_NAMESPACE/flex_lexers.h> #include <S11N_NAMESPACE/string_util.h> // translate_entities() #include <S11N_NAMESPACE/s11n_globals.h> // xml_entity_map() -#include <S11N_NAMESPACE/Serializer.h> +#include <S11N_NAMESPACE/serializer.h> using std::cin; using std::cerr; Index: ns.hex.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/ns.hex.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.hex.flex.at 17 Nov 2003 20:29:50 -0000 1.1 +++ ns.hex.flex.at 19 Nov 2003 22:11:54 -0000 1.2 @@ -103,7 +103,7 @@ HEX_DIGIT ([a-fA-F0-9]) WORD2 {HEX_DIGIT}{2} - // maintenance note: these hex codes must be kept in sync with those from HexSerializer's enum + // maintenance note: these hex codes must be kept in sync with those from hex_serializer's enum NODE_OPEN 11 NODE_CLOSE 10 PROP_OPEN 21 @@ -186,7 +186,7 @@ %% #if HEX_DO_MAIN -#include <S11N_NAMESPACE/s11n_io.h> // HexSerializer +#include <S11N_NAMESPACE/s11n_io.h> // hex_serializer // #include <S11N_NAMESPACE/FlexShell.h> // #include <S11N_NAMESPACE/ELib.h> using namespace S11N_NAMESPACE; @@ -198,7 +198,7 @@ while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { - S11N_NAMESPACE::ParenSerializer ser; + S11N_NAMESPACE::paren_serializer ser; ser.serialize( *(bob.root_node()), std::cout ); } return 0; Index: ns.paren.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/ns.paren.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.paren.flex.at 17 Nov 2003 20:29:50 -0000 1.1 +++ ns.paren.flex.at 19 Nov 2003 22:11:54 -0000 1.2 @@ -5,7 +5,7 @@ Author: stephan - st...@s1... This lexer reads in a lisp-like (but not lisp) grammar for the s11n -framework. It's output partner is S11N_NAMESPACE::ParenSerializer. +framework. It's output partner is S11N_NAMESPACE::paren_serializer. Sample: @@ -44,7 +44,7 @@ #include <S11N_NAMESPACE/node_builder.h> #include <S11N_NAMESPACE/flex_lexers.h> -#include <S11N_NAMESPACE/Serializer.h> // for ParenSerializer::translations() +#include <S11N_NAMESPACE/serializer.h> // for paren_serializer::translations() using std::cin; using std::cerr; using std::cout; @@ -171,7 +171,7 @@ } // S11N_NAMESPACE::trim_string( propval, S11N_NAMESPACE::TrimLeading ); - static S11N_NAMESPACE::ParenSerializer ser; + static S11N_NAMESPACE::paren_serializer ser; S11N_NAMESPACE::translate_entities( propval, ser.translations(), true ); //std::cout << "["<<propval<<"]"<<std::endl; serbuilder->add_property( propname, propval ); @@ -242,7 +242,7 @@ #if PAREN_DO_MAIN -#include <S11N_NAMESPACE/s11n_io.h> // ParenSerializer +#include <S11N_NAMESPACE/s11n_io.h> // paren_serializer int main( int argc, char ** argv ) { S11N_NAMESPACE::ParenTreeBuilder bob; @@ -250,7 +250,7 @@ while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { - S11N_NAMESPACE::ParenSerializer ser; + S11N_NAMESPACE::paren_serializer ser; ser.serialize( *(bob.root_node()), std::cout ); } return 0; Index: ns.simplexml.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/ns.simplexml.flex.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ns.simplexml.flex.at 17 Nov 2003 20:29:50 -0000 1.1 +++ ns.simplexml.flex.at 19 Nov 2003 22:11:54 -0000 1.2 @@ -19,7 +19,7 @@ #include <stack> #include <S11N_NAMESPACE/string_util.h> // normalize_string(), xml_entity_map(), etc #include <S11N_NAMESPACE/flex_lexers.h> -#include <S11N_NAMESPACE/Serializer.h> +#include <S11N_NAMESPACE/serializer.h> #include <S11N_NAMESPACE/key_value_parser.h> #include <S11N_NAMESPACE/context_singleton.h> using std::cin; |
From: <sg...@us...> - 2003-11-19 22:10:00
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv28461 Removed Files: ns.CompactSerializer.cpp ns.FileLoader.cpp ns.FileLoader.h ns.HexSerializer.cpp ns.ParenSerializer.cpp ns.S11n.cpp ns.S11n.h ns.Serializable.cpp ns.Serializable.h ns.Serializer.cpp Log Message: renamed to stl-style. --- ns.CompactSerializer.cpp DELETED --- --- ns.FileLoader.cpp DELETED --- --- ns.FileLoader.h DELETED --- --- ns.HexSerializer.cpp DELETED --- --- ns.ParenSerializer.cpp DELETED --- --- ns.S11n.cpp DELETED --- --- ns.S11n.h DELETED --- --- ns.Serializable.cpp DELETED --- --- ns.Serializable.h DELETED --- --- ns.Serializer.cpp DELETED --- |
From: <sg...@us...> - 2003-11-17 22:36:33
|
Update of /cvsroot/libfunutil/libfunutil/doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv26511 Modified Files: Makefile Log Message: changed install dir's name to 'html' Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/doc/api/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile 17 Nov 2003 22:24:24 -0000 1.10 +++ Makefile 17 Nov 2003 22:36:30 -0000 1.11 @@ -20,6 +20,8 @@ BT_PROG_PERL=$(PERL_BIN) \ +DOXYGEN_INSTALL_DIRNAME = html + ifeq (,$(DOXYGEN_BIN)) all: else |
From: <sg...@us...> - 2003-11-17 22:33:41
|
Update of /cvsroot/libfunutil/libfunutil/toc/make In directory sc8-pr-cvs1:/tmp/cvs-serv25766 Modified Files: DOXYGEN.make Log Message: client may now set DOXYGEN_INSTALL_DIRNAME to set the destination dir's basename Index: DOXYGEN.make =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/make/DOXYGEN.make,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DOXYGEN.make 17 Nov 2003 22:15:39 -0000 1.2 +++ DOXYGEN.make 17 Nov 2003 22:33:38 -0000 1.3 @@ -38,7 +38,7 @@ DOXYGEN_IN = Doxyfile.at DIST_FILES += $(DOXYGEN_IN) index.txt -doxygen_install_dirname = doxygen-$(PACKAGE_NAME)-$(PACKAGE_VERSION) +DOXYGEN_INSTALL_DIRNAME ?= doxygen-$(PACKAGE_NAME)-$(PACKAGE_VERSION) docs: doxygen clean: clean-doxygen install: install-doxygen @@ -75,10 +75,11 @@ @echo Output is in $(doxygen_outdir) and ./latex. clean-doxygen: -rm -fr $(doxygen_outdir) latex +doxygen_finaldest = $(INSTALL_DOCS_DEST)/$(DOXYGEN_INSTALL_DIRNAME) install-doxygen: doxygen - @echo "Installing docs to $(INSTALL_DOCS_DEST)/$(doxygen_install_dirname)" - @test -d $(INSTALL_DEST_DOXYGEN) || mkdir -p $(INSTALL_DEST_DOXYGEN); \ - cp -r $(doxygen_outdir) $(INSTALL_DOCS_DEST)/$(doxygen_install_dirname) + @-test -d $(doxygen_finaldest) && rm -fr $(doxygen_finaldest) + @echo "Installing docs to $(INSTALL_DOCS_DEST)/$(DOXYGEN_INSTALL_DIRNAME)" + @cp -r $(doxygen_outdir) $(INSTALL_DOCS_DEST)/$(DOXYGEN_INSTALL_DIRNAME) |
From: <sg...@us...> - 2003-11-17 22:32:49
|
Update of /cvsroot/libfunutil/libfunutil/doc/api/html In directory sc8-pr-cvs1:/tmp/cvs-serv25548/doc/api/html Removed Files: Makefile Log Message: new doxygen support has made this unnecessary. --- Makefile DELETED --- |
From: <sg...@us...> - 2003-11-17 22:24:27
|
Update of /cvsroot/libfunutil/libfunutil/doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv23566 Modified Files: Makefile Log Message: now uses DOXYGEN.make Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/doc/api/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile 14 Oct 2003 03:36:25 -0000 1.9 +++ Makefile 17 Nov 2003 22:24:24 -0000 1.10 @@ -1,36 +1,28 @@ -SUBDIRS = html include toc.make +# Note: much of this process was written by Rusty Ballinger. -DOXYFILE_IN = Doxyfile.in -DOXYFILE = Doxyfile - -DIST_FILES += Makefile.bt $(DOXYFILE_IN) index.txt -CLEAN_FILES += $(DOXYFILE) - -ifdef DOXYGEN_BIN -all: doxygen subdirs -# doesn't yet support subdirs in filenames: -# INSTALL_DOCS += html/* -endif - -doxygen: clean-subdirs $(DOXYFILE) - $(DOXYGEN_BIN) +DIST_FILES += Doxyfile.at index.txt -clean: clean-doxygen -clean-doxygen: - -rm -fr latex +INCLUDES_DIRS = $(addprefix $(top_includesdir)/,fun) -DOXYGEN_INCLUDE_PATHS = $(top_includesdir)/fun -ifeq (1,$(configure_enable_s11n)) - DOXYGEN_INCLUDE_PATHS += $(top_includesdir)/s11n $(top_includesdir)/toolbox -endif +DOXYGEN_PREDEF = \ + HAVE_CONFIG_H=1 \ + ZSTREAM_NAMESPACE=$(TOOLBOX_NAMESPACE) \ + CL_NAMESPACE=$(CL_NAMESPACE) \ + TOOLBOX_NAMESPACE=$(TOOLBOX_NAMESPACE) -atparser = $(top_srcdir)/toc/bin/atsign_parse -$(DOXYFILE): Makefile $(DOXYFILE_IN) - $(call toc_atparse_file,$(DOXYFILE_IN),$@, \ +DOXYGEN_ATPARSE_ARGS = \ + $(DOXYGEN_PREDEF) \ + CL_NAMESPACE=$(CL_NAMESPACE) \ + TOOLBOX_NAMESPACE=$(TOOLBOX_NAMESPACE) \ + DOXYGEN_INPUT="index.txt $(INCLUDES_DIRS)" BT_PKG_NAME=$(PACKAGE_NAME) BT_PKG_VERSION=$(PACKAGE_VERSION) \ BT_PROG_PERL=$(PERL_BIN) \ - top_includesdir="$(top_includesdir)" \ - INPUT_PATHS="$(DOXYGEN_INCLUDE_PATHS)" \ - ) + +ifeq (,$(DOXYGEN_BIN)) +all: +else +include $(toc_makesdir)/DOXYGEN.make +all: doxygen +endif |
From: <sg...@us...> - 2003-11-17 22:20:10
|
Update of /cvsroot/libfunutil/libfunutil/doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv22416/doc/api Added Files: Doxyfile.at Log Message: egg |
From: <sg...@us...> - 2003-11-17 22:15:42
|
Update of /cvsroot/libfunutil/libfunutil/toc/make In directory sc8-pr-cvs1:/tmp/cvs-serv21517 Modified Files: DOXYGEN.make Log Message: removed DOXYGEN_FILTER from clean files. Just because it's a temp file in one tree doesn't mean this is universal! Index: DOXYGEN.make =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/make/DOXYGEN.make,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DOXYGEN.make 17 Nov 2003 18:23:07 -0000 1.1 +++ DOXYGEN.make 17 Nov 2003 22:15:39 -0000 1.2 @@ -57,8 +57,6 @@ DOXYGEN_MAKE = $(toc_makesdir)/DOXYGEN.make -CLEAN_FILES += $(DOXYGEN_FILTER) - atparser = $(top_srcdir)/toc/bin/atsign_parse $(top_srcdir)/configure: $(DOXYFILE): $(DOXYGEN_FILTER) $(DOXYGEN_IN) Makefile $(top_srcdir)/configure |
From: <sg...@us...> - 2003-11-17 22:01:18
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv18024 Modified Files: toc.s11n.make.at Log Message: s11n finally integrated into fun namespace. Still a few filename stepping-on-toes problems to solve. Index: toc.s11n.make.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc.s11n.make.at,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- toc.s11n.make.at 17 Nov 2003 20:27:18 -0000 1.2 +++ toc.s11n.make.at 17 Nov 2003 22:00:44 -0000 1.3 @@ -17,13 +17,19 @@ S11N_NAMESPACE = @S11N_NAMESPACE@ TOOLBOX_NAMESPACE = @TOOLBOX_NAMESPACE@ S11N_LIBDIR = $(top_srcdir)/lib -S11N_LIB_A = $(S11N_LIBDIR)/libs11n.a +ifeq (s11n,$(S11N_NAMESPACE)) +S11N_LIBNAME = s11n +else +S11N_LIBNAME = $(S11N_NAMESPACE)_s11n +endif + +S11N_LIB_A = $(S11N_LIBDIR)/lib$(S11N_LIBNAME).a $(S11N_LIB_A): ${MAKE} -C $(S11N_LIBDIR) -S11N_LIB_SO = $(S11N_LIBDIR)/libs11n.so +S11N_LIB_SO = $(S11N_LIBDIR)/lib$(S11N_LIBNAME).so $(S11N_LIB_SO): ${MAKE} -C $(S11N_LIBDIR) -L_S11N = -L$(S11N_LIBDIR) -ls11n +L_S11N = -L$(S11N_LIBDIR) -l$(S11N_LIBNAME) S11N_CLIENT_LDADD = $(L_S11N) $(LIBCL_CLIENT_LDADD) ifeq (1,$(configure_enable_zlib)) S11N_CLIENT_LDADD += -lz |
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; |
From: <sg...@us...> - 2003-11-17 22:00:52
|
Update of /cvsroot/libfunutil/libfunutil/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18024/lib Modified Files: Makefile 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/lib/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 17 Nov 2003 20:26:12 -0000 1.8 +++ Makefile 17 Nov 2003 22:00:48 -0000 1.9 @@ -1,4 +1,6 @@ include toc.make +# expected via toc: +# LIBS11N_LIBNAME ifeq (1,$(configure_enable_s11n)) @@ -7,6 +9,34 @@ SUBDIRS += funUtil + + +############################## OBJECTS +# Note that these OBJECTS vars will resolve to empty on an initial +# build, requiring a sub-make (after building SUBDIRS) to get the +# proper values here: +OBJECTS_CL = $(patsubst %,cl/%.o,class_loader path_finder) +OBJECTS_TOOLBOX = $(wildcard toolbox/*.o) +OBJECTS_S11N = $(wildcard s11n/*.o s11n/parsers/*.o) + + +S11N_LIBNAME ?= s11n +############################## static libs +STATIC_LIBS = lib$(S11N_LIBNAME) +lib$(S11N_LIBNAME)_a_OBJECTS = $(OBJECTS_TOOLBOX) $(OBJECTS_S11N) $(OBJECTS_CL) +include $(toc_makesdir)/STATIC_LIBS.make + +############################## enable/disable shared libs: +build_so = 1 +ifeq (1,$(build_so)) + SHARED_LIBS = $(STATIC_LIBS) + lib$(S11N_LIBNAME)_so_OBJECTS = $(OBJECTS_TOOLBOX) $(OBJECTS_S11N) ${PWD}/cl/lib$(LIBCL_LIBNAME).so + lib$(S11N_LIBNAME)_so_VERSION = $(PACKAGE_VERSION) + include $(toc_makesdir)/SHARED_LIBS.make +endif +# ^^^^ build shared libs? + all: subdirs + @${MAKE} --no-print-directory STATIC_LIBS SHARED_LIBS DIST_FILES += Makefile.bt |