Remake
Public Member Functions | Public Attributes | List of all members
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 776 of file remake.cpp.

Constructor & Destructor Documentation

◆ log()

log::log ( )
inline

Definition at line 780 of file remake.cpp.

780  : active(false), open(false), depth(0)
781  {
782  }

Member Function Documentation

◆ operator()() [1/2]

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

Definition at line 783 of file remake.cpp.

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

◆ operator()() [2/2]

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

Definition at line 791 of file remake.cpp.

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

Member Data Documentation

◆ active

bool log::active

Definition at line 778 of file remake.cpp.

Referenced by main(), and log_auto_close::~log_auto_close().

◆ depth

int log::depth

Definition at line 779 of file remake.cpp.

Referenced by operator()().

◆ open

bool log::open

Definition at line 778 of file remake.cpp.

Referenced by operator()().


The documentation for this struct was generated from the following file:
log::depth
int depth
Definition: remake.cpp:779
log::open
bool open
Definition: remake.cpp:778
log::active
bool active
Definition: remake.cpp:778