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 759 of file remake.cpp.

Constructor & Destructor Documentation

log::log ( )
inline

Definition at line 763 of file remake.cpp.

763  : active(false), open(false), depth(0)
764  {
765  }
int depth
Definition: remake.cpp:762
bool open
Definition: remake.cpp:761
bool active
Definition: remake.cpp:761

Member Function Documentation

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

Definition at line 766 of file remake.cpp.

767  {
768  if (open) std::cerr << std::endl;
769  assert(depth >= 0);
770  std::cerr << std::string(depth * 2, ' ');
771  open = false;
772  return std::cerr;
773  }
int depth
Definition: remake.cpp:762
bool open
Definition: remake.cpp:761
std::ostream& log::operator() ( bool  o)
inline

Definition at line 774 of file remake.cpp.

775  {
776  if (o && open) std::cerr << std::endl;
777  if (!o) --depth;
778  assert(depth >= 0);
779  if (o || !open) std::cerr << std::string(depth * 2, ' ');
780  if (o) ++depth;
781  open = o;
782  return std::cerr;
783  }
int depth
Definition: remake.cpp:762
bool open
Definition: remake.cpp:761

Member Data Documentation

bool log::active

Definition at line 761 of file remake.cpp.

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

int log::depth

Definition at line 762 of file remake.cpp.

bool log::open

Definition at line 761 of file remake.cpp.


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