Commit 44fd48ea authored by kraus's avatar kraus

replace std::string::last_of with the stem function of boost::filesystem

parent 1b9e2086
......@@ -740,16 +740,10 @@ void Fieldmap::write3DField(unsigned int nx,
if (Ippl::myNode() != 0 ||
(ef.size() != numpoints && bf.size() != numpoints)) return;
size_t extensionStart = Filename_m.find_last_of('.');
std::string baseName = Filename_m.substr(0, extensionStart);
size_t endPath = Filename_m.find_last_of('/');
if (endPath != std::string::npos) {
baseName = baseName.substr(endPath + 1);
}
boost::filesystem::path p(Filename_m);
std::string fname = Util::combineFilePath({
OpalData::getInstance()->getAuxiliaryOutputDirectory(),
baseName + ".vtk"
p.stem().string() + ".vtk"
});
std::ofstream of;
of.open (fname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment