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;
22 //============================================================================
23 // Details: MI common code class. Command argument with addition options class.
24 // For example --recurse 1 2 4 [group ...]. Arguments object that
25 // require a list of options associated with them derive from the
26 // CMICmdArgValListBase class. Additional options are also extracted
28 // the command arguments text string.
29 // An argument knows what type of argument it is and how it is to
30 // interpret the options (context) string to find and validate a
32 // options and so extract a values from it .
33 // The CMICmdArgValBase objects are added to the derived argument
35 // container. The option arguments belong to that derived class and
37 // be deleted that object goes out of scope.
38 // Based on the Interpreter pattern.
40 class CMICmdArgValListBase
41 : public CMICmdArgValBaseTemplate<std::vector<CMICmdArgValBase *>> {
44 typedef std::vector<CMICmdArgValBase *> VecArgObjPtr_t;
49 //---------------------------------------------------------------------------------
50 // Details: CMICmdArgValListBase needs to know what type of argument to look
52 // the command options text. It also needs to create argument objects
60 eArgValType_OptionLong,
61 eArgValType_OptionShort,
63 eArgValType_StringQuoted,
64 eArgValType_StringQuotedNumber,
65 eArgValType_StringQuotedNumberPath,
66 eArgValType_StringAnything, // Accept any words for a string 'type' even if
67 // they look like --longOptions for example
68 eArgValType_ThreadGrp,
69 eArgValType_count, // Always the last one
75 /* ctor */ CMICmdArgValListBase();
76 /* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName,
77 const bool vbMandatory,
78 const bool vbHandleByCmd);
79 /* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName,
80 const bool vbMandatory,
81 const bool vbHandleByCmd,
82 const ArgValType_e veType);
86 // From CMICmdArgValBase
87 /* dtor */ ~CMICmdArgValListBase() override;
91 bool IsExpectedCorrectType(const CMIUtilString &vrTxt,
92 const ArgValType_e veType) const;
93 CMICmdArgValBase *CreationObj(const CMIUtilString &vrTxt,
94 const ArgValType_e veType) const;
98 ArgValType_e m_eArgType;