ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/io/OptionSectionParser.cpp
(Generate patch)

Comparing trunk/src/io/OptionSectionParser.cpp (file contents):
Revision 748 by chuckv, Wed Nov 16 21:37:45 2005 UTC vs.
Revision 788 by gezelter, Mon Dec 5 22:23:57 2005 UTC

# Line 44 | Line 44
44   *
45   *  Created by Charles F. Vardeman II on 11/15/05.
46   *  @author  Charles F. Vardeman II
47 < *  @version $Id: OptionSectionParser.cpp,v 1.1 2005-11-16 21:37:41 chuckv Exp $
47 > *  @version $Id: OptionSectionParser.cpp,v 1.3 2005-12-05 22:23:57 gezelter Exp $
48   *
49   */
50  
# Line 52 | Line 52
52   #include "types/AtomType.hpp"
53   #include "UseTheForce/ForceField.hpp"
54   #include "utils/simError.h"
55 + #include "utils/StringUtils.hpp"
56   namespace oopse {
57 <  
58 <  OptionSectionParser::OptionSectionParser() {
59 <    setSectionName("Options");
59 <    DefineOptionalParameter(MixingRule, "standard");
60 <    
61 <    
57 >
58 >  OptionSectionParser::OptionSectionParser(ForceFieldOptions& options) : options_(options) {
59 >    setSectionName("Options");        
60    }
61    
62    void OptionSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
# Line 66 | Line 64 | namespace oopse {
64      StringTokenizer tokenizer(line);
65      
66      if (tokenizer.countTokens() >= 2) {
67 <      std::string OptionName = tokenizer.nextToken();
68 <      std::string OptionValue = tokenizer.nextToken();
67 >      std::string optionName = tokenizer.nextToken();
68 >      std::string optionValue = tokenizer.nextToken();
69        
70 +      options_.setData(optionName, optionValue);
71        
73      
72      } else {
73        sprintf(painCave.errMsg, "OptionSectionParser Error: Not enough tokens at line %d\n",
74                lineNo);
# Line 79 | Line 77 | namespace oopse {
77      }
78      
79    }
82  
80  
81 +  void OptionSectionParser::validateSection() {
82 +    options_.validateOptions();
83 +  }
84 +
85   } //end namespace oopse  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines