1 //===-- MICmdArgValConsume.h ------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 #include "MICmdArgValBase.h"
15 class CMICmdArgContext;
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
24 // argument. This type having recognised its argument name just
26 // that argument or option (ignores it). This is the so the validation
27 // process can then ask if all arguments or options have been
29 // other an error will occurred "argument not recognised". For example
30 // this can be used to consume the "--" text which is not an argument
32 // itself. Normally the GetValue() function (in base class) would
34 // a value for the argument but is not the case for *this argument type
36 // Based on the Interpreter pattern.
38 class CMICmdArgValConsume : public CMICmdArgValBaseTemplate<CMIUtilString> {
41 /* ctor */ CMICmdArgValConsume();
42 /* ctor */ CMICmdArgValConsume(const CMIUtilString &vrArgName,
43 const bool vbMandatory);
49 // From CMICmdArgValBase
50 /* dtor */ ~CMICmdArgValConsume() override;
51 // From CMICmdArgSet::IArg
52 bool Validate(CMICmdArgContext &vwArgContext) override;