Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::String Struct Reference

General purpose string class. More...

#include <JHead.hh>

Inheritance diagram for JAANET::String:
JAANET::XSecFile JAANET::calibration JAANET::drawing JAANET::muon_desc_file JAANET::physics JAANET::target

Public Member Functions

 String ()
 Default constructor.
 
bool match (const String &object) const
 Test match.
 
bool less (const String &object) const
 Comparison.
 
 ClassDefNV (String, 1)
 

Public Attributes

std::string buffer
 General purpose name.
 

Friends

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

Detailed Description

General purpose string class.

Definition at line 152 of file JHead.hh.

Constructor & Destructor Documentation

◆ String()

JAANET::String::String ( )
inline

Default constructor.

Definition at line 156 of file JHead.hh.

156 :
157 buffer()
158 {}
std::string buffer
General purpose name.
Definition JHead.hh:217

Member Function Documentation

◆ match()

bool JAANET::String::match ( const String & object) const
inline

Test match.

Parameters
objectstring
Returns
true if matches; else false

Definition at line 166 of file JHead.hh.

167 {
168 return !(*this).less(object) && !(object).less(*this);
169 }
bool less(const String &object) const
Comparison.
Definition JHead.hh:177

◆ less()

bool JAANET::String::less ( const String & object) const
inline

Comparison.

Parameters
objectstring
Returns
true if this string less than given string; else false

Definition at line 177 of file JHead.hh.

178 {
179 using namespace std;
180
181 istringstream i0(this ->buffer);
182 istringstream i1(object.buffer);
183
186
187 copy(istream_iterator<string>(i0), istream_iterator<string>(), back_inserter(v0));
188 copy(istream_iterator<string>(i1), istream_iterator<string>(), back_inserter(v1));
189
190 return v0 < v1;
191 }
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition JHead.cc:163

◆ ClassDefNV()

JAANET::String::ClassDefNV ( String ,
1  )

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
String & object )
friend

Read string from input stream.

Parameters
ininput stream
objectstring
Returns
input stream

Definition at line 200 of file JHead.hh.

201 {
202 return std::getline(in, object.buffer);
203 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const String & object )
friend

Write string to output stream.

Parameters
outoutput stream
objectstring
Returns
output stream

Definition at line 212 of file JHead.hh.

213 {
214 return out << object.buffer;
215 }

Member Data Documentation

◆ buffer

std::string JAANET::String::buffer

General purpose name.

Definition at line 217 of file JHead.hh.


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