1 //===-- MICmdArgValOptionShort.h --------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #pragma once 11 12 // In-house headers: 13 #include "MICmdArgValOptionLong.h" 14 15 // Declarations: 16 class CMICmdArgContext; 17 class CMIUtilString; 18 19 //++ 20 //============================================================================ 21 // Details: MI common code class. Command argument class. Arguments object 22 // needing specialization derived from the CMICmdArgValOptionLong 23 // class. 24 // An argument knows what type of argument it is and how it is to 25 // interpret the options (context) string to find and validate a 26 // matching 27 // argument and so extract a value from it. 28 // If *this argument has expected options following it the option 29 // objects 30 // created to hold each of those option's values belong to *this 31 // argument 32 // object and so are deleted when *this object goes out of scope. 33 // Based on the Interpreter pattern. 34 //-- 35 class CMICmdArgValOptionShort : public CMICmdArgValOptionLong { 36 // Methods: 37 public: 38 /* ctor */ CMICmdArgValOptionShort(); 39 /* ctor */ CMICmdArgValOptionShort(const CMIUtilString &vrArgName, 40 const bool vbMandatory, 41 const bool vbHandleByCmd); 42 /* ctor */ CMICmdArgValOptionShort(const CMIUtilString &vrArgName, 43 const bool vbMandatory, 44 const bool vbHandleByCmd, 45 const ArgValType_e veType, 46 const MIuint vnExpectingNOptions); 47 // 48 bool IsArgShortOption(const CMIUtilString &vrTxt) const; 49 50 // Overridden: 51 public: 52 // From CMICmdArgValBase 53 /* dtor */ ~CMICmdArgValOptionShort() override; 54 55 // Overridden: 56 private: 57 // From CMICmdArgValOptionLong 58 bool IsArgOptionCorrect(const CMIUtilString &vrTxt) const override; 59 bool ArgNameMatch(const CMIUtilString &vrTxt) const override; 60 }; 61