REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | Related Functions
TRestStringOutput Class Reference

Detailed Description

This class serves as an universal std::string output tool, aiming at leveling, rendering, and auto saving for the output message.

To use this tool class in the other classes, include this header file. You will get several global output objects: fout, info, essential, debug, etc. they works similarly as std::cout: fout<<"hello world"<<endl;. It is also possible to initialize a local TRestStringOutput object. Then one can customize output color, border and orientation on that.

Definition at line 148 of file TRestStringOutput.h.

#include <TRestStringOutput.h>

Public Types

enum class  REST_Display_Orientation { kLeft = 1 , kMiddle = 0 }
 Enumerate of TRestStringOutput display orientation.
 
enum class  REST_Verbose_Level {
  REST_Silent = 0 , REST_Essential = 1 , REST_Warning = REST_Essential , REST_Info = 2 ,
  REST_Debug = 3 , REST_Extreme = 4
}
 Enumerate of verbose level, containing five levels. More...
 

Public Member Functions

void flushstring ()
 
std::string FormattingPrintString (std::string input)
 
std::string GetBuffer ()
 
REST_Verbose_Level GetVerboseLevel ()
 
bool isError ()
 
TRestStringOutputoperator<< (endl_t et)
 
template<class T >
TRestStringOutputoperator<< (T const &content)
 
TRestStringOutputoperator<< (void(*pfunc)(TRestStringOutput &))
 
void resetborder ()
 
void resetcolor ()
 
void resetheader ()
 
void resetorientation ()
 
void resetstring ()
 
void setborder (std::string b)
 
void setcolor (COLORCODE_TYPE colordef)
 
void setheader (std::string headerdef)
 
void setlength (int n)
 
void setorientation (REST_Display_Orientation o)
 
 TRestStringOutput (COLORCODE_TYPE color=COLOR_RESET, std::string formatter="", REST_Display_Orientation orientation=TRestStringOutput::REST_Display_Orientation::kLeft)
 
 TRestStringOutput (REST_Verbose_Level v, COLORCODE_TYPE _color=COLOR_RESET, std::string formatter="", REST_Display_Orientation orientation=TRestStringOutput::REST_Display_Orientation::kLeft, bool _iserror=false)
 

Static Public Member Functions

static void RESTendl (TRestStringOutput &input)
 

Protected Attributes

std::stringstream buf
 
COLORCODE_TYPE color
 
std::string formatstring
 
bool iserror
 
int length
 
REST_Display_Orientation orientation
 
bool useborder
 
REST_Verbose_Level verbose
 

Friends

TRestStringOutputoperator<< (TRestMetadata &mt, TRestStringOutput &so)
 

Related Functions

(Note that these are not member functions.)

void PrintWelcome ()
 

Member Enumeration Documentation

◆ REST_Verbose_Level

Enumerate of verbose level, containing five levels.

Enumerator
REST_Silent 

show minimum information of the software, as well as error messages

REST_Essential 

+show some essential information, as well as warnings

REST_Info 

+show most of the information for each steps

REST_Debug 

+show the defined debug messages

REST_Extreme 

show everything

Definition at line 152 of file TRestStringOutput.h.

Friends And Related Function Documentation

◆ PrintWelcome()

void PrintWelcome ( )
related

print a welcome message by calling shell script "rest-config"

Definition at line 230 of file TRestStringOutput.h.


The documentation for this class was generated from the following files: