Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VSFileXMLSerializer.cpp
Go to the documentation of this file.
1 #include "VSFileXMLSerializer.h"
2 #include "config.h"
3 
4 #include "vsfilesystem.h"
5 #include "audio/Exceptions.h"
6 
7 namespace XMLDOM
8 {
9 bool VSFileXMLSerializer::importXML( const std::string &path )
10 {
11  return importXML( path, VSFileSystem::UnknownFile );
12 }
13 
14 bool VSFileXMLSerializer::importXML( const std::string &path, VSFileSystem::VSFileType fileType )
15 {
17  if (file.OpenReadOnly( path, fileType ) > VSFileSystem::Ok)
18  throw Audio::FileOpenException( string("Cannot open \"" )+path+"\"" );
19  char buffer[4096];
20  size_t rode;
21  while ( ( rode = file.Read( buffer, 4096 ) ) )
22  parse( buffer, rode );
23  file.Close();
24  return true;
25 }
26 
27 bool VSFileXMLSerializer::exportXML( std::ostream &stream )
28 {throw Audio::Exception( "Cannot export to VSFile" );
29 }
30 };
31