ONE - On-device Neural Engine
Loading...
Searching...
No Matches
tfkit::CmdArguments Class Reference

#include <Support.hpp>

Public Member Functions

 CmdArguments ()=delete
 
 CmdArguments (int argc, const char *const *argv)
 
std::string get (unsigned int index) const
 
std::string get_or (unsigned int index, const std::string &) const
 

Detailed Description

Definition at line 39 of file Support.hpp.

Constructor & Destructor Documentation

◆ CmdArguments() [1/2]

tfkit::CmdArguments::CmdArguments ( )
delete

◆ CmdArguments() [2/2]

tfkit::CmdArguments::CmdArguments ( int  argc,
const char *const *  argv 
)
inline

Definition at line 43 of file Support.hpp.

44 : _argc(static_cast<unsigned int>(argc)), _argv{argv}
45 {
46 }

Member Function Documentation

◆ get()

std::string tfkit::CmdArguments::get ( unsigned int  index) const

Definition at line 95 of file Support.cpp.

96{
97 if (index >= _argc)
98 throw std::runtime_error("Argument index out of bound");
99
100 return std::string(_argv[index]);
101}

◆ get_or()

std::string tfkit::CmdArguments::get_or ( unsigned int  index,
const std::string &  s 
) const

Definition at line 103 of file Support.cpp.

104{
105 if (index >= _argc)
106 return s;
107
108 return std::string(_argv[index]);
109}

Referenced by tfkit::make_ioconfig().


The documentation for this class was generated from the following files: