Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Util_String.hh File Reference

#include <sstream>
#include <string>

Include dependency graph for Util_String.hh:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

double string_to_double (const std::string &s)
std::string double_to_string (double d)
int string_to_int (const std::string &s)
std::string int_to_string (int i)
std::string Hex (const int i)
std::string myFormat (unsigned int size, int m)
std::string myFormat (unsigned int size, double x)


Function Documentation

std::string double_to_string double  d  ) 
 

Definition at line 30 of file Util_String.cc.

Referenced by myFormat().

00031 {
00032   stringstream ss;
00033   ss << d;
00034   return ss.str();
00035 }

std::string Hex const int  i  ) 
 

Definition at line 11 of file Util_String.cc.

00011                   {
00012   stringstream ss;
00013   ss.setf(ios::hex, ios::basefield);
00014   ss << i;
00015 
00016   string out;
00017   ss >> out;
00018   return out;
00019 }

std::string int_to_string int  i  ) 
 

Definition at line 37 of file Util_String.cc.

Referenced by myFormat().

00038 {
00039   stringstream ss;
00040   ss << i;
00041   return ss.str();
00042 }

std::string myFormat unsigned int  size,
double  x
 

Definition at line 73 of file Util_String.cc.

References double_to_string(), and leftPad().

Referenced by LCDG4EventAction::EndOfEventAction(), and LCDG4readStdFile::GeneratePrimaryVertex().

00073                                              {
00074   return leftPad(size,double_to_string(x));
00075 }

std::string myFormat unsigned int  size,
int  m
 

Definition at line 69 of file Util_String.cc.

00069                                           {
00070   return leftPad(size,int_to_string(m));
00071 }

double string_to_double const std::string &  s  ) 
 

int string_to_int const std::string &  s  ) 
 


Generated on Thu Oct 7 18:45:03 2004 for LCDG4 by doxygen 1.3.4