]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/lldb-mi/MICmdArgValFile.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / 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 //============================================================================
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 and so extract a value from it .
26 //          Based on the Interpreter pattern.
27 //--
28 class CMICmdArgValFile : public CMICmdArgValBaseTemplate<CMIUtilString> {
29   // Methods:
30 public:
31   /* ctor */ CMICmdArgValFile();
32   /* ctor */ CMICmdArgValFile(const CMIUtilString &vrArgName,
33                               const bool vbMandatory, const bool vbHandleByCmd);
34   //
35   bool IsFilePath(const CMIUtilString &vrFileNamePath) const;
36   CMIUtilString GetFileNamePath(const CMIUtilString &vrTxt) const;
37
38   // Overridden:
39 public:
40   // From CMICmdArgValBase
41   /* dtor */ ~CMICmdArgValFile() override;
42   // From CMICmdArgSet::IArg
43   bool Validate(CMICmdArgContext &vwArgContext) override;
44
45   // Methods:
46 private:
47   bool IsValidChars(const CMIUtilString &vrText) const;
48 };