30 |
|
SectionParserManager::~SectionParserManager() { |
31 |
|
SectionParserManager::iterator i; |
32 |
|
for (i = sectionParsers_.begin(); i != sectionParsers_.end(); ++i) { |
33 |
< |
delete (i->sp); |
33 |
> |
delete (i->sectionParser); |
34 |
|
} |
35 |
|
sectionParsers_.clear(); |
36 |
|
} |
37 |
|
|
38 |
< |
void SectionParserManager::parse(ifstrstream& input, ForceField& ff) { |
38 |
> |
void SectionParserManager::parse(std::istream& input, ForceField& ff) { |
39 |
|
|
40 |
|
//reset active flags |
41 |
|
SectionParserManager::iterator i; |
49 |
|
//scan through the input stream and find section names |
50 |
|
while(input.getline(buffer, bufferSize)) { |
51 |
|
++lineNo; |
52 |
< |
line = LeftTrim(buffer); |
53 |
< |
|
52 |
> |
/**@todo implement trimLeft() */ |
53 |
> |
//std::string line = LeftTrim(buffer); |
54 |
> |
std::string line= buffer; |
55 |
|
//a line begins with "//" is comment |
56 |
|
if ( line.empty() || (line.size() >= 2 && line[0] == '/' && line[1] == '/')) { |
57 |
|
continue; |
172 |
|
} |
173 |
|
|
174 |
|
|
175 |
< |
iterator SectionParserManager::findSectionParser(const std::string& sectionName) { |
175 |
> |
SectionParserManager::iterator SectionParserManager::findSectionParser(const std::string& sectionName) { |
176 |
|
SectionParserManager::iterator i; |
177 |
|
for (i = sectionParsers_.begin(); i != sectionParsers_.end(); ++i) { |
178 |
|
if (i->sectionParser->getSectionName() == sectionName) { |