Changeset 13649 for trunk/FACT++/src


Ignore:
Timestamp:
05/11/12 19:53:19 (13 years ago)
Author:
tbretz
Message:
Made fLabel static to allow it being set rom dimctrl; added a virtual function to signal the current label.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r12961 r13649  
    7070using namespace std;
    7171
    72 Readline *Readline::This = 0;
     72Readline *Readline::This   =  0;
     73int       Readline::fLabel = -1;
    7374
    7475// --------------------------------------------------------------------------
     
    9697//
    9798Readline::Readline(const char *prgname) :
    98     fMaxLines(500), fLine(0), fLabel(-1), fCompletion(0)
     99    fMaxLines(500), fLine(0), fCompletion(0)
    99100{
    100101    if (This)
     
    10031004    if (str[0]==':')
    10041005    {
    1005         if (fLabel!=atoi(str.substr(1).c_str()))
     1006        const int section = atoi(str.substr(1).c_str());
     1007        SetSection(section);
     1008
     1009        if (fLabel!=section)
    10061010            return true;
    10071011
     
    12161220//!
    12171221//! @returns
    1218 //!    -1 if the file couldn't be read and the number of command for which
     1222//!    -1 if the file couldn't be read and the number of commands for which
    12191223//!    Process() was callled otherwise
    12201224//!
     
    12241228        return 0;
    12251229
     1230    SetSection(-1);
    12261231    fLabel = -1;
    12271232
     
    12651270
    12661271    fLabel = -1;
     1272    SetSection(-1);
    12671273
    12681274    fCommandLog << "# " << Time() << " - " << name << " (FINISHED)" << endl;
  • trunk/FACT++/src/Readline.h

    r12961 r13649  
    2626
    2727    int fLine;
    28     int fLabel;
     28    static int fLabel;
    2929
    3030    // Static member function which are used to adapt readline to ncurses
     
    5656    char **Complete(const std::vector<std::string> &v, const char *text);
    5757
    58     void SetLabel(int l) { fLabel = l; }
     58    virtual void SetSection(int) { }
    5959
    6060public:
     
    9898    bool         IsStopped() const;
    9999    void         ProcessLine(const std::string &str);
     100    static  void SetLabel(int l) { fLabel = l; }
    100101
    101102    int GetLine() const { return fLine; }
Note: See TracChangeset for help on using the changeset viewer.