Remake
Loading...
Searching...
No Matches
log Struct Reference

Public Member Functions

 log ()
 
std::ostream & operator() ()
 
std::ostream & operator() (bool o)
 

Public Attributes

bool active
 
bool open
 
int depth
 

Detailed Description

Definition at line 774 of file remake.cpp.

Constructor & Destructor Documentation

◆ log()

log::log ( )
inline

Definition at line 778 of file remake.cpp.

778 : active(false), open(false), depth(0)
779 {
780 }
bool open
Definition remake.cpp:776
bool active
Definition remake.cpp:776
int depth
Definition remake.cpp:777

Member Function Documentation

◆ operator()() [1/2]

std::ostream & log::operator() ( )
inline

Definition at line 781 of file remake.cpp.

782 {
783 if (open) std::cerr << std::endl;
784 assert(depth >= 0);
785 std::cerr << std::string(depth * 2, ' ');
786 open = false;
787 return std::cerr;
788 }

◆ operator()() [2/2]

std::ostream & log::operator() ( bool o)
inline

Definition at line 789 of file remake.cpp.

790 {
791 if (o && open) std::cerr << std::endl;
792 if (!o) --depth;
793 assert(depth >= 0);
794 if (o || !open) std::cerr << std::string(depth * 2, ' ');
795 if (o) ++depth;
796 open = o;
797 return std::cerr;
798 }

Member Data Documentation

◆ active

bool log::active

Definition at line 776 of file remake.cpp.

Referenced by log().

◆ depth

int log::depth

Definition at line 777 of file remake.cpp.

Referenced by log(), operator()(), and operator()().

◆ open

bool log::open

Definition at line 776 of file remake.cpp.

Referenced by log(), operator()(), and operator()().


The documentation for this struct was generated from the following file: