Changeset 11131 for trunk/FACT++/src


Ignore:
Timestamp:
06/23/11 13:00:14 (13 years ago)
Author:
tbretz
Message:
Put everything into the history, but only successfull commands into the file history.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r11049 r11131  
    949949bool Readline::Process(const string &str)
    950950{
    951     fCommandLog << str << endl;
    952 
    953951    if (str.substr(0, 3)==".w ")
    954952    {
     
    10551053
    10561054    return str;
     1055}
     1056
     1057// --------------------------------------------------------------------------
     1058//
     1059//! Process a single line. All lines are added to the history, but only
     1060//! accepted lines are written to the command log. Inthis case fLine is
     1061//! increased by one.
     1062//
     1063void Readline::ProcessLine(const string &str)
     1064{
     1065    const bool rc = Process(str);
     1066
     1067    AddToHistory(str);
     1068
     1069    if (rc)
     1070        return;
     1071
     1072    fLine++;
     1073
     1074    fCommandLog << str << endl;
    10571075}
    10581076
     
    10941112            abort();
    10951113
    1096         if (Process(str))
    1097             continue;
    1098 
    1099         fLine++;
    1100 
    1101         AddToHistory(str);
     1114        ProcessLine(str);
    11021115    }
    11031116}
     
    11451158        }
    11461159
    1147         if (Process(buffer))
    1148             continue;
    1149 
    1150         fLine++;
    1151 
    1152         AddToHistory(buffer);
     1160        ProcessLine(buffer);
    11531161    }
    11541162
  • trunk/FACT++/src/Readline.h

    r11048 r11131  
    5454    void SetCompletion(const std::vector<std::string> *v) { fCompletion = v; }
    5555    char **Complete(const std::vector<std::string> &v, const char *text);
     56
     57    // Wrapper for some process code
     58    void ProcessLine(const std::string &str);
    5659
    5760public:
Note: See TracChangeset for help on using the changeset viewer.