casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringTokenizer.h
Go to the documentation of this file.
1 /*
2  * ALMA - Atacama Large Millimeter Array
3  * (c) European Southern Observatory, 2002
4  * (c) Associated Universities Inc., 2002
5  * Copyright by ESO (in the framework of the ALMA collaboration),
6  * Copyright by AUI (in the framework of the ALMA collaboration),
7  * All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY, without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22  * MA 02111-1307 USA
23  *
24  * File StringTokenizer.h
25  */
26 # ifndef StringTokenizer_CLASS
27 # define StringTokenizer_CLASS
28 
31 
32 #include <string>
33 
34 namespace asdm {
35 
42 
43 public:
44 
45  StringTokenizer(const std::string &s,
46  const std::string &delim = " \t\n\r\f",
47  bool returnDelims = false)
49  virtual ~StringTokenizer();
50 
51  bool hasMoreTokens();
52  std::string nextToken() throw (OutOfBoundsException);
53  std::string nextToken(const std::string delim) throw (OutOfBoundsException);
54  int countTokens();
55 
56 private:
57 
61  char *str;
62  std::string *ostr;
63  std::string strDelimiter;
64  const char *delimiter;
66  bool retDelims;
68 
70 
72  int skipDelimiters(int startPos) throw (InvalidArgumentException);
73  int scanToken(int startPos);
74  int indexOfDelimiters(char c);
75 
76 };
77 
78 } // End namespace asdm
79 
80 #endif /* StringTokenizer_CLASS */
The StringTokenizer class is a translation into C++ of the Java class of the same name in Java&#39;s util...
StringTokenizer(const std::string &s, const std::string &delim=" \t\n\r\f", bool returnDelims=false)
int scanToken(int startPos)
int indexOfDelimiters(char c)
virtual ~StringTokenizer()
int skipDelimiters(int startPos)
The OutOfBoundsException class represents an exception when an attempt is made to access something ou...
The InvalidArgumentException class represents an exception when an attempt is made to access somethin...
const Double c
Fundamental physical constants (SI units):
std::string nextToken()