From 0aba6a7ba7098f09c453a15c8bcced6010f60ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 25 Sep 2017 17:50:40 -0700 Subject: [PATCH] Added CommandLine data accessors. --- include/bx/commandline.h | 6 ++++++ src/commandline.cpp | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/bx/commandline.h b/include/bx/commandline.h index 9b9a397..61a7eb3 100644 --- a/include/bx/commandline.h +++ b/include/bx/commandline.h @@ -60,6 +60,12 @@ namespace bx /// bool hasArg(bool& _value, const char _short, const char* _long = NULL) const; + /// + int32_t getNum() const; + + /// + char const* get(int32_t _idx) const; + private: /// const char* find(int32_t _skip, const char _short, const char* _long, int32_t _numParams) const; diff --git a/src/commandline.cpp b/src/commandline.cpp index f29054d..2d12fbb 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -319,4 +319,14 @@ namespace bx return NULL; } + int32_t CommandLine::getNum() const + { + return m_argc; + } + + char const* CommandLine::get(int32_t _idx) const + { + return m_argv[_idx]; + } + } // namespace bx