- std::ofstream ofs(fileName);
- ofs << "<VTKFile type=\"" << getVTKDataSetType() << "\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
- writeVTKLL(ofs,cda,pda);
- ofs << "</VTKFile>\n";
- ofs.close();
+ std::ofstream ofs(fileName.c_str());
+ ofs << "<VTKFile type=\"" << getVTKDataSetType() << "\" version=\"0.1\" byte_order=\"" << MEDCouplingByteOrderStr() << "\">\n";
+ writeVTKLL(ofs,cda,pda,byteData);
+ if(byteData)
+ {
+ ofs << "<AppendedData encoding=\"raw\">\n_1234";
+ ofs << std::flush; ofs.close();
+ std::ofstream ofs2(fileName.c_str(),std::ios_base::binary | std::ios_base::app);
+ ofs2.write(byteData->begin(),byteData->getNbOfElems()); ofs2 << std::flush; ofs2.close();
+ std::ofstream ofs3(fileName.c_str(),std::ios_base::app); ofs3 << "\n</AppendedData>\n</VTKFile>\n"; ofs3.close();
+ }
+ else
+ {
+ ofs << "</VTKFile>\n";
+ ofs.close();
+ }
+}
+
+void MEDCouplingMesh::SplitExtension(const std::string& fileName, std::string& baseName, std::string& extension)
+{
+ std::size_t pos(fileName.find_last_of('.'));
+ if(pos==std::string::npos)
+ {
+ baseName=fileName;
+ extension.clear();
+ return ;
+ }
+ baseName=fileName.substr(0,pos);
+ extension=fileName.substr(pos);