CMS 3D CMS Logo

IgModuleCache.cc File Reference

#include "Iguana/Framework/interface/IgModuleCache.h"
#include "Iguana/Framework/interface/IgModuleDescriptor.h"
#include "Iguana/Framework/interface/IgModule.h"
#include "Iguana/Framework/interface/IgPluginManager.h"
#include "Iguana/Framework/interface/IgPluginError.h"
#include "IgPluginParserError.h"
#include "debug.h"
#include "classlib/utils/DebugAids.h"
#include "classlib/utils/Log.h"
#include "classlib/iobase/DirIterator.h"
#include "classlib/utils/SharedLibrary.h"
#include "classlib/utils/StringFormat.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cerrno>
#include <sys/stat.h>
#include <sstream>
#include <vector>
#include <string>

Go to the source code of this file.

Classes

class  IgModuleCache::FileByName

Functions

static std::string decode (const std::string &input)
 Decode registry string input.
static std::string encode (const std::string &input)
 Encode string input for registry.

Variables

static const char HEX [] = { "0123456789abcdef" }
static const char SAFE []


Function Documentation

static std::string decode ( const std::string &  input  )  [static]

Decode registry string input.

Replaces all occurances of "%XX" with the character of interpreting the hex value "XX", and at the same time checks only safe characters are used in input.

Definition at line 77 of file IgModuleCache.cc.

References HEX, HLT_VtxMuL3::result, s, and SAFE.

Referenced by edm::Entry::getBool(), edm::Entry::getDouble(), edm::Entry::getEventID(), edm::Entry::getFileInPath(), edm::Entry::getInputTag(), edm::Entry::getInt32(), edm::Entry::getInt64(), edm::Entry::getLuminosityBlockID(), edm::Entry::getPSet(), edm::Entry::getString(), edm::Entry::getUInt32(), edm::Entry::getUInt64(), edm::Entry::getVDouble(), edm::Entry::getVEventID(), edm::Entry::getVInputTag(), edm::Entry::getVInt32(), edm::Entry::getVInt64(), edm::Entry::getVLuminosityBlockID(), edm::Entry::getVPSet(), edm::Entry::getVString(), edm::Entry::getVUInt32(), edm::Entry::getVUInt64(), IgModuleCache::parse(), cond::XMLAuthenticationService::XMLAuthenticationService::processFile(), cond::DecodingKey::readFromString(), and edm::Entry::validate().

00078 {
00079     std::string result;
00080     result.reserve (input.size ());
00081     for (const char *s = input.c_str (); *s; ++s)
00082         if (strchr (SAFE, *s))
00083             result += *s;
00084         else if (*s == '%' && isxdigit (s[1]) && isxdigit (s[2]))
00085         {
00086             result += (char) (((strchr (HEX, tolower (s[1])) - HEX) << 4)
00087                               + ((strchr (HEX, tolower (s[2])) - HEX)));
00088             s += 2;
00089         }
00090         else
00091             throw IgPluginError (new IgPluginParserError ("bad character"));
00092 
00093     return result;
00094 }

static std::string encode ( const std::string &  input  )  [static]

Encode string input for registry.

Replaces all unsafe characters with "%XX" where "XX" is the hex of the character numeric value.

Definition at line 57 of file IgModuleCache.cc.

References HEX, HLT_VtxMuL3::result, s, and SAFE.

Referenced by trigger::TriggerEvent::addCollections(), HLTMuonRate::BookHistograms(), cond::DecodingKey::createFile(), EgammaHLTOffline::obtainFiltersElePasses(), EgammaHLTOffline::setFiltersElePasses(), edm::Entry::sizeOfStringOfTracked(), and IgModuleCache::write().

00058 {
00059     std::string result;
00060     result.reserve (input.size ());
00061     for (const char *s = input.c_str (); *s; ++s)
00062         if (strchr (SAFE, *s))
00063             result += *s;
00064         else
00065         {
00066             result += '%';
00067             result += HEX [((unsigned char) *s >> 4) & 0xf];
00068             result += HEX [((unsigned char) *s     ) & 0xf];
00069         }
00070     return result;
00071 }


Variable Documentation

const char HEX[] = { "0123456789abcdef" } [static]

Definition at line 32 of file IgModuleCache.cc.

Referenced by decode(), encode(), and edm::encode().

const char SAFE[] [static]

Initial value:

 { "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                              "abcdefghijklmnopqrstuvwxyz"
                              "01234567890.,/_-" }

Definition at line 29 of file IgModuleCache.cc.

Referenced by decode(), and encode().


Generated on Tue Jun 9 17:54:07 2009 for CMSSW by  doxygen 1.5.4