20 #pragma warning(disable: 4786)
24 #include "itkNumericTraits.h"
45 throw FEMExceptionIO(__FILE__,__LINE__,
"FEMLightObject::Read",
"Error reading FEM object!");
60 f<<'<'<<FEMObjectFactory<Self>::ID2ClassName(this->
ClassID())<<
">\n";
63 f<<
"\t"<<
GN<<
"\t% Global object number\n";
68 throw FEMExceptionIO(__FILE__,__LINE__,
"FEMLightObject::Write",
"Error writing FEM object!");
84 std::string::size_type b,e;
87 std::string errorMessage;
94 if ( f.eof() )
return 0;
97 if ( (c = f.get()) !=
'<' )
100 std::getline(f,rest);
101 errorMessage =
"Expected < token not found. Instead found '";
103 errorMessage +=
"'.\nRest of line is '";
104 errorMessage += rest;
105 errorMessage +=
"'.\n";
108 f.getline(buf,256,
'>');
113 if ( (e=s.find_first_of(
whitespaces,b)) == std::string::npos )
129 errorMessage =
"Could not obtain class ID from FEMObjectFactory for '";
131 errorMessage +=
"'.";
138 errorMessage =
"Error creating new object of the derived class";
155 #ifndef FEM_USE_SMART_POINTERS
182 throw FEMExceptionIO(__FILE__,__LINE__,
"FEMLightObject::ReadAnyObjectFromStream()",errorMessage);
192 while(f && !f.eof() && (std::ws(f).peek()) ==
'%' )
194 std::getline(f,skip);