]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdArgValConsume.h
Merge llvm release_70 branch r338892, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdArgValConsume.h
1 //===-- MICmdArgValConsume.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 //============================================================================
20 // Details: MI common code class. Command argument class. Arguments object
21 //          needing specialization derived from the CMICmdArgValBase class.
22 //          An argument knows what type of argument it is and how it is to
23 //          interpret the options (context) string to find and validate a
24 //          matching
25 //          argument. This type having recognised its argument name just
26 //          consumes
27 //          that argument or option (ignores it). This is the so the validation
28 //          process can then ask if all arguments or options have been
29 //          recognised
30 //          other an error will occurred "argument not recognised". For example
31 //          this can be used to consume the "--" text which is not an argument
32 //          in
33 //          itself. Normally the GetValue() function (in base class) would
34 //          return
35 //          a value for the argument but is not the case for *this argument type
36 //          object.
37 //          Based on the Interpreter pattern.
38 //--
39 class CMICmdArgValConsume : public CMICmdArgValBaseTemplate<CMIUtilString> {
40   // Methods:
41 public:
42   /* ctor */ CMICmdArgValConsume();
43   /* ctor */ CMICmdArgValConsume(const CMIUtilString &vrArgName,
44                                  const bool vbMandatory);
45   //
46   bool IsOk() const;
47
48   // Overridden:
49 public:
50   // From CMICmdArgValBase
51   /* dtor */ ~CMICmdArgValConsume() override;
52   // From CMICmdArgSet::IArg
53   bool Validate(CMICmdArgContext &vwArgContext) override;
54 };