ATLAS Offline Software
Functions
Identifier Namespace Reference

Functions

bool isDigit (const char c)
 
IdentifierField::element_type parseStreamDigits (std::istream &is)
 
IdentifierField::element_vector parseStreamList (std::istream &is)
 
IdentifierField::element_vector parseTextList (std::string &text)
 

Function Documentation

◆ isDigit()

bool Identifier::isDigit ( const char  c)

Definition at line 16 of file IdentifierFieldParser.cxx.

16  {
17  return std::isdigit(c) or c=='-' or c=='+';
18  }

◆ parseStreamDigits()

IdentifierField::element_type Identifier::parseStreamDigits ( std::istream &  is)

Definition at line 21 of file IdentifierFieldParser.cxx.

21  {
22  static constexpr std::errc ok{};
23  char buffer[20]{};
24  int i{};
26  for(int c{};isDigit(is.peek()) and i<20;++i ){
27  if (c == '+') is.ignore();
28  c=is.get();
29  buffer[i] = c;
30  }
31  const auto [ptr,ec] = std::from_chars(buffer, buffer+i, v);
32  if (ec != ok) throw std::invalid_argument("Invalid argument in parseStreamDigits");
33  return v;
34  }

◆ parseStreamList()

IdentifierField::element_vector Identifier::parseStreamList ( std::istream &  is)

Definition at line 37 of file IdentifierFieldParser.cxx.

37  {
39  for (int c{};(not is.eof());c=is.peek()){
40  while (std::isspace(is.peek())){is.ignore();}
41  if (isDigit(c)){
42  if (c =='+') is.ignore();
43  int v = parseStreamDigits(is);
44  result.push_back(v);
45  } else if (c == ','){
46  is.ignore();
47  } else if (c == '/' ){
48  break;
49  }
50  }
51  return result;
52  }

◆ parseTextList()

IdentifierField::element_vector Identifier::parseTextList ( std::string &  text)
get_generator_info.result
result
Definition: get_generator_info.py:21
IdentifierField::element_type
ExpandedIdentifier::element_type element_type
Definition: IdentifierField.h:23
Identifier::parseStreamDigits
IdentifierField::element_type parseStreamDigits(std::istream &is)
Definition: IdentifierFieldParser.cxx:21
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
Identifier::isDigit
bool isDigit(const char c)
Definition: IdentifierFieldParser.cxx:16
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdentifierField::element_vector
std::vector< element_type > element_vector
Definition: IdentifierField.h:25
python.PyAthena.v
v
Definition: PyAthena.py:154
python.compressB64.c
def c
Definition: compressB64.py:93