OpenASIP
2.2
Loading...
Searching...
No Matches
src
bintools
BEMGenerator
BEMGeneratorCmdLineOptions.cc
Go to the documentation of this file.
1
/*
2
Copyright (c) 2002-2009 Tampere University.
3
4
This file is part of TTA-Based Codesign Environment (TCE).
5
6
Permission is hereby granted, free of charge, to any person obtaining a
7
copy of this software and associated documentation files (the "Software"),
8
to deal in the Software without restriction, including without limitation
9
the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
and/or sell copies of the Software, and to permit persons to whom the
11
Software is furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
DEALINGS IN THE SOFTWARE.
23
*/
24
/**
25
* @file BEMGeneratorCmdLineOptions.cc
26
*
27
* Implementation of BEMGeneratorCmdLineOptions class.
28
*
29
* @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30
* @note rating: red
31
*/
32
33
#include "
BEMGeneratorCmdLineOptions.hh
"
34
#include "
BEMGeneratorCLITextGenerator.hh
"
35
36
const
std::string
BEMGeneratorCmdLineOptions::ADF_PARAM_NAME
=
"adf"
;
37
const
std::string
BEMGeneratorCmdLineOptions::OUTPUT_FILE_PARAM_NAME
=
38
"output"
;
39
40
/**
41
* The constructor.
42
*/
43
BEMGeneratorCmdLineOptions::BEMGeneratorCmdLineOptions
() :
44
CmdLineOptions
(
""
) {
45
46
StringCmdLineOptionParser
*
outputFile
=
new
StringCmdLineOptionParser
(
47
OUTPUT_FILE_PARAM_NAME
,
"The name of the output file"
,
"o"
);
48
addOption
(
outputFile
);
49
}
50
51
52
/**
53
* The destructor.
54
*/
55
BEMGeneratorCmdLineOptions::~BEMGeneratorCmdLineOptions
() {
56
}
57
58
59
/**
60
* Returns the name of the ADF file given as command line parameter.
61
*
62
* @return The name of the ADF file.
63
*/
64
std::string
65
BEMGeneratorCmdLineOptions::adfFile
()
const
{
66
if
(
numberOfArguments
() < 1) {
67
return
""
;
68
}
else
{
69
return
argument
(
numberOfArguments
());
70
}
71
}
72
73
74
/**
75
* Returns the name of the output file given as command line parameter.
76
*
77
* @return The name of the output file.
78
*/
79
std::string
80
BEMGeneratorCmdLineOptions::outputFile
()
const
{
81
return
findOption
(
OUTPUT_FILE_PARAM_NAME
)->
String
();
82
}
83
84
85
/**
86
* Prints the version of the user interface.
87
*/
88
void
89
BEMGeneratorCmdLineOptions::printVersion
()
const
{
90
BEMGeneratorCLITextGenerator
textGenerator;
91
std::cout
92
<< textGenerator.
text
(
BEMGeneratorCLITextGenerator::TXT_CLI_TITLE
).
93
str()
94
<<
" "
95
<< textGenerator.
text
(
96
BEMGeneratorCLITextGenerator::TXT_CLI_VERSION
).str()
97
<< std::endl;
98
}
99
100
101
/**
102
* Prints the help.
103
*/
104
void
105
BEMGeneratorCmdLineOptions::printHelp
()
const
{
106
printVersion
();
107
std::cout <<
"Usage: createbem [OPTION] <ADF File>"
;
108
CmdLineOptions::printHelp
();
109
}
BEMGeneratorCLITextGenerator.hh
BEMGeneratorCmdLineOptions.hh
BEMGeneratorCLITextGenerator
Definition
BEMGeneratorCLITextGenerator.hh:42
BEMGeneratorCLITextGenerator::TXT_CLI_VERSION
@ TXT_CLI_VERSION
Definition
BEMGeneratorCLITextGenerator.hh:50
BEMGeneratorCLITextGenerator::TXT_CLI_TITLE
@ TXT_CLI_TITLE
Definition
BEMGeneratorCLITextGenerator.hh:49
BEMGeneratorCmdLineOptions::printHelp
virtual void printHelp() const
Definition
BEMGeneratorCmdLineOptions.cc:105
BEMGeneratorCmdLineOptions::printVersion
virtual void printVersion() const
Definition
BEMGeneratorCmdLineOptions.cc:89
BEMGeneratorCmdLineOptions::~BEMGeneratorCmdLineOptions
virtual ~BEMGeneratorCmdLineOptions()
Definition
BEMGeneratorCmdLineOptions.cc:55
BEMGeneratorCmdLineOptions::OUTPUT_FILE_PARAM_NAME
static const std::string OUTPUT_FILE_PARAM_NAME
Long name of the output file parameter.
Definition
BEMGeneratorCmdLineOptions.hh:56
BEMGeneratorCmdLineOptions::outputFile
std::string outputFile() const
Definition
BEMGeneratorCmdLineOptions.cc:80
BEMGeneratorCmdLineOptions::BEMGeneratorCmdLineOptions
BEMGeneratorCmdLineOptions()
Definition
BEMGeneratorCmdLineOptions.cc:43
BEMGeneratorCmdLineOptions::adfFile
std::string adfFile() const
Definition
BEMGeneratorCmdLineOptions.cc:65
BEMGeneratorCmdLineOptions::ADF_PARAM_NAME
static const std::string ADF_PARAM_NAME
Long name of the ADF file parameter.
Definition
BEMGeneratorCmdLineOptions.hh:54
CmdLineOptionParser::String
virtual std::string String(int index=0) const
Definition
CmdLineOptionParser.cc:102
CmdLineOptions
Definition
CmdLineOptions.hh:54
CmdLineOptions::printHelp
virtual void printHelp() const
Definition
CmdLineOptions.cc:262
CmdLineParser::findOption
CmdLineOptionParser * findOption(std::string name) const
Definition
CmdLineParser.cc:160
CmdLineParser::argument
virtual std::string argument(int index) const
CmdLineParser::numberOfArguments
virtual int numberOfArguments() const
CmdLineParser::addOption
void addOption(CmdLineOptionParser *opt)
StringCmdLineOptionParser
Definition
CmdLineOptionParser.hh:180
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition
TextGenerator.cc:94
Generated by
1.9.8