OpenASIP  2.0
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 
35 
36 const std::string BEMGeneratorCmdLineOptions::ADF_PARAM_NAME = "adf";
38  "output";
39 
40 /**
41  * The constructor.
42  */
44  CmdLineOptions("") {
45 
47  OUTPUT_FILE_PARAM_NAME, "The name of the output file", "o");
49 }
50 
51 
52 /**
53  * The destructor.
54  */
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
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
82 }
83 
84 
85 /**
86  * Prints the version of the user interface.
87  */
88 void
90  BEMGeneratorCLITextGenerator textGenerator;
91  std::cout
93  str()
94  << " "
95  << textGenerator.text(
97  << std::endl;
98 }
99 
100 
101 /**
102  * Prints the help.
103  */
104 void
106  printVersion();
107  std::cout << "Usage: createbem [OPTION] <ADF File>";
109 }
BEMGeneratorCmdLineOptions::printVersion
virtual void printVersion() const
Definition: BEMGeneratorCmdLineOptions.cc:89
BEMGeneratorCmdLineOptions::BEMGeneratorCmdLineOptions
BEMGeneratorCmdLineOptions()
Definition: BEMGeneratorCmdLineOptions.cc:43
BEMGeneratorCLITextGenerator::TXT_CLI_VERSION
@ TXT_CLI_VERSION
Definition: BEMGeneratorCLITextGenerator.hh:50
CmdLineParser::numberOfArguments
virtual int numberOfArguments() const
BEMGeneratorCmdLineOptions::outputFile
std::string outputFile() const
Definition: BEMGeneratorCmdLineOptions.cc:80
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
BEMGeneratorCmdLineOptions.hh
CmdLineParser::addOption
void addOption(CmdLineOptionParser *opt)
BEMGeneratorCmdLineOptions::OUTPUT_FILE_PARAM_NAME
static const std::string OUTPUT_FILE_PARAM_NAME
Long name of the output file parameter.
Definition: BEMGeneratorCmdLineOptions.hh:56
BEMGeneratorCLITextGenerator.hh
CmdLineOptions
Definition: CmdLineOptions.hh:54
BEMGeneratorCLITextGenerator
Definition: BEMGeneratorCLITextGenerator.hh:42
BEMGeneratorCmdLineOptions::~BEMGeneratorCmdLineOptions
virtual ~BEMGeneratorCmdLineOptions()
Definition: BEMGeneratorCmdLineOptions.cc:55
CmdLineOptions::printHelp
virtual void printHelp() const
Definition: CmdLineOptions.cc:262
BEMGeneratorCmdLineOptions::printHelp
virtual void printHelp() const
Definition: BEMGeneratorCmdLineOptions.cc:105
CmdLineOptionParser::String
virtual std::string String(int index=0) const
Definition: CmdLineOptionParser.cc:102
CmdLineParser::findOption
CmdLineOptionParser * findOption(std::string name) const
Definition: CmdLineParser.cc:160
BEMGeneratorCLITextGenerator::TXT_CLI_TITLE
@ TXT_CLI_TITLE
Definition: BEMGeneratorCLITextGenerator.hh:49
CmdLineParser::argument
virtual std::string argument(int index) const
StringCmdLineOptionParser
Definition: CmdLineOptionParser.hh:180
BEMGeneratorCmdLineOptions::ADF_PARAM_NAME
static const std::string ADF_PARAM_NAME
Long name of the ADF file parameter.
Definition: BEMGeneratorCmdLineOptions.hh:54
BEMGeneratorCmdLineOptions::adfFile
std::string adfFile() const
Definition: BEMGeneratorCmdLineOptions.cc:65