1296417Sdim//===-- MICmdArgValConsume.h ------------------------------------*- C++ -*-===//
2275072Semaste//
3275072Semaste//                     The LLVM Compiler Infrastructure
4275072Semaste//
5275072Semaste// This file is distributed under the University of Illinois Open Source
6275072Semaste// License. See LICENSE.TXT for details.
7275072Semaste//
8275072Semaste//===----------------------------------------------------------------------===//
9275072Semaste
10275072Semaste#pragma once
11275072Semaste
12275072Semaste// In-house headers:
13275072Semaste#include "MICmdArgValBase.h"
14275072Semaste
15275072Semaste// Declarations:
16275072Semasteclass CMICmdArgContext;
17275072Semaste
18275072Semaste//++ ============================================================================
19280031Sdim// Details: MI common code class. Command argument class. Arguments object
20280031Sdim//          needing specialization derived from the CMICmdArgValBase class.
21280031Sdim//          An argument knows what type of argument it is and how it is to
22280031Sdim//          interpret the options (context) string to find and validate a matching
23280031Sdim//          argument. This type having recognised its argument name just consumes
24280031Sdim//          that argument or option (ignores it). This is the so the validation
25280031Sdim//          process can then ask if all arguments or options have been recognised
26280031Sdim//          other an error will occurred "argument not recognised". For example
27280031Sdim//          this can be used to consume the "--" text which is not an argument in
28280031Sdim//          itself. Normally the GetValue() function (in base class) would return
29280031Sdim//          a value for the argument but is not the case for *this argument type
30280031Sdim//          object.
31280031Sdim//          Based on the Interpreter pattern.
32275072Semaste//--
33280031Sdimclass CMICmdArgValConsume : public CMICmdArgValBaseTemplate<CMIUtilString>
34275072Semaste{
35280031Sdim    // Methods:
36280031Sdim  public:
37296417Sdim    /* ctor */ CMICmdArgValConsume();
38280031Sdim    /* ctor */ CMICmdArgValConsume(const CMIUtilString &vrArgName, const bool vbMandatory);
39280031Sdim    //
40296417Sdim    bool IsOk() const;
41275072Semaste
42280031Sdim    // Overridden:
43280031Sdim  public:
44280031Sdim    // From CMICmdArgValBase
45296417Sdim    /* dtor */ ~CMICmdArgValConsume() override;
46280031Sdim    // From CMICmdArgSet::IArg
47288943Sdim    bool Validate(CMICmdArgContext &vwArgContext) override;
48275072Semaste};
49