Changeset 169
- Timestamp:
- 07/25/08 10:54:15 (5 months ago)
- Files:
-
- trunk/dba/bakefile/dba.bkl (modified) (1 diff)
- trunk/dba/config.bkl (modified) (1 diff)
- trunk/dba/configure.in (modified) (1 diff)
- trunk/dba/dba.bkl (modified) (5 diffs)
- trunk/dba/dba/xmlistream.cpp (modified) (1 diff)
- trunk/dba/dba/xmlistream.h (modified) (2 diffs)
- trunk/dba/test/main.cpp (modified) (2 diffs)
- trunk/dba/test/xmltestcase.cpp (modified) (2 diffs)
- trunk/dba/test/xmltestcase.h (modified) (3 diffs)
- trunk/wxdba/configure.in (modified) (1 diff)
- trunk/wxdba/test/xmltestcase.cpp (modified) (2 diffs)
- trunk/wxdba/test/xmltestcase.h (modified) (2 diffs)
- trunk/wxdba/wxdba.bkl (modified) (6 diffs)
- trunk/wxdba/wxdba/csvarchive.h (modified) (2 diffs)
- trunk/wxdba/wxdba/csvistream.h (modified) (2 diffs)
- trunk/wxdba/wxdba/csvostream.h (modified) (2 diffs)
- trunk/wxdba/wxdba/exception.h (modified) (3 diffs)
- trunk/wxdba/wxdba/xmlarchive.cpp (modified) (3 diffs)
- trunk/wxdba/wxdba/xmlarchive.h (modified) (3 diffs)
- trunk/wxdba/wxdba/xmlistream.cpp (modified) (2 diffs)
- trunk/wxdba/wxdba/xmlistream.h (modified) (2 diffs)
- trunk/wxdba/wxdba/xmlostream.cpp (modified) (2 diffs)
- trunk/wxdba/wxdba/xmlostream.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dba/bakefile/dba.bkl
r151 r169 8 8 <option name="dbaxml_CXXFLAGS"/> 9 9 <option name="dbaxml_LIBS"/> 10 <option name="dbatest_CXXFLAGS"/> 11 <option name="dbatest_LIBS"/> 10 12 11 13 <template id="dba-lib-static"> trunk/dba/config.bkl
r127 r169 88 88 </set> 89 89 <set var="XMLLIB_STATIC"> 90 <if cond="XML==1">dba csv_static</if>90 <if cond="XML==1">dbaxml_static</if> 91 91 </set> 92 92 trunk/dba/configure.in
r126 r169 211 211 fi 212 212 213 # xml archive 214 AC_ARG_ENABLE(xml,[--enable-xml compile xml archive support]) 215 if test "$enable_xml" == "yes"; then 213 216 AC_BUILDER_CUSTOM_LIB([2.6.11],[xml2],[--cflags],[--libs],[xml2], 214 217 [ 215 218 XML=1 216 AC_SUBST(XML)217 219 ], 218 220 [ 219 221 XML=0 220 AC_SUBST(XML) 221 AC_MSG_RESULT([libxml2 library not found. XML support disabled]) 222 AC_MSG_ERROR([libxml2 library not found. XML support disabled]) 222 223 ] 223 224 ) 225 else 226 XML=0 227 fi 228 AC_SUBST(XML) 224 229 225 230 AC_BAKEFILE([m4_include(autoconf_inc.m4)]) trunk/dba/dba.bkl
r154 r169 261 261 test/testobject.cpp 262 262 test/utils.cpp 263 test/xmltestcase.cpp264 263 </set> 265 264 … … 280 279 test/testobject.h 281 280 test/utils.h 282 test/xmltestcase.h283 281 </set> 284 282 … … 308 306 <library>dbatestlib</library> 309 307 <library>$(CSVLIB_STATIC)</library> 308 <library>$(XMLLIB_STATIC)</library> 310 309 </template> 311 310 … … 315 314 test/stdfilters_test.cpp 316 315 test/connectstringtestcase.cpp 316 test/xmltestcase.cpp 317 317 </sources> 318 318 <msvc-headers> 319 319 test/stdfilters_test.h 320 320 test/connectstringtestcase.h 321 test/xmltestcase.h 321 322 </msvc-headers> 322 323 <define>$(define_shared)</define> … … 325 326 <exe id="dba_test_static" template="testbase" cond="SHARED=='0' and TESTS=='1'"> 326 327 <nameexe>dba_test_static</nameexe> 327 <library>dbaxml_static</library>328 <library>dbacsv_static</library>329 328 <library>libdba_static</library> 330 329 </exe> trunk/dba/dba/xmlistream.cpp
r166 r169 41 41 pNode = pNode->next; 42 42 return pNode; 43 }; 44 45 void 46 XMLIStream::ignoreNonMappedNodes(bool pFlag) { 47 throw APIException("ignoreNonMappedNodes is not implemented yet"); 48 }; 49 50 void 51 XMLIStream::ignoreNodeOrder(bool pFlag) { 52 throw APIException("ignoreNodeOrder is not implemented yet"); 43 53 }; 44 54 trunk/dba/dba/xmlistream.h
r166 r169 28 28 If set to true, then stream will igore all nodes that are not mapped to class 29 29 members or binded to variables. 30 @note Not implemented yet - needs store table reorganization 30 31 @param pFlag true if stream should ignore not mapped elements, false (the default) otherwise 31 32 */ … … 36 37 element order in xml file has to be the same as store table layout. Elements 37 38 from parent store table should be placed before elements in child store table. 39 @note Not implemented yet - needs store table reorganization 38 40 @param pFlag true if stream should element order, false (the default) otherwise 39 41 */ trunk/dba/test/main.cpp
r164 r169 144 144 CppUnit::BriefTestProgressListener listener; 145 145 runner.eventManager().addListener(&listener); 146 //runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );146 runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); 147 147 //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::sqlError)); 148 148 //runner.addTest(new CppUnit::TestCaller<PostgresSQLArchiveTestCase>("debug_test",&PostgresSQLArchiveTestCase::sqlError)); … … 150 150 //runner.addTest(new CppUnit::TestCaller<dba_tests::CSVTestCase>("debug_test",&dba_tests::CSVTestCase::invalidPos)); 151 151 //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::transactions_rollback)); 152 runner.addTest(dba_tests::XMLTestCase::suite());152 //runner.addTest(dba_tests::XMLTestCase::suite()); 153 153 //runner.addTest(new CppUnit::TestCaller<dba_tests::XMLTestCase>("debug_test",&dba_tests::XMLTestCase::sublist_two_store)); 154 154 //runner.addTest(new CppUnit::TestCaller<dba_tests::XMLTestCase>("debug_test",&dba_tests::XMLTestCase::store_two)); trunk/dba/test/xmltestcase.cpp
r166 r169 10 10 // 11 11 // 12 #ifdef TEST_XML 13 12 14 #include "xmltestcase.h" 13 15 #include "testobject.h" … … 20 22 #include <fstream> 21 23 22 #ifdef TEST_XML23 24 24 25 namespace dba_tests { trunk/dba/test/xmltestcase.h
r166 r169 13 13 #define TESTXMLTESTCASE_H 14 14 15 #ifdef TEST_XML 16 15 17 #include <cppunit/TestCase.h> 16 18 #include <cppunit/extensions/HelperMacros.h> … … 18 20 19 21 namespace dba_tests { 20 21 #ifdef TEST_XML22 22 23 23 /** … … 93 93 }; 94 94 95 } //namespace 96 95 97 #endif //TEST_XML 96 98 97 } //namespace98 99 99 #endif trunk/wxdba/configure.in
r150 r169 12 12 AC_BUILDER_CUSTOM_LIB([1.0.0],[dba],[--test-cxxflags],[--test-libs],[dbatest],[],[]) 13 13 14 ORGCXXFLAGS=$CXXFLAGS 15 ORGLIBS=$LIBS 16 AC_LANG(C++) 17 18 CXXFLAGS="$ORGCXXFLAGS $dbacsv_CXXFLAGS" 19 LIBS="$ORGLIBS -ldbacsv$DEBUG_SUFFIX $dbacsv_LIBS" 20 AC_MSG_CHECKING([csv support in dba]) 21 AC_TRY_LINK([#include "dba/csv.h"],[dba::CSVArchive ar], 22 [ 23 CSV=1 24 AC_MSG_RESULT(yes) 25 ],[ 26 CSV=0 27 AC_MSG_RESULT(no) 28 ] 29 ) 30 AC_SUBST(CSV) 31 32 CXXFLAGS="$ORGCXXFLAGS $dbaxml_CXXFLAGS" 33 LIBS="$ORGLIBS -ldbaxml$DEBUG_SUFFIX $dbaxml_LIBS" 34 AC_MSG_CHECKING([xml support in dba]) 35 AC_TRY_LINK([#include "dba/xmlarchive.h"],[dba::XMLArchive ar], 36 [ 37 XML=1 38 AC_MSG_RESULT(yes) 39 ], 40 [ 41 XML=0 42 AC_MSG_RESULT(no) 43 ] 44 ) 45 AC_SUBST(XML) 46 47 if test "$TESTS" == "1"; then 48 CXXFLAGS="$ORGCXXFLAGS $dbatest_CXXFLAGS" 49 LIBS="$ORGLIBS -ldbatest$DEBUG_SUFFIX $dbatest_LIBS" 50 AC_TRY_LINK([#include "dba/test/utils.h"],[dba_tests::Utils::getNow()], 51 [], 52 [ 53 AC_MSG_ERROR([Cannot find dba testlib. Try compile dba with --enable-tests]) 54 ] 55 ) 56 fi 57 58 CXXFLAGS=$ORGCXXFLAGS 59 LIBS=$ORGLIBS 60 14 61 AC_BAKEFILE([m4_include(autoconf_inc.m4)]) 15 62 AC_OUTPUT(Makefile wxdba-config) trunk/wxdba/test/xmltestcase.cpp
r150 r169 1 #ifdef USE_XML 2 1 3 #include "xmltestcase.h" 2 4 #include "string_filter.h" … … 48 50 49 51 } //namespace 52 53 #endif //USE_XML trunk/wxdba/test/xmltestcase.h
r150 r169 1 1 #ifndef WXDBA_TESTXMLTESTCASE_H 2 2 #define WXDBA_TESTXMLTESTCASE_H 3 4 #ifdef USE_XML 3 5 4 6 #include <cppunit/TestCase.h> … … 25 27 } //namespace 26 28 29 #endif //USE_XML 30 27 31 #endif 32 trunk/wxdba/wxdba.bkl
r150 r169 6 6 <include file="presets/dba.bkl" once="1"/> 7 7 8 <if cond="FORMAT_SUPPORTS_CONDITIONS=='1'"> 9 <option name="CSV"> 10 <values>0,1</values> 11 <default-value>0</default-value> 12 <description>Set to 1 to build support for csv file format</description> 13 </option> 14 <option name="XML"> 15 <values>0,1</values> 16 <default-value>0</default-value> 17 <description>Set to 1 to build support for xml file format</description> 18 </option> 19 </if> 20 21 <!-- Aviod matrix of msvc6prj configurations for all possibile options values 22 related to optional components --> 23 <if cond="FORMAT_SUPPORTS_CONDITIONS=='0'"> 24 <set var="CSV">1</set> 25 <set var="XML">1</set> 26 </if> 27 28 <!-- defines for optional files --> 29 <set var="define_xml"> 30 <if cond="XML=='1'">USE_XML</if> 31 </set> 32 <set var="define_csv"> 33 <if cond="CSV=='1'">USE_CSV</if> 34 </set> 35 8 36 <!-- library --> 9 37 <set var="LIBSRC">$(SRCDIR)$(DIRSEP)wxdba</set> … … 90 118 </set> 91 119 92 <template id="libwxdbabase"> 120 121 <template id="product"> 122 <define>$(define_xml)</define> 123 <define>$(define_csv)</define> 124 </template> 125 126 <template id="libwxdbabase" template="product"> 93 127 <name>wxdba-base</name> 94 128 <sources>$(LIBSOURCES-BASE)</sources> … … 108 142 109 143 110 <template id="libwxdbagui" >144 <template id="libwxdbagui" template="product"> 111 145 <name>wxdba-gui</name> 112 146 <sources>$(LIBSOURCES-GUI)</sources> … … 126 160 <set var="MSVC6PRJ_MERGED_TARGETS" append="1">libwxdba_gui=libwxdbagui_static+libwxdbagui_dynamic</set> 127 161 162 <set var="CSVLIB_STATIC"> 163 <if cond="CSV==1">dbacsv$(LIBDEBUGSUFFIX)</if> 164 </set> 165 <set var="XMLLIB_STATIC"> 166 <if cond="XML==1">dbaxml$(LIBDEBUGSUFFIX)</if> 167 </set> 168 128 169 <!-- 129 170 cppunit test 130 171 wxFont and wxColour dba tests needs wxWidgets GUI version to compile. 131 but it runs as console application132 172 --> 133 <template id="testbase" template_append="cppunitexe, wx-lib-gui">173 <template id="testbase" template_append="cppunitexe,dbatest-exe-static,wx-lib-gui,product,dba-xml-lib-static"> 134 174 <app-type>gui</app-type> 135 175 <include>$(LIBSRC)</include> … … 143 183 test/xmltestcase.cpp 144 184 </sources> 145 <sys-lib>dbatestd</sys-lib> 146 </template> 147 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'"> 185 <sys-lib>$(CSVLIB_STATIC)</sys-lib> 186 <sys-lib>$(XMLLIB_STATIC)</sys-lib> 187 </template> 188 189 <exe id="wxdba_test_static" template_append="testbase" cond="SHARED=='0' and USE_GUI=='1' and TESTS=='1'"> 149 190 <nameexe>wxdba_test_static</nameexe> 150 191 <library>libwxdbabase_static</library> … … 152 193 </exe> 153 194 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'">195 <exe id="wxdba_test_dynamic" template_append="testbase" cond="SHARED=='1' and USE_GUI=='1' and TESTS=='1'"> 155 196 <nameexe>wxdba_test_dynamic</nameexe> 156 197 <library>libwxdbabase_dynamic</library> trunk/wxdba/wxdba/csvarchive.h
r20 r169 9 9 #ifndef WXDBACSVARCHIVE_H 10 10 #define WXDBACSVARCHIVE_H 11 12 #ifdef USE_CSV 11 13 12 14 #include <wx/string.h> … … 45 47 } 46 48 49 #endif //USE_CSV 50 47 51 #endif trunk/wxdba/wxdba/csvistream.h
r20 r169 9 9 #ifndef WXDBACSVISTREAM_H 10 10 #define WXDBACSVISTREAM_H 11 12 #ifdef USE_CSV 11 13 12 14 #include <dba/csv.h> … … 33 35 } 34 36 37 #endif //USE_CSV 38 35 39 #endif trunk/wxdba/wxdba/csvostream.h
r21 r169 9 9 #ifndef WXDBACSVOSTREAM_H 10 10 #define WXDBACSVOSTREAM_H 11 12 #ifdef USE_CSV 11 13 12 14 #include <dba/csv.h> … … 30 32 } 31 33 34 #endif //USE_CSV 35 32 36 #endif trunk/wxdba/wxdba/exception.h
r150 r169 59 59 }; 60 60 61 #ifdef USE_CSV 62 61 63 class CSVFileException : public DatabaseException { 62 64 public: … … 69 71 }; 70 72 73 #endif 74 75 #ifdef USE_XML 76 71 77 class XMLException : public DatabaseException { 72 78 public: … … 74 80 }; 75 81 82 #endif 83 76 84 } 77 85 trunk/wxdba/wxdba/xmlarchive.cpp
r153 r169 1 #ifdef USE_XML 2 1 3 #include "xmlarchive.h" 2 4 #include "wxutils.h" … … 16 18 else 17 19 mHandle.setRootNodeName(Tools::ConvertToDbStr(pName,GetConversionSpecs().mDbCharset).c_str()); 20 } catch (const dba::Exception& pEx) { 21 Exception::Rethrow(pEx); 22 }; 23 }; 24 25 void 26 XMLArchive::AddNamespace(const wxString& pName, const wxString& pPrefix) { 27 try { 28 mHandle.addNamespace(Tools::ConvertToDbStr(pName,GetConversionSpecs().mDbCharset).c_str(), 29 Tools::ConvertToDbStr(pPrefix,GetConversionSpecs().mDbCharset).c_str()); 18 30 } catch (const dba::Exception& pEx) { 19 31 Exception::Rethrow(pEx); … … 98 110 99 111 } 112 113 #endif //USE_XML trunk/wxdba/wxdba/xmlarchive.h
r150 r169 1 1 #ifndef WXDBAXMLARCHIVE_H 2 2 #define WXDBAXMLARCHIVE_H 3 4 #ifdef USE_XML 3 5 4 6 #include <wx/string.h> … … 16 18 XMLArchive(); 17 19 void SetRootNodeName(const wxString& pName); 20 void AddNamespace(const wxString& pName, const wxString& pPrefix); 18 21 void Open(const wxString& pOpenStr); 19 22 bool IsOpen() const; … … 31 34 } 32 35 36 #endif //USE_XML 37 33 38 #endif trunk/wxdba/wxdba/xmlistream.cpp
r150 r169 1 #ifdef USE_XML 2 1 3 #include "xmlistream.h" 2 4 #include "wxutils.h" … … 86 88 } //namespace 87 89 90 #endif //USE_XML trunk/wxdba/wxdba/xmlistream.h
r150 r169 1 1 #ifndef WXDBAXMLISTREAM_H 2 2 #define WXDBAXMLISTREAM_H 3 4 #ifdef USE_XML 3 5 4 6 #include <dba/xmlistream.h> … … 26 28 } 27 29 30 #endif //USE_XML 31 28 32 #endif trunk/wxdba/wxdba/xmlostream.cpp
r150 r169 1 #ifdef USE_XML 2 1 3 #include "xmlostream.h" 2 4 #include "wxutils.h" … … 46 48 } //namespace 47 49 50 #endif //USE_XML trunk/wxdba/wxdba/xmlostream.h
r150 r169 1 1 #ifndef WXDBAXMLOSTREAM_H 2 2 #define WXDBAXMLOSTREAM_H 3 4 #ifdef USE_XML 3 5 4 6 #include <dba/xmlostream.h> … … 22 24 } //namespace 23 25 26 #endif //USE_XML 27 24 28 #endif
