ATLAS Offline Software
Loading...
Searching...
No Matches
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 $
12
13
15
16
17namespace CxxUtils {
18
19
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
Helper class for converting strings to Array's.
bool at_char(char c)
Read a character.
bool at_close()
Read closing token.
bool at_num_common()
The non-template part of reading a number.
bool at_open()
Read opening token.
std::istream & m_is
The stream from which we're reading.
ArrayScanner(std::istream &is)
Constructor.
bool at_end()
Test for end-of-stream.