Added possibility to parse comments in readparam.
This commit is contained in:
parent
4544000065
commit
5c2cc54ecc
@ -119,6 +119,11 @@ namespace Opm {
|
||||
int lineno = 0;
|
||||
while (samcode_readline(is, parameter)) {
|
||||
++lineno;
|
||||
int commentpos = parameter.find(ID_comment);
|
||||
if (commentpos != 0) {
|
||||
if (commentpos != int(std::string::npos)) {
|
||||
parameter = parameter.substr(0, commentpos);
|
||||
}
|
||||
int fpos = parameter.find(ID_delimiter_assignment);
|
||||
if (fpos == int(std::string::npos)) {
|
||||
std::cerr << "WARNING: No '" << ID_delimiter_assignment << "' found on line " << lineno << ".\n";
|
||||
@ -133,6 +138,7 @@ namespace Opm {
|
||||
std::cerr << "WARNING: To many '" << ID_delimiter_assignment << "' found on line " << lineno << ".\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
fclose(is);
|
||||
#endif
|
||||
|
@ -63,6 +63,7 @@ namespace Opm {
|
||||
|
||||
const std::string ID_path_root = "";
|
||||
const std::string ID_delimiter_path = "/";
|
||||
const std::string ID_comment = "//";
|
||||
const std::string ID_delimiter_assignment = "=";
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
Loading…
Reference in New Issue
Block a user