CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions
L1MuGMTLUTHelpers Class Reference

#include <L1MuGMTLUTHelpers.h>

Classes

class  Tokenizer
 Lookup Functions. More...
 

Public Member Functions

 L1MuGMTLUTHelpers ()
 constructor More...
 
virtual ~L1MuGMTLUTHelpers ()
 destructor More...
 

Static Public Member Functions

static std::string lowerCase (const std::string &s)
 
static int replace (std::string &input, const std::string &gone, const std::string &it, bool multiple)
 
static std::string upperCase (const std::string &s)
 

Detailed Description

Description: Helper Functions for std::string handling in L1MuGMTLUT (could be found in Cobra but classes should be independet of COBRA/ORCA)

Definition at line 37 of file L1MuGMTLUTHelpers.h.

Constructor & Destructor Documentation

L1MuGMTLUTHelpers::L1MuGMTLUTHelpers ( )
inline

constructor

Definition at line 41 of file L1MuGMTLUTHelpers.h.

41 {};
virtual L1MuGMTLUTHelpers::~L1MuGMTLUTHelpers ( )
inlinevirtual

destructor

Definition at line 44 of file L1MuGMTLUTHelpers.h.

44 {};

Member Function Documentation

string L1MuGMTLUTHelpers::lowerCase ( const std::string &  s)
static

Definition at line 60 of file L1MuGMTLUTHelpers.cc.

References i, and alignCSCRings::r.

60  {
61  char* buf = new char[s.length()];
62  s.copy(buf, s.length());
63  for(unsigned i = 0; i < s.length(); i++)
64  buf[i] = tolower(buf[i]);
65  string r(buf, s.length());
66  delete buf;
67  return r;
68 }
int i
Definition: DBlmapReader.cc:9
int L1MuGMTLUTHelpers::replace ( std::string &  input,
const std::string &  gone,
const std::string &  it,
bool  multiple 
)
static

Definition at line 31 of file L1MuGMTLUTHelpers.cc.

References i, and n.

Referenced by L1MuGMTLUT::Load(), and L1MuGMTLUT::MakeSubClass().

31  {
32  int n=0;
33  size_t i = input.find(gone,0);
34  while(i!=string::npos) {
35  n++;
36  input.replace(i,gone.size(),it);
37  i = input.find(gone,i+(multiple ? 0 : it.size()));
38  }
39  return n;
40 }
int i
Definition: DBlmapReader.cc:9
string L1MuGMTLUTHelpers::upperCase ( const std::string &  s)
static

Definition at line 45 of file L1MuGMTLUTHelpers.cc.

References i, and alignCSCRings::r.

Referenced by L1MuGMTLUT::MakeSubClass().

45  {
46  char* buf = new char[s.length()];
47  s.copy(buf, s.length());
48  for(unsigned i = 0; i < s.length(); i++)
49  buf[i] = toupper(buf[i]);
50  string r(buf, s.length());
51  delete buf;
52  return r;
53 }
int i
Definition: DBlmapReader.cc:9