GEMC  2.3
Geant4 Monte-Carlo Framework
Functions
string_utilities.h File Reference
#include <QString>
#include <QVariant>
#include <vector>
#include <iostream>
#include <string>
#include <sstream>
+ Include dependency graph for string_utilities.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string stringify (double x)
 
string stringify (int x)
 
string qv_tostring (QVariant input)
 
string qs_tostring (QString input)
 
string replaceCharWithChars (string input, string x, string y)
 
string replaceCharsWithChars (string input, string x, string y)
 
vector< vector< string > > dimensionstype (string)
 Returns dimensions nomenclature for different solid type. More...
 
double get_number (string, int warn_no_unit=0)
 Returns number with dimension from string, i.e. 100*cm. More...
 
string TrimSpaces (string)
 Removes leading and trailing spaces. More...
 
vector< string > get_strings_except (string, string)
 returns a vector of strings from a stringstream, space is delimiter, ignore string with second argument More...
 
vector< string > get_strings (string)
 returns a vector of strings from a stringstream, space is delimiter More...
 
vector< string > get_strings (string, string)
 returns a vector of strings from a stringstream, second string is delimiter More...
 
void print_vstring (vector< string >)
 prints each element of a string vector More...
 
vector< string > get_info (string)
 get information from strings such as "5*GeV, 2*deg, 10*deg", parses out parenthesis, commas, quotes More...
 
vector< string > get_info (string, string)
 get information from strings such as "5*GeV, 2*deg, 10*deg", parses out strings in second argument More...
 
string get_variation (string)
 parse variation name from string More...
 
bool is_main_variation (string)
 returns 1 if the string "main:" is found on the input More...
 
ostream & operator<< (ostream &stream, map< string, string >)
 overload << for map<string, string> More...
 
double get_number (QVariant input)
 
double stringToDouble (string v)
 
double qs_toDouble (QString input)
 

Detailed Description

Set of string manipulation functions:

Author

Maurizio Ungaro
mail: ungar.nosp@m.o@jl.nosp@m.ab.or.nosp@m.g


Definition in file string_utilities.h.

Function Documentation

vector< vector<string> > dimensionstype ( string  )

Definition at line 922 of file detector.cc.

vector<string> get_info ( string  )

Definition at line 20 of file string_utilities.cc.

vector<string> get_info ( string  ,
string   
)

Definition at line 13 of file string_utilities.cc.

double get_number ( string  ,
int  warn_no_unit = 0 
)

Definition at line 134 of file string_utilities.cc.

double get_number ( QVariant  input)
inline

Definition at line 151 of file string_utilities.h.

vector<string> get_strings ( string  )

Definition at line 50 of file string_utilities.cc.

vector<string> get_strings ( string  ,
string   
)

Definition at line 85 of file string_utilities.cc.

vector<string> get_strings_except ( string  ,
string   
)

Definition at line 67 of file string_utilities.cc.

string get_variation ( string  )

Definition at line 192 of file string_utilities.cc.

bool is_main_variation ( string  )

Definition at line 203 of file string_utilities.cc.

ostream& operator<< ( ostream &  stream,
map< string, string >   
)

Definition at line 214 of file string_utilities.cc.

void print_vstring ( vector< string >  )

Definition at line 184 of file string_utilities.cc.

double qs_toDouble ( QString  input)
inline

Definition at line 176 of file string_utilities.h.

string qs_tostring ( QString  input)
inline

Definition at line 56 of file string_utilities.h.

string qv_tostring ( QVariant  input)
inline

Definition at line 38 of file string_utilities.h.

string replaceCharsWithChars ( string  input,
string  x,
string  y 
)
inline

Definition at line 99 of file string_utilities.h.

string replaceCharWithChars ( string  input,
string  x,
string  y 
)
inline

Definition at line 74 of file string_utilities.h.

string stringify ( double  x)
inline

Definition at line 21 of file string_utilities.h.

string stringify ( int  x)
inline

Definition at line 28 of file string_utilities.h.

double stringToDouble ( string  v)
inline

Definition at line 161 of file string_utilities.h.

string TrimSpaces ( string  )

Definition at line 31 of file string_utilities.cc.