Commit 0ca0a626 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: use readLabel/readScalar (string) instead of via IStringStream

parent 817b9a14
......@@ -68,9 +68,11 @@ namespace Foam
return Hash<face>::operator()(t, 0);
}
}
const string SEPARATOR(" -1");
bool isSeparator(const string& line)
bool isSeparator(const std::string& line)
{
return line.substr(0, 6) == SEPARATOR;
}
......@@ -100,7 +102,7 @@ label readTag(IFstream& is)
} while (tag == SEPARATOR);
return readLabel(IStringStream(tag)());
return readLabel(tag);
}
......@@ -144,14 +146,14 @@ void skipSection(IFstream& is)
}
scalar readUnvScalar(const string& unvString)
scalar readUnvScalar(const std::string& unvString)
{
string s(unvString);
s.replaceAll("d", "E");
s.replaceAll("D", "E");
return readScalar(IStringStream(s)());
return readScalar(s);
}
......@@ -170,13 +172,13 @@ void readUnits
string line;
is.getLine(line);
label l = readLabel(IStringStream(line.substr(0, 10))());
label l = readLabel(line.substr(0, 10));
Info<< "l:" << l << endl;
string units(line.substr(10, 20));
Info<< "units:" << units << endl;
label unitType = readLabel(IStringStream(line.substr(30, 10))());
label unitType = readLabel(line.substr(30, 10));
Info<< "unitType:" << unitType << endl;
// Read lengthscales
......@@ -215,7 +217,7 @@ void readPoints
string line;
is.getLine(line);
label pointi = readLabel(IStringStream(line.substr(0, 10))());
label pointi = readLabel(line.substr(0, 10));
if (pointi == -1)
{
......
......@@ -70,7 +70,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeUncollated
}
// const scalar timeValue = Foam::name(this->mesh().time().timeValue());
const scalar timeValue = readScalar(IStringStream(timeDir)());
const scalar timeValue = readScalar(timeDir);
OFstream osCase(baseDir/surfName + ".case");
ensightGeoFile osGeom
......@@ -179,7 +179,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
// surfName already validated
const fileName meshFile(baseDir/surfName + ".000000.mesh");
const scalar timeValue = readScalar(IStringStream(timeDir)());
const scalar timeValue = readScalar(timeDir);
label timeIndex = 0;
// Do case file
......@@ -194,7 +194,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
if (is.good() && dict.read(is))
{
dict.lookup("times") >> times;
const scalar timeValue = readScalar(IStringStream(timeDir)());
const scalar timeValue = readScalar(timeDir);
label index = findLower(times, timeValue);
timeIndex = index+1;
}
......
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