Static Public Member Functions

ui_Confirm Class Reference
[Command line interface]

#include <ui_helpers.h>

List of all members.

Static Public Member Functions

static bool Confirm ()

Detailed Description

Definition at line 117 of file ui_helpers.h.


Member Function Documentation

bool ui_Confirm::Confirm (  )  [static]

Definition at line 207 of file ui_helpers.cpp.

References cmn_StrUpperCase(), dbg_DETAIL, dbg_LOW, ipc_Corba::IsInShutdown(), log_DBG_m, and log_FUNC_m.

Referenced by _tmain(), and main().

                        {
    log_FUNC_m(Confirm);

    string cmd;
    while (!ipc_Corba::IsInShutdown()) {
        cmd.clear();
        cout << "Are you sure? [yes/No] ";
        cin >> noskipws >> cmd;

        log_DBG_m(dbg_LOW,"Confirmation invoked with >" << cmd << "<");
        if( cmd.empty() ) {
            return false;
        }

        cmn_StrUpperCase(cmd);

        log_DBG_m(dbg_DETAIL, "after toupper >" << cmd << "<");

        if ( cmd.compare("YES") == 0 ) {
            return true;
        }
        else if( cmd.empty() || cmd.compare("NO") == 0) {
            return false;
        }
    }
    return false;

}

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: