1 //===-- MICmdArgValFile.h ---------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
12 #include "MICmdArgValBase.h"
15 class CMICmdArgContext;
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
24 // argument and so extract a value from it .
25 // Based on the Interpreter pattern.
27 class CMICmdArgValFile : public CMICmdArgValBaseTemplate<CMIUtilString> {
30 /* ctor */ CMICmdArgValFile();
31 /* ctor */ CMICmdArgValFile(const CMIUtilString &vrArgName,
32 const bool vbMandatory, const bool vbHandleByCmd);
34 bool IsFilePath(const CMIUtilString &vrFileNamePath) const;
35 CMIUtilString GetFileNamePath(const CMIUtilString &vrTxt) const;
39 // From CMICmdArgValBase
40 /* dtor */ ~CMICmdArgValFile() override;
41 // From CMICmdArgSet::IArg
42 bool Validate(CMICmdArgContext &vwArgContext) override;
46 bool IsValidChars(const CMIUtilString &vrText) const;