]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdArgValFile.h
Merge ^/head r284737 through r285152.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdArgValFile.h
1 //===-- MICmdArgValFile.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 .
24 //          Based on the Interpreter pattern.
25 // Gotchas: None.
26 // Authors: Illya Rudkin 15/04/2014.
27 // Changes: None.
28 //--
29 class CMICmdArgValFile : public CMICmdArgValBaseTemplate<CMIUtilString>
30 {
31     // Methods:
32   public:
33     /* ctor */ CMICmdArgValFile(void);
34     /* ctor */ CMICmdArgValFile(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd);
35     //
36     bool IsFilePath(const CMIUtilString &vrFileNamePath) const;
37     CMIUtilString GetFileNamePath(const CMIUtilString &vrTxt) const;
38
39     // Overridden:
40   public:
41     // From CMICmdArgValBase
42     /* dtor */ virtual ~CMICmdArgValFile(void);
43     // From CMICmdArgSet::IArg
44     virtual bool Validate(CMICmdArgContext &vwArgContext);
45
46     // Methods:
47   private:
48     bool IsValidChars(const CMIUtilString &vrText) const;
49 };