Changeset 828 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp
- Timestamp:
- Mar 19, 2012, 1:59:48 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/egtra merged eligible
-
Property svn:mergeinfo
set to
-
trunk/ab5.0/abdev
-
Property svn:ignore
set to
*.opensdf
*.sdf
*.suo
*.user
int
ipch
out
-
Property svn:ignore
set to
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp
r751 r828 1 #pragma warning(disable : 4996)2 3 1 #include <map> 4 2 #include <string> … … 19 17 #include <limits.h> 20 18 #include <shlobj.h> 21 #include <process.h>22 #include <fcntl.h>23 #include <io.h>24 19 #include <shlwapi.h> 25 20 #include <tchar.h> 26 #include <stdarg.h>27 21 28 22 //boost libraries 29 23 #include <boost/foreach.hpp> 30 24 #include <boost/cast.hpp> 25 26 #pragma warning(push) 27 #pragma warning(disable: 4244 6326) 31 28 #include <boost/archive/xml_oarchive.hpp> 32 29 #include <boost/archive/xml_iarchive.hpp> … … 41 38 #include <boost/serialization/map.hpp> 42 39 #include <boost/serialization/version.hpp> 43 # include <boost/serialization/is_abstract.hpp>40 #pragma warning(pop) 44 41 45 42 #include <jenga/include/jenga.h> … … 49 46 using namespace Jenga::Common; 50 47 48 using boost::polymorphic_downcast; 49 51 50 template<class T_xml_schema> void BoostSerializationSupport<T_xml_schema>::echo( const char *msg ) const 52 51 { 53 MessageBox( NULL, msg, " XMLシリアライズの例外", MB_OK );52 MessageBox( NULL, msg, "シリアライズの例外", MB_OK ); 54 53 } 55 54 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadXml( std::istream& ifs, bool isShowExceptionMessage ) … … 61 60 62 61 // ファイルから読込 63 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);64 65 isSuccessful = true; 66 } 67 catch( boost::archive::archive_exception e )62 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 63 64 isSuccessful = true; 65 } 66 catch( boost::archive::archive_exception const& e ) 68 67 { 69 68 if( isShowExceptionMessage ) … … 94 93 95 94 // ファイルに書き出し 96 oa << boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);97 98 isSuccessful = true; 99 } 100 catch( boost::archive::archive_exception e )95 oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) ); 96 97 isSuccessful = true; 98 } 99 catch( boost::archive::archive_exception const& e ) 101 100 { 102 101 if( isShowExceptionMessage ) … … 154 153 155 154 // 文字列ストリームから読込 156 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);155 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 157 156 158 157 isSuccessful = true; … … 179 178 180 179 // 文字列ストリームに書き出し 181 oa << boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);182 183 isSuccessful = true; 184 } 185 catch( boost::archive::archive_exception e )180 oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) ); 181 182 isSuccessful = true; 183 } 184 catch( boost::archive::archive_exception const& e ) 186 185 { 187 186 echo( e.what() ); … … 211 210 212 211 // ファイルから読込 213 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);214 215 isSuccessful = true; 216 } 217 catch( boost::archive::archive_exception e )212 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 213 214 isSuccessful = true; 215 } 216 catch( boost::archive::archive_exception const& e ) 218 217 { 219 218 if( isShowExceptionMessage ) … … 249 248 250 249 // ファイルに書き出し 251 oa << boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);252 253 isSuccessful = true; 254 } 255 catch( boost::archive::archive_exception e )250 oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) ); 251 252 isSuccessful = true; 253 } 254 catch( boost::archive::archive_exception const& e ) 256 255 { 257 256 if( isShowExceptionMessage ) … … 289 288 290 289 // 文字列ストリームから読込 291 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);292 293 isSuccessful = true; 294 } 295 catch( boost::archive::archive_exception e )290 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 291 292 isSuccessful = true; 293 } 294 catch( boost::archive::archive_exception const& e ) 296 295 { 297 296 echo( e.what() ); … … 313 312 314 313 // 文字列ストリームに書き出し 315 oa << boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);316 317 isSuccessful = true; 318 } 319 catch( boost::archive::archive_exception e )314 oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) ); 315 316 isSuccessful = true; 317 } 318 catch( boost::archive::archive_exception const& e ) 320 319 { 321 320 echo( e.what() ); … … 342 341 343 342 // ファイルから読込 344 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);345 346 isSuccessful = true; 347 } 348 catch( boost::archive::archive_exception e )343 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 344 345 isSuccessful = true; 346 } 347 catch( boost::archive::archive_exception const& e ) 349 348 { 350 349 if( isShowExceptionMessage ) … … 380 379 381 380 // ファイルに書き出し 382 oa << boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);383 384 isSuccessful = true; 385 } 386 catch( boost::archive::archive_exception e )381 oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) ); 382 383 isSuccessful = true; 384 } 385 catch( boost::archive::archive_exception const& e ) 387 386 { 388 387 if( isShowExceptionMessage ) … … 420 419 421 420 // 文字列ストリームから読込 422 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);421 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 423 422 424 423 isSuccessful = true; … … 445 444 446 445 // 文字列ストリームに書き出し 447 oa << boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);448 449 isSuccessful = true; 450 } 451 catch( boost::archive::archive_exception e )446 oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) ); 447 448 isSuccessful = true; 449 } 450 catch( boost::archive::archive_exception const& e ) 452 451 { 453 452 echo( e.what() ); … … 478 477 479 478 // 文字列ストリームから読込 480 ia >> boost::serialization::make_nvp( RootTagName(), * (T_xml_schema *)this);479 ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) ); 481 480 482 481 isSuccessful = true;
Note:
See TracChangeset
for help on using the changeset viewer.