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 //===----------------------------------------------------------------------===//
11 // File: MICmdArgValListBase.h
13 // Overview: CMICmdArgValListBase interface.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
24 // Third party headers:
28 #include "MICmdArgValBase.h"
31 class CMICmdArgContext;
33 //++ ============================================================================
34 // Details: MI common code class. Command argument with addition options class.
35 // For example --recurse 1 2 4 [group ...]. Arguments object that
36 // require a list of options associated with them derive from the
37 // CMICmdArgValListBase class. Additional options are also extracted from
38 // the command arguments text string.
39 // An argument knows what type of argument it is and how it is to
40 // interpret the options (context) string to find and validate a matching
41 // options and so extract a values from it .
42 // The CMICmdArgValBase objects are added to the derived argument class's
43 // container. The option arguments belong to that derived class and will
44 // be deleted that object goes out of scope.
45 // Based on the Interpreter pattern.
47 // Authors: Illya Rudkin 16/04/2014.
50 class CMICmdArgValListBase : public CMICmdArgValBaseTemplate<std::vector<CMICmdArgValBase *>>
54 typedef std::vector<CMICmdArgValBase *> VecArgObjPtr_t;
58 //++ ---------------------------------------------------------------------------------
59 // Details: CMICmdArgValListBase needs to know what type of argument to look for in
60 // the command options text. It also needs to create argument objects of
68 eArgValType_OptionLong,
69 eArgValType_OptionShort,
71 eArgValType_StringQuoted,
72 eArgValType_StringQuotedNumber,
73 eArgValType_StringQuotedNumberPath,
74 eArgValType_StringAnything, // Accept any words for a string 'type' even if they look like --longOptions for example
75 eArgValType_ThreadGrp,
76 eArgValType_count, // Always the last one
82 /* ctor */ CMICmdArgValListBase(void);
83 /* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd);
84 /* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd,
85 const ArgValType_e veType);
89 // From CMICmdArgValBase
90 /* dtor */ virtual ~CMICmdArgValListBase(void);
94 bool IsExpectedCorrectType(const CMIUtilString &vrTxt, const ArgValType_e veType) const;
95 CMICmdArgValBase *CreationObj(const CMIUtilString &vrTxt, const ArgValType_e veType) const;
99 ArgValType_e m_eArgType;