Jpp
Public Member Functions | Static Public Member Functions | Friends | List of all members
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. More...
 

Static Public Member Functions

static char getSeparator ()
 Get separator. More...
 

Friends

std::istream & operator>> (std::istream &in, JToken &token)
 Read token from input. More...
 

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 23 of file JToken.hh.

Constructor & Destructor Documentation

◆ JToken()

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

Default constructor.

Definition at line 30 of file JToken.hh.

30  :
31  std::string()
32  {}

Member Function Documentation

◆ getSeparator()

template<char sep>
static char JLANG::JToken< sep >::getSeparator ( )
inlinestatic

Get separator.

Definition at line 38 of file JToken.hh.

39  {
40  return sep;
41  }

Friends And Related Function Documentation

◆ operator>>

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

Read token from input.

Parameters
ininput stream
tokentoken
Returns
input stream

Definition at line 51 of file JToken.hh.

52  {
53  token.clear();
54 
55  return getline(in, token, sep);
56  }

The documentation for this class was generated from the following file:
JLANG::getline
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:468