]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdArgValConsume.h
Merge ^/head r275118 through r275209.
[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 //++
11 // File:                MICmdArgValConsume.h
12 //
13 // Overview:    CMICmdArgValConsume interface.
14 //
15 // Environment: Compilers:      Visual C++ 12.
16 //                                                      gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 //                              Libraries:      See MIReadmetxt. 
18 //
19 // Copyright:   None.
20 //--
21
22 #pragma once
23
24 // In-house headers:
25 #include "MICmdArgValBase.h"
26
27 // Declarations:
28 class CMICmdArgContext;
29
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
42 //                      object.
43 //                      Based on the Interpreter pattern.
44 // Gotchas:     None.
45 // Authors:     Illya Rudkin 20/05/2014.
46 // Changes:     None.
47 //--
48 class CMICmdArgValConsume : public CMICmdArgValBaseTemplate< CMIUtilString >
49 {
50 // Methods:
51 public:
52         /* ctor */      CMICmdArgValConsume( void );
53         /* ctor */      CMICmdArgValConsume( const CMIUtilString & vrArgName, const bool vbMandatory );
54         //
55         bool    IsOk( void ) const;
56
57 // Overridden:
58 public:
59         // From CMICmdArgValBase
60         /* dtor */ virtual ~CMICmdArgValConsume( void );
61         // From CMICmdArgSet::IArg
62         virtual bool    Validate( CMICmdArgContext & vwArgContext );
63 };