CMS 3D CMS Logo

TrivialFileCatalog.cc File Reference

#include <set>
#include <string>
#include <stdexcept>
#include "TrivialFileCatalog.h"
#include "POOLCore/PoolMessageStream.h"
#include "FileCatalog/FCException.h"
#include <xercesc/dom/DOM.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <SealBase/StringList.h>
#include <SealBase/StringOps.h>
#include <SealBase/DebugAids.h>
#include <SealBase/Regexp.h>

Go to the source code of this file.

Functions

XMLCh * _toDOMS (std::string temp)
std::string _toString (const XMLCh *toTranscode)
std::string replaceWithRegexp (const seal::RegexpMatch matches, const std::string inputString, const std::string outputFormat)


Function Documentation

XMLCh* _toDOMS ( std::string  temp  )  [inline]

Definition at line 38 of file TrivialFileCatalog.cc.

References transcode().

00038                                       {
00039     XMLCh* buff = XMLString::transcode(temp.c_str());    
00040     return  buff;
00041 }

std::string _toString ( const XMLCh *  toTranscode  )  [inline]

Definition at line 32 of file TrivialFileCatalog.cc.

References tmp, and transcode().

00033 {
00034     std::string tmp(XMLString::transcode(toTranscode));
00035     return tmp;
00036 }

std::string replaceWithRegexp ( const seal::RegexpMatch  matches,
const std::string  inputString,
const std::string  outputFormat 
)

Definition at line 352 of file TrivialFileCatalog.cc.

References ASSERT, i, and replace().

Referenced by pool::TrivialFileCatalog::applyRules().

00355 {
00356     //std::cerr << "InputString:" << inputString << std::endl;
00357     
00358     char buffer[8];
00359     std::string result = outputFormat;
00360         
00361     for (int i = 1;
00362          i < matches.numMatches ();
00363          i++)
00364     {
00365         // If this is not true, man, we are in trouble...
00366         ASSERT (i < 1000000);
00367         sprintf (buffer, "%i", i);
00368         std::string variableRegexp = std::string ("[$]") + buffer;
00369         std::string matchResult = matches.matchString (inputString, i);
00370         
00371         seal::Regexp sustitutionToken (variableRegexp);
00372         
00373         //std::cerr << "Current match: " << matchResult << std::endl;
00374         
00375         result = seal::StringOps::replace (result, 
00376                                            sustitutionToken, 
00377                                            matchResult);
00378     }
00379     return result;    
00380 }


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