Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
JAANET::String Struct Reference

General purpose string class. More...

#include <JHead.hh>

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

Public Member Functions

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

Public Attributes

std::string buffer
 General purpose name. More...
 

Friends

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

Detailed Description

General purpose string class.

Definition at line 122 of file JHead.hh.

Constructor & Destructor Documentation

JAANET::String::String ( )
inline

Default constructor.

Definition at line 126 of file JHead.hh.

126  :
127  buffer()
128  {}
std::string buffer
General purpose name.
Definition: JHead.hh:187

Member Function Documentation

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

Test match.

Parameters
objectstring
Returns
true if matches; else false

Definition at line 136 of file JHead.hh.

137  {
138  return !(*this).less(object) && !(object).less(*this);
139  }
bool less(const String &object) const
Comparison.
Definition: JHead.hh:147
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 147 of file JHead.hh.

148  {
149  using namespace std;
150 
151  istringstream i0(this ->buffer);
152  istringstream i1(object.buffer);
153 
154  vector<string> v0;
155  vector<string> v1;
156 
157  copy(istream_iterator<string>(i0), istream_iterator<string>(), back_inserter(v0));
158  copy(istream_iterator<string>(i1), istream_iterator<string>(), back_inserter(v1));
159 
160  return v0 < v1;
161  }
std::string buffer
General purpose name.
Definition: JHead.hh:187
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition: JHead.cc:139
JAANET::String::ClassDefNV ( String  ,
 
)

Friends And Related Function Documentation

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

Read string from input stream.

Parameters
ininput stream
objectstring
Returns
input stream

Definition at line 170 of file JHead.hh.

171  {
172  return std::getline(in, object.buffer);
173  }
std::string buffer
General purpose name.
Definition: JHead.hh:187
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
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 CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
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 182 of file JHead.hh.

183  {
184  return out << object.buffer;
185  }

Member Data Documentation

std::string JAANET::String::buffer

General purpose name.

Definition at line 187 of file JHead.hh.


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