Jpp
software
JLang
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
JLANG::JToken::operator>>
friend std::istream & operator>>(std::istream &in, JToken &token)
Read token from input.
Definition:
JToken.hh:51
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
JLANG::JToken
Wrapper class around string.
Definition:
JToken.hh:23
std
Definition:
jaanetDictionary.h:36
JLANG::JToken::JToken
JToken()
Default constructor.
Definition:
JToken.hh:30
JLANG::JToken::getSeparator
static char getSeparator()
Get separator.
Definition:
JToken.hh:38
JLANG
Auxiliary classes and methods for language specific functionality.
Definition:
JAbstractClass.hh:10
JLANG::getline
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition:
JString.hh:468
Generated by
1.8.16