OpenASIP  2.0
Public Member Functions | List of all members
MachInfoCmdLineOptions Class Reference

#include <MachInfoCmdLineOptions.hh>

Inheritance diagram for MachInfoCmdLineOptions:
Inheritance graph
Collaboration diagram for MachInfoCmdLineOptions:
Collaboration graph

Public Member Functions

 MachInfoCmdLineOptions ()
 
virtual ~MachInfoCmdLineOptions ()
 
TCEString outputFileNameSuffix () const
 
TCEString outputFormat () const
 
virtual void printVersion () const
 
virtual void printHelp () const
 
- Public Member Functions inherited from CmdLineOptions
 CmdLineOptions (std::string description, std::string version="")
 
virtual ~CmdLineOptions ()
 
void parse (char *argv[], int argc)
 
void parse (std::string argv[], int argc)
 
void parse (std::vector< std::string > argv)
 
virtual bool isVerboseSwitchDefined () const
 
virtual bool isVerboseSpamSwitchDefined () const
 
- Public Member Functions inherited from CmdLineParser
 CmdLineParser (std::string description)
 
virtual ~CmdLineParser ()
 
virtual void storeOptions (Options &options)
 
virtual int numberOfArguments () const
 
virtual std::string argument (int index) const
 

Additional Inherited Members

- Protected Member Functions inherited from CmdLineOptions
bool optionGiven (std::string key) const
 
- Protected Member Functions inherited from CmdLineParser
void addOption (CmdLineOptionParser *opt)
 
CmdLineOptionParserfindOption (std::string name) const
 
bool parseOption (std::string option, std::string &name, std::string &arguments, std::string &prefix, bool &hasArgument) const
 
bool readPrefix (std::string &option, std::string &prefix, bool &longOption) const
 
bool isPrefix (std::string name) const
 
- Protected Attributes inherited from CmdLineParser
std::map< std::string, CmdLineOptionParser * > optionLongNames_
 Database for holding options with their long names as a key. More...
 
std::map< std::string, CmdLineOptionParser * > optionShortNames_
 Database for holding options with their short names as a key. More...
 
std::vector< std::string > commandLine_
 Command line is stored here. More...
 
std::vector< std::string > arguments_
 Command line arguments are stored here. More...
 
std::vector< std::string > prefixes_
 Legal prefixes are stored here. More...
 

Detailed Description

Definition at line 36 of file MachInfoCmdLineOptions.hh.

Constructor & Destructor Documentation

◆ MachInfoCmdLineOptions()

MachInfoCmdLineOptions::MachInfoCmdLineOptions ( )

Definition at line 42 of file MachInfoCmdLineOptions.cc.

42  :
43  CmdLineOptions("") {
44 
45  addOption(
48  "The suffix of the filenames of the produced documentation files.",
49  "s"));
50  addOption(
53  "The format of the produced documentation (only 'latex' supported "
54  "for now).", "f"));
55 
56 }

References CmdLineParser::addOption(), OUTPUT_FORMAT_PARAM_NAME, and OUTPUTFN_PARAM_NAME.

Here is the call graph for this function:

◆ ~MachInfoCmdLineOptions()

MachInfoCmdLineOptions::~MachInfoCmdLineOptions ( )
virtual

Definition at line 59 of file MachInfoCmdLineOptions.cc.

59  {
60 }

Member Function Documentation

◆ outputFileNameSuffix()

TCEString MachInfoCmdLineOptions::outputFileNameSuffix ( ) const

Definition at line 63 of file MachInfoCmdLineOptions.cc.

63  {
64  if (!findOption(OUTPUTFN_PARAM_NAME)->isDefined()) {
65  if (numberOfArguments() == 1) return argument(1);
66  }
68 }

References CmdLineParser::argument(), CmdLineParser::findOption(), CmdLineParser::numberOfArguments(), OUTPUTFN_PARAM_NAME, and CmdLineOptionParser::String().

Referenced by main().

Here is the call graph for this function:

◆ outputFormat()

TCEString MachInfoCmdLineOptions::outputFormat ( ) const

Definition at line 71 of file MachInfoCmdLineOptions.cc.

71  {
72  if (!findOption(OUTPUT_FORMAT_PARAM_NAME)->isDefined())
73  return "latex";
75 }

References CmdLineParser::findOption(), OUTPUT_FORMAT_PARAM_NAME, and CmdLineOptionParser::String().

Referenced by main().

Here is the call graph for this function:

◆ printHelp()

void MachInfoCmdLineOptions::printHelp ( ) const
virtual

Prints the help menu of the program.

Reimplemented from CmdLineOptions.

Definition at line 89 of file MachInfoCmdLineOptions.cc.

89  {
90  printVersion();
91  cout << "Usage: machinfo [options] ADF" << endl;
93 }

References CmdLineOptions::printHelp(), and printVersion().

Referenced by GenerateProcessor::generateProcessor(), and main().

Here is the call graph for this function:

◆ printVersion()

void MachInfoCmdLineOptions::printVersion ( ) const
virtual

Prints the version of the application.

Implements CmdLineOptions.

Definition at line 82 of file MachInfoCmdLineOptions.cc.

82  {
83  std::cout << "machinfo - processor design documentation generator "
84  << Application::TCEVersionString() << std::endl;
85 }

References Application::TCEVersionString().

Referenced by printHelp().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
CmdLineParser::numberOfArguments
virtual int numberOfArguments() const
MachInfoCmdLineOptions::printVersion
virtual void printVersion() const
Definition: MachInfoCmdLineOptions.cc:82
CmdLineParser::addOption
void addOption(CmdLineOptionParser *opt)
CmdLineOptions::CmdLineOptions
CmdLineOptions(std::string description, std::string version="")
Definition: CmdLineOptions.cc:73
CmdLineOptions::printHelp
virtual void printHelp() const
Definition: CmdLineOptions.cc:262
CmdLineOptionParser::String
virtual std::string String(int index=0) const
Definition: CmdLineOptionParser.cc:102
OUTPUT_FORMAT_PARAM_NAME
#define OUTPUT_FORMAT_PARAM_NAME
Definition: MachInfoCmdLineOptions.cc:40
CmdLineParser::findOption
CmdLineOptionParser * findOption(std::string name) const
Definition: CmdLineParser.cc:160
CmdLineParser::argument
virtual std::string argument(int index) const
Application::TCEVersionString
static std::string TCEVersionString()
Definition: Application.cc:510
StringCmdLineOptionParser
Definition: CmdLineOptionParser.hh:180
OUTPUTFN_PARAM_NAME
#define OUTPUTFN_PARAM_NAME
Definition: MachInfoCmdLineOptions.cc:39