Changeset 279 in dev for trunk/abdev/BasicCompiler_Common/src/ObjectModule.cpp
- Timestamp:
- Aug 14, 2007, 3:22:02 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r276 r279 2 2 3 3 #include <Compiler.h> 4 5 enum ObjectModuleDataType 6 { 7 ObjectModuleDataTypeXml, 8 ObjectModuleDataTypeText, 9 ObjectModuleDataTypeBinaly, 10 }; 11 const ObjectModuleDataType objectModuleDataType = ObjectModuleDataTypeText; 12 4 13 5 14 void ObjectModule::StaticLink( ObjectModule &objectModule ) … … 15 24 dataTable.Add( objectModule.dataTable ); 16 25 } 26 27 bool ObjectModule::Read( const std::string &filePath ) 28 { 29 switch( objectModuleDataType ) 30 { 31 case ObjectModuleDataTypeXml: 32 return ReadXml( filePath ); 33 case ObjectModuleDataTypeText: 34 return ReadText( filePath ); 35 case ObjectModuleDataTypeBinaly: 36 return ReadBinary( filePath ); 37 default: 38 Jenga::Throw( "" ); 39 break; 40 } 41 return false; 42 } 43 bool ObjectModule::Write( const std::string &filePath ) const 44 { 45 switch( objectModuleDataType ) 46 { 47 case ObjectModuleDataTypeXml: 48 return WriteXml( filePath ); 49 case ObjectModuleDataTypeText: 50 return WriteText( filePath ); 51 case ObjectModuleDataTypeBinaly: 52 return WriteBinary( filePath ); 53 default: 54 Jenga::Throw( "" ); 55 break; 56 } 57 return false; 58 } 59 bool ObjectModule::ReadString( const std::string &str ) 60 { 61 switch( objectModuleDataType ) 62 { 63 case ObjectModuleDataTypeXml: 64 return ReadXmlString( str ); 65 case ObjectModuleDataTypeText: 66 return ReadTextString( str ); 67 case ObjectModuleDataTypeBinaly: 68 Jenga::Throw( "" ); 69 break; 70 default: 71 Jenga::Throw( "" ); 72 break; 73 } 74 return false; 75 } 76 bool ObjectModule::WriteString( std::string &str ) const 77 { 78 switch( objectModuleDataType ) 79 { 80 case ObjectModuleDataTypeXml: 81 return WriteXmlString( str ); 82 case ObjectModuleDataTypeText: 83 return WriteTextString( str ); 84 case ObjectModuleDataTypeBinaly: 85 Jenga::Throw( "" ); 86 break; 87 default: 88 Jenga::Throw( "" ); 89 break; 90 } 91 return false; 92 }
Note:
See TracChangeset
for help on using the changeset viewer.