Merge branch 'save_compressed_mesh' into 'master'

check filename extension when saving a mesh

See merge request !57
This commit is contained in:
Joachim Schöberl 2017-11-06 17:03:31 +01:00
commit f1917aa2c4

View File

@ -409,11 +409,16 @@ namespace netgen
void Mesh :: Save (const string & filename) const
{
ostream * outfile;
if (filename.find(".vol.gz")!=string::npos)
outfile = new ogzstream(filename.c_str());
else if (filename.find(".vol")!=string::npos)
outfile = new ofstream(filename.c_str());
else
outfile = new ogzstream((filename+".vol.gz").c_str());
ofstream outfile(filename.c_str());
// ogzstream outfile( (filename+".gz") .c_str());
Save(outfile);
Save(*outfile);
delete outfile;
}