1 #ifndef BALL_FORMAT_COMMANDLINEPARSER_H
2 #define BALL_FORMAT_COMMANDLINEPARSER_H
4 #ifndef BALL_DATATYPE_OPTIONS_H
8 #ifndef BALL_DATATYPE_STRING_H
12 #ifndef BALL_FORMAT_PARAMFILE_H
51 void setToolManual(
const String& manual);
62 void registerParameter(
String name,
String description, ParameterType type,
bool mandatory =
false,
String default_value =
"",
bool hidden =
false);
64 void registerFlag(
String name,
String description,
bool default_gui_value =
false,
bool hidden =
false);
66 void registerAdvancedParameters(
Options& options);
69 void setParameterAsAdvanced(
String name);
72 void setParameterRestrictions(
String par_name,
double min_value,
double max_value);
75 void setParameterRestrictions(
String par_name, list<String>& allowed_values);
86 void setOutputFormatSource(
String output_parname,
String input_parname);
92 void setSupportedFormats(
String par_name,
String supported_formats);
96 void parse(
int argc,
char* argv[]);
100 void copyAdvancedParametersToOptions(
Options& options);
117 const list<String>& getList(
String name);
123 void printHelp(
const std::set<String>& parameter_names = std::set<String>(),
bool show_manual =
true);
125 void printToolInfo();
127 const String& getStartTime();
131 const String& getStartCommand();
135 void replaceEscapedCharacters_(
String& parameter_value);
137 void checkAndRegisterParameter(
String name,
String description, ParameterType type,
bool mandatory =
false,
String default_value =
"",
bool perform_check =
true,
bool hidden=
false);
139 void checkAndRegisterFlag(
String name,
String description,
bool default_gui_value =
false,
bool perform_check =
true,
bool hidden=
false);
142 void validateRegisteredFilesHaveFormats();
145 void checkParameterName(
const String& name,
const bool perform_check =
true);
148 std::set<String> reserved_params_;
151 std::list<std::pair<String, String> > escaped_chars_;
152 std::map<String, list<String> > parameter_map_;
153 std::map<String, ParameterDescription> registered_parameters_;
155 std::map<String, ParameterDescription> registered_flags_;
156 typedef std::map<String, ParameterDescription>::iterator MapIterator;
157 std::list<MapIterator> original_parameter_order_;
158 std::list<MapIterator> original_flag_order_;
159 Size max_parname_length_;
160 Size max_flagname_length_;
173 #endif // BALL_FORMAT_COMMANDLINEPARSER_H
static const String NOT_FOUND
static const list< String > EMTPY_LIST