CMS 3D CMS Logo

Classes | Functions

CMSSW_4_4_3_patch1/src/Utilities/General/interface/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.

Referenced by CSCCLCTData::add(), Chamber_AutoCorrMat::add(), CSCDigiToRaw::add(), CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), PreshowerHitMaker::addHit(), MuonCSCChamberResidual::addResidual(), L1RPCConeBuilder::TCompressedCon::addStrip(), PedestalsAlgorithm::analyse(), PedsOnlyAlgorithm::analyse(), NoiseAlgorithm::analyse(), CalibrationAlgorithm::analyse(), EcalTestPulseAnalyzer::analyze(), CSCComparatorDigiValidation::analyze(), SiStripThresholdBuilder::analyze(), EcalABAnalyzer::analyze(), EcalLaserAnalyzer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), SiStripBaselineValidator::analyze(), SiStripPedestalsReader::analyze(), ESOccupancyTask::analyze(), EcalLaserAnalyzer2::analyze(), HitEff::analyze(), SiStripNoisesBuilder::analyze(), SiStripNoisesReader::analyze(), ESTrendTask::analyze(), SiStripPedestalsBuilder::analyze(), EcalPreshowerRecHitsValidation::analyze(), SiStripBaselineAnalyzer::analyze(), CSCDigiToPattern::analyze(), ESPedestalTask::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(), CSCTMBHeader2007_rev0x50c3::CLCTDigis(), CSCTMBHeader2007::CLCTDigis(), CSCTMBHeader2006::CLCTDigis(), SiStripAPVRestorer::Cleaner_LocalMinimumAdder(), OldThreeThresholdAlgorithm::clusterizeDetUnit_(), SiStripMeanCMExtractor::CMExtractorFromPedestals(), CSCCLCTData::comparatorDigis(), CSCTMBHeader2007::CorrelatedLCTDigis(), CSCTMBHeader2006::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(), CSCCathodeLCTProcessor::dumpDigis(), EcalDCCTB07UnpackingModule::EcalDCCTB07UnpackingModule(), TowerBlockFormatter::EndEvent(), SiStripBadAPVAlgorithmFromClusterOccupancy::extractBadAPVs(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::extractBadAPVSandStrips(), SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips(), LatencyTask::fill(), FineDelayTask::fill(), sistrip::FEDBufferPayloadCreator::fillClusterData(), RPCOccupancyTest::fillGlobalME(), popcon::SiStripPopConHandlerUnitTestNoise< T >::fillObject(), popcon::SiStripPopConHandlerUnitTest< T >::fillObject(), LaserAlignment::fillPedestalProfiles(), SiStripFedZeroSuppression::fillThresholds_(), CSCHitFromStripOnly::findHitOnStripPosition(), CSCCathodeLCTProcessor::findLCTs(), LASPeakFinder::FindPeakIn(), EndcapPiZeroDiscriminatorAlgo::findPi0Road(), PreshowerClusterAlgo::findRoad(), GlobalTrajectoryBuilderBase::fixTEC(), SiStripZeroSuppression::formatRawDigis(), RPCLogCone::getCompressedCone(), EcalElectronicsMapping::getDetId(), EcalElectronicsMapping::getElectronicsId(), CSCCathodeLCTProcessor::getKeyStripData(), popcon::EcalTPGWeightGroupHandler::getNewObjects(), popcon::EcalTPGSlidingWindowHandler::getNewObjects(), popcon::EcalTPGFineGrainStripEEHandler::getNewObjects(), SiStripNoises::getNoise(), SiStripPedestals::getPed(), EcalElectronicsMapping::getTriggerElectronicsId(), EcalPreshowerNumberingScheme::getUnitID(), ESTBNumberingScheme::getUnitID(), CSCValidation::getWidth(), Numbers::icEE(), EcalPreshowerTopology::incrementIx(), EcalPreshowerTopology::incrementIy(), EcalPreshowerTopology::incrementIz(), SiTrivialInduceChargeOnStrips::induce(), HcalText2DetIdConverter::init(), CastorText2DetIdConverter::init(), EcalTB07DaqFormatter::interpretRawData(), EcalTBDaqFormatter::interpretRawData(), TrajectoryAtInvalidHit::isDoubleSided(), HitEff::isDoubleSided(), LASProfileJudge::IsNegativePeaksInProfile(), LASProfileJudge::IsOverdrive(), LASProfileJudge::IsPeaksInProfile(), StripCPEgeometric::localParameters(), StripCPE::localParameters(), StripCPEfromTrackAngle::localParameters(), CSCSectorReceiverLUT::localPhi(), SiStripHashedDetIdESModule::make(), PFCandidateStripMerger::mergeCandidates(), SiStripZeroSuppression::MergeCollectionsZeroSuppression(), SiStripQuality::nBadStripsOnTheRight(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), SiStripNoises::operator/(), operator<<(), CSCCathodeLCTProcessor::preTrigger(), SiStripPedestals::printDebug(), CSCCathodeLCTProcessor::printPatterns(), ShallowRechitClustersProducer::produce(), SiStripHashedDetIdESProducer::produce(), CSCTFUnpacker::produce(), ClusterShapeHitFilterESProducer::produce(), ShallowTrackClustersProducer::produce(), ShallowSimhitClustersProducer::produce(), EcalTrivialConditionRetriever::produceEcalAlignmentES(), Strip1DMeasurementTransformator::projectionMatrix(), StripMeasurementTransformator::projectionMatrix(), CSCDigiValidator::relabelCompDigis(), CSCDigiValidator::relabelStripDigis(), EcalElectronicsMapper::resetPointers(), RPCLogCone::RPCLogCone(), CSCStripElectronicsSim::runComparator(), RPCPac::runEnergeticPatternsGroups(), CSCComparatorDigi::setStrip(), SiStripCondObjBuilderFromDb::setValuesCabling(), jptJetAnalysis::StripSignalOverNoiseCalculator::signalOverNoise(), RPCSimTriv::simulateNoise(), RPCSimAverage::simulateNoise(), RPCSimSimple::simulateNoise(), RPCSimParam::simulateNoise(), SiStripZeroSuppression::storeBaseline(), FastLinearCMNSubtractor::subtract_(), PercentileCMNSubtractor::subtract_(), MedianCMNSubtractor::subtract_(), SiStripFedZeroSuppression::suppress(), CSCMotherboard::testLCT(), CSCCathodeLCTProcessor::testPatterns(), TrajectoryAtInvalidHit::TrajectoryAtInvalidHit(), ZeroSuppressFP420::trkFEDclusterizer(), ValidateGeometry::validateRPCGeometry(), ValidateGeometry::validateStripTopology(), ESUnpacker::word2digi(), and Chamber_AutoCorrMat::zero().

                                                       {
  size_t b = input.find_first_not_of(blanks);
  if (b==std::string::npos) { input.clear(); return;}
  size_t e = input.find_last_not_of(blanks);
  input = input.substr(b,e-b+1);
}