CMS 3D CMS Logo

Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/PhysicsTools/MVATrainer/src/XMLDocument.cc File Reference

#include <assert.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <memory>
#include <string>
#include <cstdio>
#include <stdio.h>
#include <ext/stdio_filebuf.h>
#include <xercesc/util/PlatformUtils.hpp>
#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/DOMWriter.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 281 of file XMLDocument.cc.

References Exception, and i.

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

{
        for(unsigned int i = 0; i < value.size(); i++)
                if (value[i] >= 'A' && value[i] <= 'Z')
                        value[i] += 'a' - 'A';

        if (value == "1" || value == "y" || value == "yes" ||
            value == "true" || value == "ok")
                return true;

        if (value == "0" || value == "n" || value == "no" || value == "false")
                return false;

        throw cms::Exception("XMLDocument")
                << "Invalid boolean value in XML document" << std::endl;
}
static const char* makeBool ( bool  value) [static]

Definition at line 298 of file XMLDocument.cc.

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

{
        return value ? "true" : "false";
}