CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
stringTools.h File Reference
#include <string>

Go to the source code of this file.

Classes

class  stringUpdate
 

Functions

int replace (std::string &input, const std::string &gone, const std::string &it, bool multiple=false)
 
int replaceRange (std::string &input, const std::string &first, const std::string &last, const std::string &it, bool multiple=false)
 
void strip (std::string &input, const std::string &blanks=" \n\t")
 

Function Documentation

int replace ( std::string &  input,
const std::string &  gone,
const std::string &  it,
bool  multiple = false 
)
replace "gone" with "it" in "input"

if multiple=true reconsider the string after each replacement

int replaceRange ( std::string &  input,
const std::string &  first,
const std::string &  last,
const std::string &  it,
bool  multiple = false 
)
replace everything between "first" and "last" with "it" in "input" 

if multiple=true reconsider the string after each replacement

void strip ( std::string &  input,
const std::string &  blanks = " \n\t" 
)

Definition at line 16 of file stringTools.cc.

References b, and alignCSCRings::e.

Referenced by alignment.Alignment::__getConditions(), validateAlignments.ValidationJob::__getValidation(), argparse.HelpFormatter::_fill_text(), python.rootplot.argparse.HelpFormatter::_fill_text(), cmstc.TagCollector::_open(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor::_property(), extend_argparse.HelpFormatterRespectNewlines::_split_lines(), argparse.HelpFormatter::_split_lines(), python.rootplot.argparse.HelpFormatter::_split_lines(), CSCCLCTData::add(), CSCDigiToRaw::add(), Chamber_AutoCorrMat::add(), argparse.ArgumentParser::add_subparsers(), python.rootplot.argparse.ArgumentParser::add_subparsers(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT1(), CSCTMBHeader2007::addCLCT1(), PreshowerHitMaker::addHit(), MuonCSCChamberResidual::addResidual(), L1RPCConeBuilder::TCompressedCon::addStrip(), CalibrationAlgorithm::analyse(), NoiseAlgorithm::analyse(), PedestalsAlgorithm::analyse(), PedsOnlyAlgorithm::analyse(), CSCComparatorDigiValidation::analyze(), CSCDigiToPattern::analyze(), ESPedestalTask::analyze(), SiStripNoisesBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripNoisesReader::analyze(), SiStripPedestalsReader::analyze(), EcalABAnalyzer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), SiStripBaselineValidator::analyze(), EcalTestPulseAnalyzer::analyze(), EcalPreshowerRecHitsValidation::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), SiStripBaselineAnalyzer::analyze(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::AnalyzeOccupancy(), ThreeThresholdAlgorithm::applyGains(), Chamber_AutoCorrMat::autocorrmat(), SiStripAPVRestorer::BaselineAndSaturationInspect(), SiStripAPVRestorer::BaselineFollowerInspect(), SiStripAPVRestorer::BaselineFollowerRestore(), FWRPCDigiProxyBuilder::build(), HPSPFRecoTauAlgorithm::buildOneProngStrip(), AlignableTracker::buildTRK(), CSCSectorReceiverLUT::calcGlobalPhiME(), CSCSectorReceiverMiniLUT::calcGlobalPhiMEMini(), CSCSectorReceiverMiniLUT::calcLocalPhiMini(), CSCPairResidualsConstraint::calculatePhi(), CalibrationScanTask::CalibrationScanTask(), CalibrationTask::CalibrationTask(), CSCChannelTranslator::channelFromStrip(), EcalElectronicsId::channelId(), HitEff::checkLayer(), CSCTMBHeader2006::CLCTDigis(), CSCTMBHeader2007::CLCTDigis(), CSCTMBHeader2007_rev0x50c3::CLCTDigis(), SiStripAPVRestorer::Cleaner_LocalMinimumAdder(), OldThreeThresholdAlgorithm::clusterizeDetUnit_(), SiStripMeanCMExtractor::CMExtractorFromPedestals(), CSCCLCTData::comparatorDigis(), CSCTMBHeader2006::CorrelatedLCTDigis(), CSCTMBHeader2007::CorrelatedLCTDigis(), CSCTMBHeader2007_rev0x50c3::CorrelatedLCTDigis(), SiStripAPVRestorer::CreateCMMapRealPed(), sistrip::DigiToRaw::createFedBuffers_(), SiStripThresholdGenerator::createObject(), EcalTBDaqFormatter::DecodeMEM(), EcalTB07DaqFormatter::DecodeMEM(), EcalPreshowerTopology::decrementIx(), EcalPreshowerTopology::decrementIy(), EcalPreshowerTopology::decrementIz(), EcalElectronicsMapper::deletePointers(), RPCReadOutMapping::detUnitFrame(), CSCCFEBData::digis(), SiStripCorrelateNoise::DoAnalysis(), CSCValidation::doCompTiming(), hitfit::Defaults_Textrep::doline(), Vispa.Main.Application.Application::doubleClickOnFile(), CSCCathodeLCTProcessor::dumpDigis(), SiStripApvShotCleaner::dumpInVector(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::dumpPython(), EcalDCCTB07UnpackingModule::EcalDCCTB07UnpackingModule(), python.XML2Python.TreeBuilder::endElement(), XML2Python.TreeBuilder::endElement(), TowerBlockFormatter::EndEvent(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::exportDot(), Vispa.Share.ImageExporter.ImageExporter::exportImage(), SiStripBadAPVAlgorithmFromClusterOccupancy::extractBadAPVs(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::extractBadAPVSandStrips(), SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips(), parserTimingReport::extractRSS_VSIZE(), checkforupdate.checkforupdate::fetchTagsHTTP(), LatencyTask::fill(), FineDelayTask::fill(), sistrip::FEDBufferPayloadCreator::fillClusterData(), RPCOccupancyTest::fillGlobalME(), popcon::SiStripPopConHandlerUnitTest< T >::fillObject(), popcon::SiStripPopConHandlerUnitTestNoise< T >::fillObject(), LaserAlignment::fillPedestalProfiles(), SiStripFedZeroSuppression::fillThresholds_(), CSCHitFromStripOnly::findHitOnStripPosition(), CSCCathodeLCTProcessor::findLCTs(), LASPeakFinder::FindPeakIn(), EndcapPiZeroDiscriminatorAlgo::findPi0Road(), PreshowerClusterAlgo::findRoad(), GlobalTrajectoryBuilderBase::fixTEC(), SiStripZeroSuppression::formatRawDigis(), utils_v2::get_version(), cmsPerfPublish::getcmd(), cmsPerfPublish::getcmdBasic(), RPCLogCone::getCompressedCone(), EcalElectronicsMapping::getDetId(), EcalElectronicsMapping::getElectronicsId(), EcalClusterLazyTools::getESHits(), CSCCathodeLCTProcessor::getKeyStripData(), parserPerfsuiteMetadata.parserPerfsuiteMetadata::getMachineInfo(), python.namespaceDict::getNamespaceDict(), popcon::EcalTPGWeightGroupHandler::getNewObjects(), popcon::EcalTPGSlidingWindowHandler::getNewObjects(), popcon::EcalTPGFineGrainStripEEHandler::getNewObjects(), SiStripNoises::getNoise(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::getObjectLabel(), SiStripPedestals::getPed(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::getShortLabel(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::getShortType(), EcalElectronicsMapping::getTriggerElectronicsId(), ESTBNumberingScheme::getUnitID(), EcalPreshowerNumberingScheme::getUnitID(), CSCValidation::getWidth(), Numbers::icEE(), EcalPreshowerTopology::incrementIx(), EcalPreshowerTopology::incrementIy(), EcalPreshowerTopology::incrementIz(), SiTrivialInduceChargeOnStrips::induce(), CastorText2DetIdConverter::init(), HcalText2DetIdConverter::init(), EcalTBDaqFormatter::interpretRawData(), EcalTB07DaqFormatter::interpretRawData(), TrajectoryAtInvalidHit::isDoubleSided(), HitEff::isDoubleSided(), LASProfileJudge::IsNegativePeaksInProfile(), LASProfileJudge::IsOverdrive(), LASProfileJudge::IsPeaksInProfile(), StripCPEfromTrackAngle::localParameters(), StripCPEgeometric::localParameters(), StripCPEfromTemplate::localParameters(), StripCPE::localParameters(), CSCSectorReceiverLUT::localPhi(), buildHistoTypes::main(), runall::main(), SiStripHashedDetIdESModule::make(), PFCandidateStripMerger::mergeCandidates(), SiStripZeroSuppression::MergeCollectionsZeroSuppression(), SiStripQuality::nBadStripsOnTheRight(), cmsCodeRulesChecker::omitLine(), Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin::openFile(), Vispa.Main.Application.Application::openFile(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), SiStripNoises::operator/(), operator<<(), cond::PayLoadInspector< DataT >::plot(), CSCCathodeLCTProcessor::preTrigger(), SiStripPedestals::printDebug(), CSCCathodeLCTProcessor::printPatterns(), ShallowRechitClustersProducer::produce(), ShallowTrackClustersProducer::produce(), ShallowSimhitClustersProducer::produce(), SiStripHashedDetIdESProducer::produce(), CSCTFUnpacker::produce(), ClusterShapeHitFilterESProducer::produce(), EcalTrivialConditionRetriever::produceEcalAlignmentES(), Strip1DMeasurementTransformator::projectionMatrix(), StripMeasurementTransformator::projectionMatrix(), FileNamesHelper::read_ConfigurationFromSimulationCandles(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::recursePSetProperties(), CSCDigiValidator::relabelCompDigis(), CSCDigiValidator::relabelStripDigis(), EcalElectronicsMapper::resetPointers(), RPCLogCone::RPCLogCone(), CSCStripElectronicsSim::runComparator(), RPCPac::runEnergeticPatternsGroups(), EdgesToViz::runme(), checkforupdate.checkforupdate::runningVersion(), inputFilesetParser.inputFilesetParser::runsWithresult(), Vispa.Main.Application.Application::saveFileAsDialog(), CSCComparatorDigi::setStrip(), SiStripCondObjBuilderFromDb::setValuesCabling(), jptJetAnalysis::StripSignalOverNoiseCalculator::signalOverNoise(), RPCSimSimple::simulateNoise(), RPCSimTriv::simulateNoise(), RPCSimParam::simulateNoise(), RPCSimAverage::simulateNoise(), SiStripZeroSuppression::storeBaseline(), MedianCMNSubtractor::subtract_(), FastLinearCMNSubtractor::subtract_(), PercentileCMNSubtractor::subtract_(), SiStripApvShotCleaner::subtractCM(), SiStripFedZeroSuppression::suppress(), CSCMotherboard::testLCT(), CSCCathodeLCTProcessor::testPatterns(), TrajectoryAtInvalidHit::TrajectoryAtInvalidHit(), ZeroSuppressFP420::trkFEDclusterizer(), Vispa.Main.TabController.TabController::updateLabel(), ValidateGeometry::validateRPCGeometry(), ValidateGeometry::validateStripTopology(), Vispa.Main.Application.Application::windowTitle(), ESUnpacker::word2digi(), and Chamber_AutoCorrMat::zero().

16  {
17  size_t b = input.find_first_not_of(blanks);
18  if (b==std::string::npos) { input.clear(); return;}
19  size_t e = input.find_last_not_of(blanks);
20  input = input.substr(b,e-b+1);
21 }
double b
Definition: hdecay.h:120