1 //===-- MICmdArgValConsume.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: MICmdArgValConsume.h
13 // Overview: CMICmdArgValConsume interface.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
25 #include "MICmdArgValBase.h"
28 class CMICmdArgContext;
30 //++ ============================================================================
31 // Details: MI common code class. Command argument class. Arguments object
32 // needing specialization derived from the CMICmdArgValBase class.
33 // An argument knows what type of argument it is and how it is to
34 // interpret the options (context) string to find and validate a matching
35 // argument. This type having recognised its argument name just consumes
36 // that argument or option (ignores it). This is the so the validation
37 // process can then ask if all arguments or options have been recognised
38 // other an error will occurred "argument not recognised". For example
39 // this can be used to consume the "--" text which is not an argument in
40 // itself. Normally the GetValue() function (in base class) would return
41 // a value for the argument but is not the case for *this argument type
43 // Based on the Interpreter pattern.
45 // Authors: Illya Rudkin 20/05/2014.
48 class CMICmdArgValConsume : public CMICmdArgValBaseTemplate< CMIUtilString >
52 /* ctor */ CMICmdArgValConsume( void );
53 /* ctor */ CMICmdArgValConsume( const CMIUtilString & vrArgName, const bool vbMandatory );
55 bool IsOk( void ) const;
59 // From CMICmdArgValBase
60 /* dtor */ virtual ~CMICmdArgValConsume( void );
61 // From CMICmdArgSet::IArg
62 virtual bool Validate( CMICmdArgContext & vwArgContext );