Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JToken.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JTOKEN__
2 #define __JLANG__JTOKEN__
3 
4 #include <string>
5 
6 
7 /**
8  * \author mdejong
9  */
10 
11 namespace JLANG {}
12 namespace JPP { using namespace JLANG; }
13 
14 namespace JLANG {
15 
16  /**
17  * Wrapper class around string.
18  *
19  * The redirect operator <tt>istream::operator>>()</tt> will read until given template character
20  * instead of the standard white space.
21  */
22  template<char sep>
23  class JToken :
24  public std::string
25  {
26  public:
27  /**
28  * Default constructor.
29  */
30  JToken() :
31  std::string()
32  {}
33 
34 
35  /**
36  * Get separator.
37  */
38  static char getSeparator()
39  {
40  return sep;
41  }
42 
43 
44  /**
45  * Read token from input.
46  *
47  * \param in input stream
48  * \param token token
49  * \return input stream
50  */
51  friend inline std::istream& operator>>(std::istream& in, JToken& token)
52  {
53  token.clear();
54 
55  return getline(in, token, sep);
56  }
57  };
58 }
59 
60 #endif
static char getSeparator()
Get separator.
Definition: JToken.hh:38
JToken()
Default constructor.
Definition: JToken.hh:30
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
Wrapper class around string.
Definition: JToken.hh:23
friend std::istream & operator>>(std::istream &in, JToken &token)
Read token from input.
Definition: JToken.hh:51
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36