Changeset 883


Ignore:
Timestamp:
03/08/06 12:00:10 (19 years ago)
Author:
mar637
Message:

added toggle for newline at end of each push

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDLog.cc

    r717 r883  
    55std::string SDLog::log_ = std::string("");
    66
    7 SDLog::SDLog() 
    8 { 
     7SDLog::SDLog()
     8{
    99  enableLog();
    1010}
    1111
    1212SDLog::SDLog(bool enabled)
    13 { 
     13{
    1414  enabled_ = enabled;
    1515}
    1616
    17 void SDLog::pushLog(const std::string& s) const
    18 { 
     17void SDLog::pushLog(const std::string& s, bool newline ) const
     18{
    1919  if (enabled_) {
    20     log_+=s;log_+="\n";
    21   };
     20    log_+=s;
     21    if ( newline ) log_+="\n";
     22  };
    2223}
    2324std::string SDLog::popLog() const
    2425{
    25   std::string out; 
     26  std::string out;
    2627  if (enabled_) out=log_;log_="";
    2728  return out;
    2829}
    2930void SDLog::enableLog()
    30 { 
     31{
    3132  enabled_ = true;
    3233}
  • trunk/src/SDLog.h

    r717 r883  
    1111  SDLog();
    1212  SDLog(bool enabled);
    13   void pushLog(const std::string& s) const;
     13  void pushLog(const std::string& s, bool newline=true) const;
    1414  //void pushLog(const char* cs);
    1515  std::string popLog() const;
Note: See TracChangeset for help on using the changeset viewer.