Jpp
Classes | Functions
Head.hh File Reference
#include "Vec.hh"
#include "Exception.hh"
#include "TObject.h"
#include <string>
#include <sstream>
#include <iostream>
#include <map>
#include <algorithm>

Go to the source code of this file.

Classes

struct  Head
 The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred to as "tags") and values. More...
 

Functions

std::vector< std::string > splitstring (const std::string &str, char delim=' ')
 Split string into separate tokens. More...
 
std::ostream & operator<< (std::ostream &out, const Head &h)
 Print header. More...
 

Function Documentation

◆ splitstring()

std::vector<std::string> splitstring ( const std::string &  str,
char  delim = ' ' 
)
inline

Split string into separate tokens.

Parameters
strinput string
delimtoken delimiter
Returns
list of tokens

Definition at line 23 of file Head.hh.

24 {
25  using namespace std;
26 
28 
29  stringstream ss(str);
30  string token;
31  while (getline(ss, token, delim)) r.push_back(token);
32  return r;
33 }

◆ operator<<()

std::ostream& operator<< ( std::ostream &  out,
const Head h 
)
inline

Print header.

Parameters
outoutput stream
hheader
Returns
output stream

Definition at line 321 of file Head.hh.

322 {
323  h.print(out);
324  return out;
325 }
std::vector
Definition: JSTDTypes.hh:12
Head::print
void print(std::ostream &out=std::cout) const
Print header.
Definition: Head.hh:192
std
Definition: jaanetDictionary.h:36
JTOOLS::r
data_type r[M+1]
Definition: JPolint.hh:709
JLANG::getline
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:468