Public Member Functions | Public Attributes | Private Attributes

cfg_CliCreateFile Class Reference
[Parser for config files; validation]

#include <cli_arg.h>

Inheritance diagram for cfg_CliCreateFile:
Inheritance graph
[legend]
Collaboration diagram for cfg_CliCreateFile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 cfg_CliCreateFile (UInt32_t a_argc, char *a_argv[])
virtual ~cfg_CliCreateFile ()
virtual void HelpDump ()
 it it called at cc_HELP command each cli must implement its own method base HelpDump display common help

Public Attributes

string fileName
vector< val_Element< string > > accessMode
vector< val_Element< string > > shareMode
vector< val_Element< string > > createDisp
vector< val_Element< string > > flagsAndAttr
bool isRead
bool isMMapRead
bool isWrite
bool isMMapWrite
bool isLock
bool isSetEof
bool isFlush
UInt32_t readBlkSize
UInt32_t readCount
UInt32_t readMMapBlkSize
UInt32_t readMMapCount
UInt32_t readMMapTimeout
UInt32_t writeBlkSize
UInt32_t writeCount
UInt32_t writeMMapBlkSize
UInt32_t writeMMapCount
UInt32_t writeMMapTimeout
UInt64_t lockOffset
UInt64_t lockLength
UInt32_t lockTimeout
UInt64_t eofOffset
UInt32_t flushCount
string dummy

Private Attributes

 log_CLASSID_m

Detailed Description

Definition at line 368 of file cli_arg.h.


Constructor & Destructor Documentation

cfg_CliCreateFile::cfg_CliCreateFile ( UInt32_t  a_argc,
char *  a_argv[] 
)

Definition at line 2138 of file cfg_cliarg.cpp.

