Changeset 10498


Ignore:
Timestamp:
Apr 29, 2011, 1:25:45 PM (9 years ago)
Author:
tbretz
Message:
Use stringstreams to replace Form not strings and +=
Location:
trunk/FACT++/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Console.cc

    r10496 r10498  
    1313#include "Console.h"
    1414
     15#include <sstream>
    1516#include <iostream>
    1617
     
    134135    const string siz = fLogO.GetSizeStr();
    135136
    136     string rc = "[";
    137     rc += GetLine();
    138     return fContinous ? rc+']' : rc+':'+siz+']';
     137    ostringstream str;
     138    str << '[' << GetLine();
     139    return fContinous ? str.str()+']' : str.str()+':'+siz+']';
    139140}
    140141
  • trunk/FACT++/src/Readline.cc

    r10496 r10498  
    5555#include "Readline.h"
    5656
     57#include <sstream>
    5758#include <fstream>
    5859#include <iostream>
     
    536537string Readline::GetLinePrompt() const
    537538{
    538     string rc = "[";
    539     rc += fLine;
    540     return rc+"]";
     539    ostringstream str;
     540    str << '[' << fLine << ']';
     541    return str.str();
    541542}
    542543
  • trunk/FACT++/src/ReadlineWindow.cc

    r10496 r10498  
    3737#include "Shell.h"
    3838
     39#include <sstream>
    3940#include <iostream>
    4041#include <string.h> // strlen
     
    290291
    291292    // Compile a proper format string
    292     string fmt = "%-";
    293     fmt += max;
    294     fmt + 's';
     293    ostringstream fmt;
     294    fmt << "%-" << max << 's';
    295295
    296296    // loop over all entries and display them
     
    307307
    308308        // Display an entry
    309         wprintw(fWindow, fmt.c_str(), matches[i+1]);
     309        wprintw(fWindow, fmt.str().c_str(), matches[i+1]);
    310310    }
    311311
  • trunk/FACT++/src/StateMachineImp.cc

    r10497 r10498  
    715715    const StateNames::const_iterator i = fStateNames.find(state);
    716716
    717     string rc;
    718     rc += state;
    719     return i==fStateNames.end() || i->second.first.empty() ? rc : i->second.first;
     717    ostringstream s;
     718    s << state;
     719    return i==fStateNames.end() || i->second.first.empty() ? s.str() : i->second.first;
    720720}
    721721
     
    754754    const string &str = GetStateName(state);
    755755
    756     string s;
    757     s += state;
    758     if (str==s)
     756    ostringstream s;
     757    s << state;
     758    if (str==s.str())
    759759        return str;
    760760
    761     return str.empty() ? s : (str+'['+s+']');
     761    return str.empty() ? s.str() : (str+'['+s.str()+']');
    762762}
    763763
  • trunk/FACT++/src/WindowLog.cc

    r10496 r10498  
    1616#include "WindowLog.h"
    1717
     18#include <sstream>
    1819#include <iostream>
    1920#include <algorithm>
     
    274275    }
    275276
    276     string rc;
    277     rc += s;
    278     return rc + u;
     277    ostringstream str;
     278    str << s << u;
     279    return str.str();
    279280}
    280281
Note: See TracChangeset for help on using the changeset viewer.