From 93b71cdc3fc329629e7757b3819565331a851f90 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 2 Jan 2009 21:23:49 +0000 Subject: [PATCH] Got rid of the function getStrings(). It wasn't used anywhere. --- Cantera/src/base/ctml.cpp | 60 ++++++++++++++++----------------------- Cantera/src/base/ctml.h | 3 +- 2 files changed, 25 insertions(+), 38 deletions(-) diff --git a/Cantera/src/base/ctml.cpp b/Cantera/src/base/ctml.cpp index 5db74519a..83629c6ba 100755 --- a/Cantera/src/base/ctml.cpp +++ b/Cantera/src/base/ctml.cpp @@ -1,7 +1,6 @@ /** * @file ctml.cpp - * - * Functions to read and write CTML. + * Definitions for functions to read and write CTML. * */ @@ -70,25 +69,25 @@ namespace ctml { if (maxval != Undef) f.addAttribute("max",maxval); } - void addFloat(XML_Node& node, - string title, - doublereal val, - string units, - string type, - doublereal minval, - doublereal maxval) { - string fmt = "%17.9E"; + void addFloat(XML_Node& node, + string title, + doublereal val, + string units, + string type, + doublereal minval, + doublereal maxval) { + string fmt = "%17.9E"; #ifdef CTML_VERSION_1_4 - XML_Node& f = node.addChild("float",val,fmt); - f.addAttribute("title",title); + XML_Node& f = node.addChild("float",val,fmt); + f.addAttribute("title",title); #else - XML_Node& f = node.addChild(title,val,fmt); + XML_Node& f = node.addChild(title,val,fmt); #endif - if (type != "") f.addAttribute("type",type); - if (units != "") f.addAttribute("units",units); - if (minval != Undef) f.addAttribute("min",minval); - if (maxval != Undef) f.addAttribute("max",maxval); - } + if (type != "") f.addAttribute("type",type); + if (units != "") f.addAttribute("units",units); + if (minval != Undef) f.addAttribute("min",minval); + if (maxval != Undef) f.addAttribute("max",maxval); + } /** * Add a floatArray XML type to the xml file. @@ -121,12 +120,12 @@ namespace ctml { if (maxval != Undef) f.addAttribute("max",maxval); } - void addString(XML_Node& node, string title, string val, - string type) { - XML_Node& f = node.addChild("string",val); - f.addAttribute("title",title); - if (type != "") f.addAttribute("type",type); - } + void addString(XML_Node& node, string title, string val, + string type) { + XML_Node& f = node.addChild("string",val); + f.addAttribute("title",title); + if (type != "") f.addAttribute("type",type); + } XML_Node* getByTitle(XML_Node& node, string title) { XML_Node* s = node.findByAttr("title",title); @@ -174,18 +173,7 @@ namespace ctml { } - void getStrings(const XML_Node& node, map& v) { - vector f; - node.getChildren("string",f); - int n = static_cast(f.size()); - string typ, title; - for (int i = 0; i < n; i++) { - const XML_Node& fi = *(f[i]); - title = fi["title"]; - v[title] = fi(); - } - } - + void getFloats(const XML_Node& node, map& v, bool convert) { vector f; diff --git a/Cantera/src/base/ctml.h b/Cantera/src/base/ctml.h index fa82accf1..1bd5d5c6a 100755 --- a/Cantera/src/base/ctml.h +++ b/Cantera/src/base/ctml.h @@ -216,8 +216,7 @@ namespace ctml { */ int getInteger(const Cantera::XML_Node& parent, std::string name); - void getStrings(const Cantera::XML_Node& node, std::map& v); + void getFunction(const Cantera::XML_Node& node, std::string& type, doublereal& xmin, doublereal& xmax, Cantera::vector_fp& coeffs); Cantera::XML_Node* getByTitle(Cantera::XML_Node& node, std::string title);