Belle II Software  release-06-02-00
Utilities.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef TRGUtilities_FLAG_
10 #define TRGUtilities_FLAG_
11 
12 #include <string>
13 
14 #ifdef TRG_SHORT_NAMES
15 #define TRGUtil TRGUtilities
16 #endif
17 
18 namespace Belle2 {
25  class TRGUtilities {
26 
27  public: // Utility functions
28 
30  static std::string itostring(int i);
31 
33  static std::string dtostring(double d, unsigned int precision);
34 
36  static std::string carstring(const std::string& s);
37 
39  static std::string cdrstring(const std::string& s);
40 
42  static std::string dateString(void);
43 
45  static std::string dateStringF(void);
46 
48  static void bitDisplay(unsigned);
49 
51  static void bitDisplay(unsigned val,
52  unsigned firstDigit,
53  unsigned lastDigit);
54 
56  static std::string streamDisplay(unsigned);
57 
59  static std::string streamDisplay(unsigned,
60  unsigned firstDigit,
61  unsigned lastDigit);
62 
63  };
64 
65 //-----------------------------------------------------------------------------
66 
68 } // namespace Belle2
69 
70 #endif /* TRGUtilities_FLAG_ */
A class to provide TRG utility functions.
Definition: Utilities.h:25
static std::string dateStringF(void)
returns date string for filename.
static std::string dateString(void)
returns date string.
static std::string dtostring(double d, unsigned int precision)
converts double to string.
static std::string itostring(int i)
converts int to string. (Use boost::lexical_cast)
static std::string streamDisplay(unsigned)
Dumps bit stream in string.
static void bitDisplay(unsigned)
Dumps bit contents to cout.
static std::string carstring(const std::string &s)
CERNLIB car.
static std::string streamDisplay(unsigned, unsigned firstDigit, unsigned lastDigit)
Dumps bit stream in string.
static void bitDisplay(unsigned val, unsigned firstDigit, unsigned lastDigit)
Dumps bit contents to cout.
static std::string cdrstring(const std::string &s)
CERNLIB cdr.
Abstract base class for different kinds of events.