References accessMode, val_RuleVec::Add(), ap_paEofOffset, ap_paFileName, ap_paFlushCount, ap_paLockLength, ap_paLockOffset, ap_paMReadBlockSize, ap_paMReadCount, ap_paMWriteBlockSize, ap_paMWriteCount, ap_paReadBlockSize, ap_paReadCount, ap_paWriteBlockSize, ap_paWriteCount, ap_poListOfAccessMode, ap_poListOfCreateDisp, ap_poListOfFlagsAndAttr, ap_poListOfShareMode, ap_poLockTimeout, ap_poMReadTimeout, ap_poMWriteTimeout, cfg_MAX_BLOCK_SIZE_KB, cfg_MAX_CLI_ARGLEN, cfg_MAX_PATHNAME, cfg_MIN_BLOCK_SIZE_KB, cfg_MIN_CLI_ARGLEN, createDisp, dbg_DETAIL, dummy, eofOffset, fileName, flagsAndAttr, flushCount, cfg_CliBase::GetRules(), isFlush, isLock, isMMapRead, isMMapWrite, isRead, isSetEof, isWrite, lockLength, lockOffset, lockTimeout, log_DBG_m, log_FUNC_m, ap_Argument::m_long, ap_Argument::Parse(), readBlkSize, readCount, readMMapBlkSize, readMMapCount, readMMapTimeout, cfg_CliBase::Refresh(), shareMode, writeBlkSize, writeCount, writeMMapBlkSize, writeMMapCount, and writeMMapTimeout.

    : cfg_CliBase(),
    isRead(false),
    isMMapRead(false),
    isWrite(false),
    isMMapWrite(false),
    isLock(false),
    isSetEof(false),
    isFlush(false),
    readBlkSize(32), readCount(1),
    readMMapBlkSize(32), readMMapCount(1), readMMapTimeout(0),
    writeBlkSize(32), writeCount(1),
    writeMMapBlkSize(32), writeMMapCount(1), writeMMapTimeout(0),
    lockOffset(0), lockLength(0), lockTimeout(0),
    eofOffset(0),
    flushCount(0){

    log_FUNC_m(cfg_CliCreateFile);

    pf_ValueList parsed;
    ivdCreateFile.Parse(a_argc, a_argv, parsed);

    GetRules().Add(
        new val_Path(
            ap_paFileName.m_long, val_Limit(0, cfg_MAX_PATHNAME)),
        this->fileName
    );

    GetRules().Add(
        new val_StrictString(
            ap_poAccessMode.m_long, val_Limit(0, cfg_MAX_PATHNAME)),
        this->dummy
    );

    GetRules().Add(
        new val_StrictStringList(
            ap_poListOfAccessMode.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->accessMode
    );

    GetRules().Add(
        new val_StrictString(
            ap_poShareMode.m_long, val_Limit(0, cfg_MAX_PATHNAME)),
        this->dummy
    );

    GetRules().Add(
        new val_StrictStringList(
            ap_poListOfShareMode.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->shareMode
    );

    GetRules().Add(
        new val_StrictString(
            ap_poCreateDisp.m_long, val_Limit(0, cfg_MAX_PATHNAME)),
        this->dummy
    );

    GetRules().Add(
        new val_StrictStringList(
            ap_poListOfCreateDisp.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->createDisp
    );

    GetRules().Add(
        new val_StrictString(
            ap_poFlagsAndAttr.m_long, val_Limit(0, cfg_MAX_PATHNAME)),
        this->dummy
    );

    GetRules().Add(
        new val_StrictStringList(
            ap_poListOfFlagsAndAttr.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->flagsAndAttr
    );

    GetRules().Add(
        new val_Bool(
            ap_poWrite.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isWrite
    );

    GetRules().Add(
        new val_Integer(
            ap_paWriteBlockSize.m_long,
            val_Limit(cfg_MIN_BLOCK_SIZE_KB, cfg_MAX_BLOCK_SIZE_KB), 0),
        this->writeBlkSize
    );

    GetRules().Add(
        new val_Integer(
            ap_paWriteCount.m_long, val_Limit(0, ULONG_MAX), 0),
        this->writeCount
    );

    GetRules().Add(
        new val_Bool(
            ap_poMWrite.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isMMapWrite
    );

    GetRules().Add(
        new val_Integer(
            ap_paMWriteBlockSize.m_long,
            val_Limit(cfg_MIN_BLOCK_SIZE_KB, cfg_MAX_BLOCK_SIZE_KB), 0),
        this->writeMMapBlkSize
    );

    GetRules().Add(
        new val_Integer(
            ap_paMWriteCount.m_long, val_Limit(0, ULONG_MAX), 0),
        this->writeMMapCount
    );

    GetRules().Add(
        new val_Integer(
            ap_poMWriteTimeout.m_long, val_Limit(0, ULONG_MAX), 0),
        this->writeMMapTimeout
    );

    GetRules().Add(
        new val_Bool(
            ap_poRead.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isRead
    );

    GetRules().Add(
        new val_Integer(
            ap_paReadBlockSize.m_long,
            val_Limit(cfg_MIN_BLOCK_SIZE_KB, cfg_MAX_BLOCK_SIZE_KB), 0),
        this->readBlkSize
    );

    GetRules().Add(
        new val_Integer(
            ap_paReadCount.m_long, val_Limit(0, ULONG_MAX), 0),
        this->readCount
    );

    GetRules().Add(
        new val_Bool(
            ap_poMRead.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isMMapRead
    );

    GetRules().Add(
        new val_Integer(
            ap_paMReadBlockSize.m_long,
            val_Limit(cfg_MIN_BLOCK_SIZE_KB, cfg_MAX_BLOCK_SIZE_KB), 0),
        this->readMMapBlkSize
    );

    GetRules().Add(
        new val_Integer(
            ap_paMReadCount.m_long, val_Limit(0, ULONG_MAX), 0),
        this->readMMapCount
    );

    GetRules().Add(
        new val_Integer(
            ap_poMReadTimeout.m_long, val_Limit(0, ULONG_MAX), 0),
        this->readMMapTimeout
    );

    GetRules().Add(
        new val_Bool(
            ap_poLock.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isLock
    );

    GetRules().Add(
        new val_Integer(
            ap_paLockOffset.m_long, val_Limit(0, ULONG_MAX), 0),
        this->lockOffset
    );

    GetRules().Add(
        new val_Integer(
            ap_paLockLength.m_long, val_Limit(0, ULONG_MAX), 0),
        this->lockLength
    );

    GetRules().Add(
        new val_Integer(
            ap_poLockTimeout.m_long, val_Limit(0, ULONG_MAX), 0),
        this->lockTimeout
    );

    GetRules().Add(
        new val_Bool(
            ap_poSetEof.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isSetEof
    );

    GetRules().Add(
        new val_Integer(
            ap_paEofOffset.m_long, val_Limit(0, ULONG_MAX), 0),
        this->eofOffset
    );

    GetRules().Add(
        new val_Bool(
            ap_poFlush.m_long, val_Limit(cfg_MIN_CLI_ARGLEN, cfg_MAX_CLI_ARGLEN)),
        this->isFlush
    );

    GetRules().Add(
        new val_Integer(
            ap_paFlushCount.m_long,
            val_Limit(cfg_MIN_BLOCK_SIZE_KB, cfg_MAX_BLOCK_SIZE_KB), 0),
        this->flushCount
    );

    log_DBG_m(dbg_DETAIL,
        "Parsed options: " << endl <<  parsed );

    // Validate and convert options
    Refresh(parsed);
}

Here is the call graph for this function:

virtual cfg_CliCreateFile::~cfg_CliCreateFile (  )  [inline, virtual]

Definition at line 371 of file cli_arg.h.

{};


Member Function Documentation

void cfg_CliCreateFile::HelpDump (  )  [virtual]

it it called at cc_HELP command each cli must implement its own method base HelpDump display common help

Reimplemented from cfg_CliBase.

Definition at line 2358 of file cfg_cliarg.cpp.

                                 {
    cout << ivdCreateFile << endl;
}


Member Data Documentation

Definition at line 376 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 378 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 402 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 400 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 375 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 379 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 401 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 386 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 384 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 381 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 383 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 380 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 385 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 382 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 398 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 397 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 399 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Reimplemented from cfg_CliBase.

Definition at line 405 of file cli_arg.h.

Definition at line 387 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 388 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 389 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 390 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 391 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 377 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 392 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 393 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 394 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 395 of file cli_arg.h.

Referenced by cfg_CliCreateFile().

Definition at line 396 of file cli_arg.h.

Referenced by cfg_CliCreateFile().


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