Changeset 150
- Timestamp:
- 06/30/08 12:34:42 (6 months ago)
- Files:
-
- trunk/dba/bakefile/dba.bkl (modified) (3 diffs)
- trunk/dba/dba-config.in (modified) (1 diff)
- trunk/dba/dba.bkl (modified) (3 diffs)
- trunk/dba/dba/xmlarchive.cpp (modified) (3 diffs)
- trunk/dba/dba/xmlarchive.h (modified) (1 diff)
- trunk/dba/dba/xmlerrorhandler.h (modified) (1 diff)
- trunk/dba/dba/xmlexception.cpp (added)
- trunk/dba/dba/xmlexception.h (added)
- trunk/dba/dba/xmlistream.cpp (modified) (1 diff)
- trunk/wxdba/configure.in (modified) (1 diff)
- trunk/wxdba/test/main.cpp (modified) (2 diffs)
- trunk/wxdba/test/xmltestcase.cpp (added)
- trunk/wxdba/test/xmltestcase.h (added)
- trunk/wxdba/wxdba.bkl (modified) (6 diffs)
- trunk/wxdba/wxdba/exception.h (modified) (2 diffs)
- trunk/wxdba/wxdba/streamhelper.h (modified) (1 diff)
- trunk/wxdba/wxdba/xmlarchive.cpp (added)
- trunk/wxdba/wxdba/xmlarchive.h (added)
- trunk/wxdba/wxdba/xmlistream.cpp (added)
- trunk/wxdba/wxdba/xmlistream.h (added)
- trunk/wxdba/wxdba/xmlostream.cpp (added)
- trunk/wxdba/wxdba/xmlostream.h (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dba/bakefile/dba.bkl
r69 r150 6 6 <option name="dbacsv_CXXFLAGS"/> 7 7 <option name="dbacsv_LIBS"/> 8 <option name="dbaxml_CXXFLAGS"/> 9 <option name="dbaxml_LIBS"/> 8 10 9 11 <template id="dba-lib-static"> … … 37 39 <template id="dba-csv-exe-dynamic" template="dba-csv-lib-static"> 38 40 <ldlibs>$(dbacsv_LIBS)</ldlibs> 41 </template> 42 43 <template id="dba-xml-lib-static"> 44 <cxxflags>$(dbaxml_CXXFLAGS)</cxxflags> 45 </template> 46 47 <template id="dba-xml-lib-dynamic"> 48 <cxxflags>$(dbaxml_CXXFLAGS)</cxxflags> 49 </template> 50 51 <template id="dba-xml-exe-static" template="dba-xml-lib-static"> 52 <ldlibs>$(dbaxml_LIBS)</ldlibs> 53 </template> 54 55 <template id="dba-xml-exe-dynamic" template="dba-xml-lib-static"> 56 <ldlibs>$(dbaxml_LIBS)</ldlibs> 39 57 </template> 40 58 … … 96 114 <dll-link>dbacsv</dll-link> 97 115 </template> 116 <template id="dba-xml-lib-static" template="dba-lib-static"> 117 </template> 118 <template id="dba-xml-exe-static" template="dba-exe-static"> 119 <static-link>dbaxml</static-link> 120 </template> 121 <template id="dba-xml-lib-dynamic" template="dba-lib-dynamic"> 122 </template> 123 <template id="dba-xml-exe-dynamic" template="dba-exe-dynamic"> 124 <dll-link>dbaxml</dll-link> 125 </template> 126 98 127 </if> 99 128 </makefile> trunk/dba/dba-config.in
r126 r150 64 64 ;; 65 65 --xml-libs) 66 echo "-L$prefix/lib -ldbaxml@DEBUG_SUFFIX@ -ldba@DEBUG_SUFFIX@ "66 echo "-L$prefix/lib -ldbaxml@DEBUG_SUFFIX@ -ldba@DEBUG_SUFFIX@ @xml2_LIBS@" 67 67 ;; 68 68 --xml-cxxflags) 69 echo "-I$prefix/include "69 echo "-I$prefix/include @xml2_CXXFLAGS@" 70 70 ;; 71 71 --test-libs) trunk/dba/dba.bkl
r128 r150 92 92 dba/stream.h 93 93 dba/string_filter.h 94 dba/xmlarchive.h 95 dba/xmlerrorhandler.h 96 dba/xmlexception.h 97 dba/xmlistream.h 98 dba/xmlostream.h 94 99 </set> 95 100 … … 214 219 dba/xmlarchive.cpp 215 220 dba/xmlerrorhandler.cpp 221 dba/xmlexception.cpp 216 222 dba/xmlistream.cpp 217 223 dba/xmlostream.cpp … … 220 226 dba/xmlarchive.h 221 227 dba/xmlerrorhandler.h 228 dba/xmlexception.h 222 229 dba/xmlistream.h 223 230 dba/xmlostream.h trunk/dba/dba/xmlarchive.cpp
r142 r150 35 35 XMLArchive::open(const char* pOpenStr) { 36 36 mFilename = pOpenStr; 37 close(); 38 //must be after close() 37 39 ErrorContext c(this); 38 if (mDocument != NULL) {39 xmlFreeDoc(mDocument);40 };41 40 if (FileUtils::exists(pOpenStr)) { 42 41 mDocument = xmlParseFile(pOpenStr); … … 54 53 updateEncoding(); 55 54 mRootNode = mDocument->children; 55 }; 56 57 void 58 XMLArchive::close() { 59 if (mDocument != NULL) { 60 write(); 61 xmlFreeDoc(mDocument); 62 mDocument = NULL; 63 }; 56 64 }; 57 65 … … 140 148 XMLArchive::~XMLArchive() 141 149 { 142 if (mDocument != NULL) { 143 write(); 144 xmlFreeDoc(mDocument); 145 }; 150 close(); 146 151 xmlFree(mRootNodeName); 147 152 } trunk/dba/dba/xmlarchive.h
r142 r150 29 29 void setRootNodeName(const char* pName); 30 30 virtual void open(const char* pOpenStr); 31 /** 32 Close archive and write xml document to file 33 */ 34 void close(); 31 35 virtual bool isOpen() const { return mRootNode != NULL; } 32 36 XMLOStream getOStream(); trunk/dba/dba/xmlerrorhandler.h
r128 r150 13 13 #define DBAXMLERRORHANDLER_H 14 14 15 #include " exception.h"15 #include "xmlexception.h" 16 16 17 17 namespace dba { 18 19 /**20 Exception for libxml2 related errors21 */22 class XMLException : public DatabaseException {23 public:24 /**25 Constructor26 @param pError exception description27 */28 XMLException(const char* pError) : DatabaseException(pError) {};29 };30 18 31 19 /** trunk/dba/dba/xmlistream.cpp
r142 r150 21 21 mParentNode(pNode) 22 22 { 23 mCurrentNode = setNextNode(mParentNode->children);23 mCurrentNode = findNonTextNode(mParentNode->children); 24 24 } 25 25 trunk/wxdba/configure.in
r65 r150 9 9 #for tests 10 10 AC_BUILDER_CUSTOM_LIB([1.0.0],[dba],[--csv-cxxflags],[--csv-libs],[dbacsv],[],[]) 11 AC_BUILDER_CUSTOM_LIB([1.0.0],[dba],[--xml-cxxflags],[--xml-libs],[dbaxml],[],[]) 11 12 AC_BUILDER_CUSTOM_LIB([1.0.0],[dba],[--test-cxxflags],[--test-libs],[dbatest],[],[]) 12 13 trunk/wxdba/test/main.cpp
r51 r150 22 22 #include "apitestcase.h" 23 23 #include "collectionstestcase.h" 24 #include "xmltestcase.h" 24 25 25 26 class SQLite3CollectionsTestCase : public wxdba_test::CollectionsTestCase { … … 61 62 CppUnit::BriefTestProgressListener listener; 62 63 runner.eventManager().addListener(&listener); 63 runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );64 //runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); 64 65 //runner.addTest(new CppUnit::TestCaller<wxdba_test::DateTimeGMTOffset>("debug_test",&wxdba_test::DateTimeGMTOffset::test6)); 65 66 //runner.addTest(new CppUnit::TestCaller<wxdba_test::APITestCase>("debug_test",&wxdba_test::APITestCase::dbresult_conversion_win1250)); 66 67 //runner.addTest(new CppUnit::TestCaller<SQLite3CollectionsTestCase>("debug_test",&SQLite3CollectionsTestCase::wxArray_store)); 68 runner.addTest(new CppUnit::TestCaller<wxdba_test::XMLTestCase>("debug_test",&wxdba_test::XMLTestCase::onerow)); 67 69 68 70 runner.run(); trunk/wxdba/wxdba.bkl
r65 r150 35 35 wxdba/transaction.cpp 36 36 wxdba/wxutils.cpp 37 wxdba/xmlarchive.cpp 38 wxdba/xmlistream.cpp 39 wxdba/xmlostream.cpp 37 40 </set> 38 41 … … 64 67 wxdba/wxfiltersbase.h 65 68 wxdba/wxutils.h 69 wxdba/xmlarchive.h 70 wxdba/xmlistream.h 71 wxdba/xmlostream.h 66 72 </set> 67 73 … … 91 97 </template> 92 98 93 <lib id="libwxdbabase_static" template="lib,libwxdbabase,dba- lib-static,wx-lib-base" cond="SHARED=='0'">99 <lib id="libwxdbabase_static" template="lib,libwxdbabase,dba-xml-lib-static,wx-lib-base" cond="SHARED=='0'"> 94 100 </lib> 95 101 96 <dll id="libwxdbabase_dynamic" template="dll,libwxdbabase,dba- lib-dynamic,wx-lib-base" cond="SHARED=='1'">102 <dll id="libwxdbabase_dynamic" template="dll,libwxdbabase,dba-xml-lib-dynamic,wx-lib-base" cond="SHARED=='1'"> 97 103 <namedll>wxdba-base</namedll> 98 104 <so_version>$(SO_VERSION)</so_version> … … 109 115 </template> 110 116 111 <lib id="libwxdbagui_static" template="lib,libwxdbagui,dba- lib-static,wx-lib-gui" cond="SHARED=='0' and USE_GUI=='1'">117 <lib id="libwxdbagui_static" template="lib,libwxdbagui,dba-xml-lib-static,wx-lib-gui" cond="SHARED=='0' and USE_GUI=='1'"> 112 118 </lib> 113 119 114 <dll id="libwxdbagui_dynamic" template="dll,libwxdbagui,dba- lib-dynamic,wx-lib-gui" cond="SHARED=='1' and USE_GUI=='1'">120 <dll id="libwxdbagui_dynamic" template="dll,libwxdbagui,dba-xml-lib-dynamic,wx-lib-gui" cond="SHARED=='1' and USE_GUI=='1'"> 115 121 <namedll>wxdba-gui</namedll> 116 122 <so_version>$(SO_VERSION)</so_version> … … 132 138 test/collectionstestcase.cpp 133 139 <!--test/dbapluginstester.cpp--> 140 test/main.cpp 134 141 test/storeablefilterstestcase.cpp 135 142 test/toolstest.cpp 136 test/ main.cpp143 test/xmltestcase.cpp 137 144 </sources> 138 145 <sys-lib>dbatestd</sys-lib> 139 146 </template> 140 147 141 <exe id="wxdba_test_static" template_append="testbase,dba-csv-exe-static " cond="SHARED=='0' and USE_GUI=='1' and TESTS=='1'">148 <exe id="wxdba_test_static" template_append="testbase,dba-csv-exe-static,dba-xml-exe-static" cond="SHARED=='0' and USE_GUI=='1' and TESTS=='1'"> 142 149 <nameexe>wxdba_test_static</nameexe> 143 150 <library>libwxdbabase_static</library> … … 145 152 </exe> 146 153 147 <exe id="wxdba_test_dynamic" template_append="testbase,dba-csv-exe-dynamic " cond="SHARED=='1' and USE_GUI=='1' and TESTS=='1'">154 <exe id="wxdba_test_dynamic" template_append="testbase,dba-csv-exe-dynamic,dba-xml-exe-dynamic" cond="SHARED=='1' and USE_GUI=='1' and TESTS=='1'"> 148 155 <nameexe>wxdba_test_dynamic</nameexe> 149 156 <library>libwxdbabase_dynamic</library> trunk/wxdba/wxdba/exception.h
r79 r150 13 13 #include <dba/storeablefilter.h> 14 14 #include <dba/csv.h> 15 #include <dba/xmlexception.h> 15 16 #include <wx/string.h> 16 17 … … 68 69 }; 69 70 71 class XMLException : public DatabaseException { 72 public: 73 XMLException(const dba::XMLException& pEx) : DatabaseException(pEx) {}; 74 }; 75 70 76 } 71 77 trunk/wxdba/wxdba/streamhelper.h
r20 r150 28 28 void Close(); 29 29 void Destroy(); 30 void SetConversionSpecs(const dba::ConvSpec& pSpecs);31 const dba::ConvSpec& GetConversionSpecs() const;32 30 ~StreamHelper(); 33 31 protected:
