REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
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. More... | |
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 () |
TRestStringOutput & | operator<< (endl_t et) |
template<class T > | |
TRestStringOutput & | operator<< (T const &content) |
TRestStringOutput & | operator<< (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 | |
TRestStringOutput & | operator<< (TRestMetadata &mt, TRestStringOutput &so) |
Related Functions | |
(Note that these are not member functions.) | |
void | PrintWelcome () |
|
strong |
Enumerate of TRestStringOutput display orientation.
Definition at line 163 of file TRestStringOutput.h.
|
strong |
Enumerate of verbose level, containing five levels.
Definition at line 152 of file TRestStringOutput.h.
TRestStringOutput::TRestStringOutput | ( | COLORCODE_TYPE | color = COLOR_RESET , |
std::string | formatter = "" , |
||
REST_Display_Orientation | orientation = TRestStringOutput::REST_Display_Orientation::kLeft |
||
) |
Definition at line 195 of file TRestStringOutput.cxx.
|
inline |
Definition at line 208 of file TRestStringOutput.h.
void TRestStringOutput::flushstring | ( | ) |
Definition at line 309 of file TRestStringOutput.cxx.
string TRestStringOutput::FormattingPrintString | ( | std::string | input | ) |
Definition at line 238 of file TRestStringOutput.cxx.
|
inline |
Definition at line 179 of file TRestStringOutput.h.
|
inline |
Definition at line 178 of file TRestStringOutput.h.
|
inline |
Definition at line 180 of file TRestStringOutput.h.
TRestStringOutput & TRestStringOutput::operator<< | ( | endl_t | et | ) |
Definition at line 2629 of file TRestMetadata.cxx.
|
inline |
Definition at line 218 of file TRestStringOutput.h.
TRestStringOutput & TRestStringOutput::operator<< | ( | void(*)(TRestStringOutput &) | pfunc | ) |
Definition at line 335 of file TRestStringOutput.cxx.
|
inline |
Definition at line 195 of file TRestStringOutput.h.
|
inline |
Definition at line 189 of file TRestStringOutput.h.
|
inline |
Definition at line 190 of file TRestStringOutput.h.
|
inline |
Definition at line 198 of file TRestStringOutput.h.
void TRestStringOutput::resetstring | ( | ) |
Definition at line 233 of file TRestStringOutput.cxx.
|
inlinestatic |
Definition at line 199 of file TRestStringOutput.h.
|
inline |
Definition at line 191 of file TRestStringOutput.h.
|
inline |
Definition at line 184 of file TRestStringOutput.h.
|
inline |
Definition at line 185 of file TRestStringOutput.h.
void TRestStringOutput::setlength | ( | int | n | ) |
Definition at line 285 of file TRestStringOutput.cxx.
|
inline |
Definition at line 197 of file TRestStringOutput.h.
|
related |
print a welcome message by calling shell script "rest-config"
Definition at line 230 of file TRestStringOutput.h.
|
protected |
Definition at line 172 of file TRestStringOutput.h.
|
protected |
Definition at line 166 of file TRestStringOutput.h.
|
protected |
Definition at line 167 of file TRestStringOutput.h.
|
protected |
Definition at line 169 of file TRestStringOutput.h.
|
protected |
Definition at line 173 of file TRestStringOutput.h.
|
protected |
Definition at line 170 of file TRestStringOutput.h.
|
protected |
Definition at line 168 of file TRestStringOutput.h.
|
protected |
Definition at line 175 of file TRestStringOutput.h.