]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdArgValConsume.h
MFV r353613: 10731 zfs: NULL pointer errors
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdArgValConsume.h
1 //===-- MICmdArgValConsume.h ------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 #pragma once
10
11 // In-house headers:
12 #include "MICmdArgValBase.h"
13
14 // Declarations:
15 class CMICmdArgContext;
16
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
23 //          matching
24 //          argument. This type having recognised its argument name just
25 //          consumes
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
28 //          recognised
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
31 //          in
32 //          itself. Normally the GetValue() function (in base class) would
33 //          return
34 //          a value for the argument but is not the case for *this argument type
35 //          object.
36 //          Based on the Interpreter pattern.
37 //--
38 class CMICmdArgValConsume : public CMICmdArgValBaseTemplate<CMIUtilString> {
39   // Methods:
40 public:
41   /* ctor */ CMICmdArgValConsume();
42   /* ctor */ CMICmdArgValConsume(const CMIUtilString &vrArgName,
43                                  const bool vbMandatory);
44   //
45   bool IsOk() const;
46
47   // Overridden:
48 public:
49   // From CMICmdArgValBase
50   /* dtor */ ~CMICmdArgValConsume() override;
51   // From CMICmdArgSet::IArg
52   bool Validate(CMICmdArgContext &vwArgContext) override;
53 };