| Ilia K | 27e2c05 | 2015-05-15 09:46:28 +0000 | [diff] [blame] | 1 | //===-- MICmdArgValPrintValues.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 "MICmdArgValBase.h" | 
|  | 14 |  | 
|  | 15 | // Declarations: | 
|  | 16 | class CMICmdArgContext; | 
|  | 17 |  | 
|  | 18 | //++ ============================================================================ | 
|  | 19 | // Details: MI common code class. Command argument class. Arguments object | 
|  | 20 | //          needing specialization derived from the CMICmdArgValBase class. | 
|  | 21 | //          An argument knows what type of argument it is and how it is to | 
|  | 22 | //          interpret the options (context) string to find and validate a matching | 
|  | 23 | //          argument and so extract a value from it. The print-values looks like: | 
|  | 24 | //            0 or --no-values | 
|  | 25 | //            1 or --all-values | 
|  | 26 | //            2 or --simple-values | 
|  | 27 | //          Based on the Interpreter pattern. | 
|  | 28 | //-- | 
|  | 29 | class CMICmdArgValPrintValues : public CMICmdArgValBaseTemplate<MIuint> | 
|  | 30 | { | 
|  | 31 | // Methods: | 
|  | 32 | public: | 
| Bruce Mitchener | e2453af | 2015-08-04 10:24:20 +0000 | [diff] [blame] | 33 | /* ctor */ CMICmdArgValPrintValues(); | 
| Ilia K | 27e2c05 | 2015-05-15 09:46:28 +0000 | [diff] [blame] | 34 | /* ctor */ CMICmdArgValPrintValues(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd); | 
|  | 35 | // | 
|  | 36 | bool IsArgPrintValues(const CMIUtilString &vrTxt) const; | 
|  | 37 |  | 
|  | 38 | // Overridden: | 
|  | 39 | public: | 
|  | 40 | // From CMICmdArgValBase | 
| Bruce Mitchener | e2453af | 2015-08-04 10:24:20 +0000 | [diff] [blame] | 41 | /* dtor */ ~CMICmdArgValPrintValues() override; | 
| Ilia K | 27e2c05 | 2015-05-15 09:46:28 +0000 | [diff] [blame] | 42 | // From CMICmdArgSet::IArg | 
| Bruce Mitchener | 8820530 | 2015-07-06 15:48:55 +0000 | [diff] [blame] | 43 | bool Validate(CMICmdArgContext &vArgContext) override; | 
| Ilia K | 27e2c05 | 2015-05-15 09:46:28 +0000 | [diff] [blame] | 44 |  | 
|  | 45 | // Methods: | 
|  | 46 | private: | 
|  | 47 | bool ExtractPrintValues(const CMIUtilString &vrTxt); | 
| Bruce Mitchener | e2453af | 2015-08-04 10:24:20 +0000 | [diff] [blame] | 48 | MIuint GetPrintValues() const; | 
| Ilia K | 27e2c05 | 2015-05-15 09:46:28 +0000 | [diff] [blame] | 49 |  | 
|  | 50 | // Attributes: | 
|  | 51 | private: | 
|  | 52 | MIuint m_nPrintValues; | 
|  | 53 | }; |