Repository navigation
Expand file tree
/
Copy pathcommandlineparser.h
More file actions
58 lines (43 loc) · 1.71 KB
/
Copy pathcommandlineparser.h
File metadata and controls
58 lines (43 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (C) 2017 Christian Sailer
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <string>
#include <vector>
#include <memory>
class IModeParserFactory;
class IModeParser;
class IPerformanceSink;
class CommandLineParser
{
public:
CommandLineParser(const IModeParserFactory &parserFactory);
void parse(size_t argc, char *argv[]);
const std::string &getFileName() const { return m_fileName; }
const std::string &getOuputFile() const {return m_outputFile;}
const std::string &getTimingFile() const {return m_timingFile;}
bool isValid() const { return m_valid; }
bool printVersionMode() const { return m_printVersionMode; }
bool simpleMode() const { return m_simpleMode; }
const IModeParser& modeOptions() const{ return *_modeParser;};
void printHelp();
void printVersion();
void run(IPerformanceSink &perfWriter) const;
private:
std::string m_fileName;
std::string m_outputFile;
std::string m_timingFile;
bool m_valid;
bool m_printVersionMode;
bool m_simpleMode;
const IModeParserFactory &_parserFactory;
IModeParser * _modeParser;
};