From e12c89e8c9896b2e5cdd70dbd2d2acb449ff4b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 13 Jan 2018 14:01:53 +0100 Subject: bullet: Streamline bundling, remove extraneous src/ folder Document version and how to extract sources in thirdparty/README.md. Drop unnecessary CMake and Premake files. Simplify SCsub, drop unused one. --- .../bullet/src/Bullet3Common/b3CommandLineArgs.h | 101 --------------------- 1 file changed, 101 deletions(-) delete mode 100644 thirdparty/bullet/src/Bullet3Common/b3CommandLineArgs.h (limited to 'thirdparty/bullet/src/Bullet3Common/b3CommandLineArgs.h') diff --git a/thirdparty/bullet/src/Bullet3Common/b3CommandLineArgs.h b/thirdparty/bullet/src/Bullet3Common/b3CommandLineArgs.h deleted file mode 100644 index 38df8e2600..0000000000 --- a/thirdparty/bullet/src/Bullet3Common/b3CommandLineArgs.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef COMMAND_LINE_ARGS_H -#define COMMAND_LINE_ARGS_H - -/****************************************************************************** - * Command-line parsing - ******************************************************************************/ -#include -#include -#include -#include -#include -class b3CommandLineArgs -{ -protected: - - std::map pairs; - -public: - - // Constructor - b3CommandLineArgs(int argc, char **argv) - { - addArgs(argc,argv); - } - - void addArgs(int argc, char**argv) - { - for (int i = 1; i < argc; i++) - { - std::string arg = argv[i]; - - if ((arg.length() < 2) || (arg[0] != '-') || (arg[1] != '-')) { - continue; - } - - std::string::size_type pos; - std::string key, val; - if ((pos = arg.find( '=')) == std::string::npos) { - key = std::string(arg, 2, arg.length() - 2); - val = ""; - } else { - key = std::string(arg, 2, pos - 2); - val = std::string(arg, pos + 1, arg.length() - 1); - } - - //only add new keys, don't replace existing - if(pairs.find(key) == pairs.end()) - { - pairs[key] = val; - } - } - } - - bool CheckCmdLineFlag(const char* arg_name) - { - std::map::iterator itr; - if ((itr = pairs.find(arg_name)) != pairs.end()) { - return true; - } - return false; - } - - template - bool GetCmdLineArgument(const char *arg_name, T &val); - - int ParsedArgc() - { - return pairs.size(); - } -}; - -template -inline bool b3CommandLineArgs::GetCmdLineArgument(const char *arg_name, T &val) -{ - std::map::iterator itr; - if ((itr = pairs.find(arg_name)) != pairs.end()) { - std::istringstream strstream(itr->second); - strstream >> val; - return true; - } - return false; -} - -template <> -inline bool b3CommandLineArgs::GetCmdLineArgument(const char* arg_name, char* &val) -{ - std::map::iterator itr; - if ((itr = pairs.find(arg_name)) != pairs.end()) { - - std::string s = itr->second; - val = (char*) malloc(sizeof(char) * (s.length() + 1)); - std::strcpy(val, s.c_str()); - return true; - } else { - val = NULL; - } - return false; -} - - -#endif //COMMAND_LINE_ARGS_H -- cgit v1.2.3