00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef TERMINAL_TOOLS_PARSE_H_
00038 #define TERMINAL_TOOLS_PARSE_H_
00039
00040 #include <vector>
00041 #include <string>
00042 #include <string.h>
00043 #include <stdlib.h>
00044 #include <boost/algorithm/string.hpp>
00045
00046 namespace terminal_tools
00047 {
00049
00056 int parse_argument (int argc, char** argv, const char* str, std::string &val);
00057
00059
00066 int parse_argument (int argc, char** argv, const char* str, bool &val);
00067
00069
00076 int parse_argument (int argc, char** argv, const char* str, double &val);
00077
00079
00086 int parse_argument (int argc, char** argv, const char* str, int &val);
00087
00089
00096 int parse_argument (int argc, char** argv, const char* str, unsigned int &val);
00097
00099
00107 int parse_2x_arguments (int argc, char** argv, const char* str, double &f, double &s, bool debug = true);
00108
00110
00118 int parse_2x_arguments (int argc, char** argv, const char* str, int &f, int &s, bool debug = true);
00119
00121
00130 int parse_3x_arguments (int argc, char** argv, const char* str, double &f, double &s, double &t, bool debug = true);
00131
00133
00142 int parse_3x_arguments (int argc, char** argv, const char* str, int &f, int &s, int &t, bool debug = true);
00143
00145
00152 bool parse_multiple_arguments (int argc, char** argv, const char* str, std::vector<int> &values);
00153
00155
00162 bool parse_multiple_arguments (int argc, char** argv, const char* str, std::vector<double> &values);
00163
00165
00174 bool parse_multiple_2x_arguments (int argc, char** argv, const char* str, std::vector<double> &values_f, std::vector<double> &values_s);
00175
00177
00187 bool parse_multiple_3x_arguments (int argc, char** argv, const char* str, std::vector<double> &values_f, std::vector<double> &values_s, std::vector<double> &values_t);
00188
00190
00196 std::vector<int> parse_file_extension_argument (int argc, char** argv, const std::string &ext);
00197 }
00198
00199 #endif