Browse Source

Added CommandLine data accessors.

Branimir Karadžić 8 years ago
parent
commit
0aba6a7ba7
2 changed files with 16 additions and 0 deletions
  1. 6 0
      include/bx/commandline.h
  2. 10 0
      src/commandline.cpp

+ 6 - 0
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;

+ 10 - 0
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