ATLAS Offline Software
ArrayScanner.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: ArrayScanner.cxx,v 1.1 2009-03-20 20:44:23 ssnyder Exp $
14 #include "CxxUtils/ArrayScanner.h"
15 
16 
17 namespace CxxUtils {
18 
19 
26 ArrayScanner::ArrayScanner (std::istream& is)
27  : m_is (is)
28 {
29 }
30 
31 
41 {
42  // Skip any opening quote marks.
43  at_char ('\'');
44  at_char ('"');
45 
46  return at_char ('[');
47 }
48 
49 
60 {
61  if (at_char (']')) {
62  at_char (',');
63 
64  // Skip any closing quote marks.
65  at_char ('\'');
66  at_char ('"');
67  return true;
68  }
69  return false;
70 }
71 
72 
82 {
83  std::istream::sentry s (m_is);
84  return !s;
85 }
86 
87 
98 {
99  std::istream::sentry s (m_is);
100  if (s && m_is.peek() == c) {
101  m_is.get();
102  return true;
103  }
104  return false;
105 }
106 
107 
117 {
118  bool stat = !m_is.fail();
119  m_is.clear();
120  at_char (',');
121  return stat;
122 }
123 
124 
125 } // namespace CxxUtils
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CxxUtils::ArrayScanner::at_open
bool at_open()
Read opening token.
Definition: ArrayScanner.cxx:40
CxxUtils::ArrayScanner::ArrayScanner
ArrayScanner(std::istream &is)
Constructor.
Definition: ArrayScanner.cxx:26
CxxUtils::ArrayScanner::at_num_common
bool at_num_common()
The non-template part of reading a number.
Definition: ArrayScanner.cxx:116
CxxUtils::ArrayScanner::at_char
bool at_char(char c)
Read a character.
Definition: ArrayScanner.cxx:97
CxxUtils::ArrayScanner::at_end
bool at_end()
Test for end-of-stream.
Definition: ArrayScanner.cxx:81
CxxUtils
Definition: aligned_vector.h:29
beamspotman.stat
stat
Definition: beamspotman.py:266
CxxUtils::ArrayScanner::m_is
std::istream & m_is
The stream from which we're reading.
Definition: ArrayScanner.h:120
CxxUtils::ArrayScanner::at_close
bool at_close()
Read closing token.
Definition: ArrayScanner.cxx:59
python.compressB64.c
def c
Definition: compressB64.py:93
ArrayScanner.h
Helper class for converting strings to Array's.