CMS 3D CMS Logo

Functions
XMLDocument.cc File Reference
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <memory>
#include <string>
#include <cstdio>
#include <ext/stdio_filebuf.h>
#include "FWCore/Concurrency/interface/Xerces.h"
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/BinInputStream.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMImplementationLS.hpp>
#include <xercesc/dom/DOMLSSerializer.hpp>
#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/sax/InputSource.hpp>
#include <xercesc/sax/HandlerBase.hpp>
#include "FWCore/Utilities/interface/Exception.h"
#include "PhysicsTools/MVATrainer/interface/XMLSimpleStr.h"
#include "PhysicsTools/MVATrainer/interface/XMLUniStr.h"
#include "PhysicsTools/MVATrainer/interface/XMLDocument.h"

Go to the source code of this file.

Functions

static bool isBool (std::string value)
 
static const char * makeBool (bool value)
 

Function Documentation

static bool isBool ( std::string  value)
static

Definition at line 283 of file XMLDocument.cc.

References Exception, and mps_fire::i.

Referenced by XMLDocument::readAttribute(), and XMLDocument::readContent().

284 {
285  for(unsigned int i = 0; i < value.size(); i++)
286  if (value[i] >= 'A' && value[i] <= 'Z')
287  value[i] += 'a' - 'A';
288 
289  if (value == "1" || value == "y" || value == "yes" ||
290  value == "true" || value == "ok")
291  return true;
292 
293  if (value == "0" || value == "n" || value == "no" || value == "false")
294  return false;
295 
296  throw cms::Exception("XMLDocument")
297  << "Invalid boolean value in XML document" << std::endl;
298 }
Definition: value.py:1
static const char* makeBool ( bool  value)
static

Definition at line 300 of file XMLDocument.cc.

Referenced by XMLDocument::writeAttribute(), and XMLDocument::writeContent().

301 {
302  return value ? "true" : "false";
303 }
Definition: value.py:1