blob: def870e76493eda2a846b9360fdd479473087592 [file] [log] [blame]
Deepak Panickal6f9c4682014-05-16 10:51:01 +00001//===-- 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
Deepak Panickal6f9c4682014-05-16 10:51:01 +000010#pragma once
11
12// In-house headers:
13#include "MICmdArgValBase.h"
14
15// Declarations:
16class CMICmdArgContext;
17
Kate Stoneb9c1b512016-09-06 20:57:50 +000018//++
19//============================================================================
Zachary Turner1d6af022014-11-17 18:06:21 +000020// 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
Kate Stoneb9c1b512016-09-06 20:57:50 +000023// interpret the options (context) string to find and validate a
24// matching
Zachary Turner1d6af022014-11-17 18:06:21 +000025// argument and so extract a value from it .
26// Based on the Interpreter pattern.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000027//--
Kate Stoneb9c1b512016-09-06 20:57:50 +000028class CMICmdArgValFile : public CMICmdArgValBaseTemplate<CMIUtilString> {
29 // Methods:
30public:
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;
Deepak Panickal6f9c4682014-05-16 10:51:01 +000037
Kate Stoneb9c1b512016-09-06 20:57:50 +000038 // Overridden:
39public:
40 // From CMICmdArgValBase
41 /* dtor */ ~CMICmdArgValFile() override;
42 // From CMICmdArgSet::IArg
43 bool Validate(CMICmdArgContext &vwArgContext) override;
Deepak Panickald2499282014-08-08 16:47:42 +000044
Kate Stoneb9c1b512016-09-06 20:57:50 +000045 // Methods:
46private:
47 bool IsValidChars(const CMIUtilString &vrText) const;
Deepak Panickal6f9c4682014-05-16 10:51:01 +000048};