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