Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JToken< sep > Class Template Reference

Wrapper class around string. More...

#include <JToken.hh>

Inheritance diagram for JLANG::JToken< sep >:

Public Member Functions

 JToken ()
 Default constructor.
 

Static Public Attributes

static const char SEPARATOR = sep
 Separator.
 

Friends

std::istream & operator>> (std::istream &in, JToken &token)
 Read token from input stream.
 
std::ostream & operator<< (std::ostream &out, const JToken &token)
 Write token to output stream.
 

Detailed Description

template<char sep>
class JLANG::JToken< sep >

Wrapper class around string.

The redirect operator istream::operator>>() will read until given template character instead of the standard white space.

Definition at line 24 of file JToken.hh.

Constructor & Destructor Documentation

◆ JToken()

template<char sep>
JLANG::JToken< sep >::JToken ( )
inline

Default constructor.

Definition at line 37 of file JToken.hh.

37 :
38 std::string()
39 {}

Friends And Related Symbol Documentation

◆ operator>>

template<char sep>
std::istream & operator>> ( std::istream & in,
JToken< sep > & token )
friend

Read token from input stream.

Parameters
ininput stream
tokentoken
Returns
input stream

Definition at line 49 of file JToken.hh.

50 {
51 token.clear();
52
53 return getline(in, token, SEPARATOR);
54 }
static const char SEPARATOR
Separator.
Definition JToken.hh:31
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition JString.hh:478

◆ operator<<

template<char sep>
std::ostream & operator<< ( std::ostream & out,
const JToken< sep > & token )
friend

Write token to output stream.

Parameters
outoutput stream
tokentoken
Returns
output stream

Definition at line 64 of file JToken.hh.

65 {
66 return out << static_cast<const std::string&>(token) << SEPARATOR;
67 }

Member Data Documentation

◆ SEPARATOR

template<char sep>
const char JLANG::JToken< sep >::SEPARATOR = sep
static

Separator.

Definition at line 31 of file JToken.hh.


The documentation for this class was generated from the following file: