Fixed gruptree reading

This commit is contained in:
Kjetil Olsen Lye 2012-03-28 09:35:49 +02:00
parent 1e9072b019
commit 89f1b6399f

View File

@ -294,27 +294,27 @@ struct GRUPTREE : public SpecialBase {
} }
virtual void read(std::istream & is) { virtual void read(std::istream & is) {
// Not done:
return;
while (!is.eof()) { while (!is.eof()) {
std::string child = readString(is); std::string child = readString(is);
is >> ignoreWhitespace;
std::string parent = readString(is); std::string parent = readString(is);
std::cout << "CHILD = " << child << std::endl << "PARENT = " << parent << std::endl; std::cout << "CHILD = " << child << std::endl << "PARENT = " << parent << std::endl;
tree[child] = parent; tree[child] = parent;
int action = next_action(is); // 0:continue 1:return 2:throw is >> ignoreSlashLine;
if (action == 1) { is >> ignoreWhitespace;
return; // Alphabetic char. Read next keyword. if(is.peek() == int('/')) {
} else if (action == 2) { is >> ignoreSlashLine;
THROW("Error reading GRUPTREE. Next character is " return;
<< (char) is.peek());
} }
} }
} }
virtual void write(std::ostream & os) { virtual void write(std::ostream & os) {
//os << name() << '\n' << tree << '\n'; for(std::map<std::string, std::string>::iterator it = tree.begin(); it != tree.end(); ++it) {
os << it->first << " "<< it->second<< std::endl;
}
} }
virtual void convertToSI(const EclipseUnits&) { virtual void convertToSI(const EclipseUnits&) {