ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/io/OptionSectionParser.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/io/OptionSectionParser.cpp (file contents):
Revision 2448 by tim, Wed Nov 16 23:10:02 2005 UTC vs.
Revision 2487 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.2 2005-11-16 23:10:02 tim Exp $
47 > *  @version $Id: OptionSectionParser.cpp,v 1.3 2005-12-05 22:23:57 gezelter Exp $
48   *
49   */
50  
# Line 55 | Line 55 | namespace oopse {
55   #include "utils/StringUtils.hpp"
56   namespace oopse {
57  
58  bool ForceFieldOptions::setData(const std::string& keyword, const std::string& value) {
59      bool result;
60      ParamMap::iterator i =parameters_.find(keyword);
61      if (i != parameters_.end()) {
62        if(isType<int>(value)){
63          int ival = lexi_cast<int>(value);
64          result = i->second->setData(ival);
65        }      
66        else if (isType<double>(value)){
67          double dval = lexi_cast<double>(value);
68          result = i->second->setData(dval);
69        } else{
70           result = i->second->setData(value);
71        }
72      } else {
73        sprintf(painCave.errMsg,  "%s is an unrecognized keyword\n", keyword.c_str() );
74          painCave.isFatal = 0;
75          simError();        
76      }
77
78      return result;
79  }
80
58    OptionSectionParser::OptionSectionParser(ForceFieldOptions& options) : options_(options) {
59      setSectionName("Options");        
60    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines