]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdArgValThreadGrp.h
Update LLDB snapshot to upstream r241361
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdArgValThreadGrp.h
1 //===-- MICmdArgValThreadGrp.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 // 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 matching
23 //          argument and so extract a value from it. Thread group looks like
24 //          "i1" in the options text.
25 //          Based on the Interpreter pattern.
26 // Gotchas: None.
27 // Authors: Illya Rudkin 15/04/2014.
28 // Changes: None.
29 //--
30 class CMICmdArgValThreadGrp : public CMICmdArgValBaseTemplate<MIuint>
31 {
32     // Methods:
33   public:
34     /* ctor */ CMICmdArgValThreadGrp(void);
35     /* ctor */ CMICmdArgValThreadGrp(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd);
36     //
37     bool IsArgThreadGrp(const CMIUtilString &vrTxt) const;
38
39     // Overridden:
40   public:
41     // From CMICmdArgValBase
42     /* dtor */ virtual ~CMICmdArgValThreadGrp(void);
43     // From CMICmdArgSet::IArg
44     virtual bool Validate(CMICmdArgContext &vArgContext);
45
46     // Methods:
47   private:
48     bool ExtractNumber(const CMIUtilString &vrTxt);
49     MIuint GetNumber(void) const;
50
51     // Attributes:
52   private:
53     MIuint m_nThreadGrp;
54 };