ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Cmdline Class Reference

#include <Support.hpp>

Public Member Functions

 Cmdline ()=delete
 
 Cmdline (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 25 of file Support.hpp.

Constructor & Destructor Documentation

◆ Cmdline() [1/2]

Cmdline::Cmdline ( )
delete

◆ Cmdline() [2/2]

Cmdline::Cmdline ( int  argc,
const char *const *  argv 
)
inline

Definition at line 29 of file Support.hpp.

29 : _argc(static_cast<unsigned int>(argc)), _argv{argv}
30 {
31 // DO NOTHING
32 }

Member Function Documentation

◆ get()

std::string Cmdline::get ( unsigned int  index) const

Definition at line 45 of file Support.cpp.

46{
47 if (index >= _argc)
48 throw std::runtime_error("Argument index out of bound");
49
50 return std::string(_argv[index]);
51}

◆ get_or()

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

Definition at line 53 of file Support.cpp.

54{
55 if (index >= _argc)
56 return s;
57
58 return std::string(_argv[index]);
59}

Referenced by make_ui().


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