1 //===-- MICmdArgValListBase.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // Third party headers:
16 #include "MICmdArgValBase.h"
19 class CMICmdArgContext;
21 //++ ============================================================================
22 // Details: MI common code class. Command argument with addition options class.
23 // For example --recurse 1 2 4 [group ...]. Arguments object that
24 // require a list of options associated with them derive from the
25 // CMICmdArgValListBase class. Additional options are also extracted from
26 // the command arguments text string.
27 // An argument knows what type of argument it is and how it is to
28 // interpret the options (context) string to find and validate a matching
29 // options and so extract a values from it .
30 // The CMICmdArgValBase objects are added to the derived argument class's
31 // container. The option arguments belong to that derived class and will
32 // be deleted that object goes out of scope.
33 // Based on the Interpreter pattern.
35 // Authors: Illya Rudkin 16/04/2014.
38 class CMICmdArgValListBase : public CMICmdArgValBaseTemplate<std::vector<CMICmdArgValBase *>>
42 typedef std::vector<CMICmdArgValBase *> VecArgObjPtr_t;
46 //++ ---------------------------------------------------------------------------------
47 // Details: CMICmdArgValListBase needs to know what type of argument to look for in
48 // the command options text. It also needs to create argument objects of
56 eArgValType_OptionLong,
57 eArgValType_OptionShort,
59 eArgValType_StringQuoted,
60 eArgValType_StringQuotedNumber,
61 eArgValType_StringQuotedNumberPath,
62 eArgValType_StringAnything, // Accept any words for a string 'type' even if they look like --longOptions for example
63 eArgValType_ThreadGrp,
64 eArgValType_count, // Always the last one
70 /* ctor */ CMICmdArgValListBase(void);
71 /* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd);
72 /* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd,
73 const ArgValType_e veType);
77 // From CMICmdArgValBase
78 /* dtor */ ~CMICmdArgValListBase(void) override;
82 bool IsExpectedCorrectType(const CMIUtilString &vrTxt, const ArgValType_e veType) const;
83 CMICmdArgValBase *CreationObj(const CMIUtilString &vrTxt, const ArgValType_e veType) const;
87 ArgValType_e m_eArgType;