diff --git a/docs/CmdArgsInterface_8cpp.html b/docs/CmdArgsInterface_8cpp.html index ecd3961..e3c1fc6 100644 --- a/docs/CmdArgsInterface_8cpp.html +++ b/docs/CmdArgsInterface_8cpp.html @@ -94,29 +94,30 @@ Include dependency graph for CmdArgsInterface.cpp:
- - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
@@ -124,7 +125,7 @@ Include dependency graph for CmdArgsInterface.cpp: diff --git a/docs/CmdArgsInterface_8cpp__incl.map b/docs/CmdArgsInterface_8cpp__incl.map index b1dc058..d5a35e7 100644 --- a/docs/CmdArgsInterface_8cpp__incl.map +++ b/docs/CmdArgsInterface_8cpp__incl.map @@ -1,25 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/CmdArgsInterface_8cpp__incl.md5 b/docs/CmdArgsInterface_8cpp__incl.md5 index 24371fc..dacd236 100644 --- a/docs/CmdArgsInterface_8cpp__incl.md5 +++ b/docs/CmdArgsInterface_8cpp__incl.md5 @@ -1 +1 @@ -1e52877c77530f8b60cf62a9418ab996 \ No newline at end of file +48e8cf6b9c7c3f6e58426b78b0d50f5b \ No newline at end of file diff --git a/docs/CmdArgsInterface_8cpp__incl.png b/docs/CmdArgsInterface_8cpp__incl.png index 3c76f10..3e1c36e 100644 Binary files a/docs/CmdArgsInterface_8cpp__incl.png and b/docs/CmdArgsInterface_8cpp__incl.png differ diff --git a/docs/CmdArgsInterface_8cpp_source.html b/docs/CmdArgsInterface_8cpp_source.html index 958357d..cdec273 100644 --- a/docs/CmdArgsInterface_8cpp_source.html +++ b/docs/CmdArgsInterface_8cpp_source.html @@ -125,595 +125,642 @@ $(function() {
45 
46  executableName = std::string(rawArgs[0]);
47 
-
48  std::size_t i = 1;
-
49  while (i < rawArgs.size())
-
50  {
-
51  if ((rawArgs[i].length() > 2) && (rawArgs[i].substr(0, 2) == "--"))
-
52  {
-
53  Parameter* param = nullptr;
-
54  i = ParseNextParameter(i, param);
-
55 
-
56  parameters.insert(std::pair<std::string, Parameter*>(param->Key(), param));
-
57  }
-
58  else
-
59  i++;
-
60  }
-
61 
-
62  // Apply constraints such as default values, and required parameters.
-
63  // Types have already been enforced.
-
64  // Dont apply constraints when we are just printind the param docs
-
65  if ((!catchHelp) || (!HasParam("--help")))
-
66  ApplyConstraints();
-
67  }
-
68  catch (const HazelnuppConstraintTypeMissmatch& exc)
-
69  {
-
70  if (crashOnFail)
-
71  {
-
72  std::cout << GenerateDocumentation() << std::endl << std::endl;
-
73  std::cerr << "Parameter error: " << exc.What() << std::endl;
-
74  quick_exit(-1009);
-
75  }
-
76  else
-
77  throw exc; // yeet
-
78  }
-
79  catch (const HazelnuppConstraintMissingValue& exc)
-
80  {
-
81  if (crashOnFail)
-
82  {
-
83  std::cout << GenerateDocumentation() << std::endl << std::endl;
-
84  std::cerr << "Parameter error: " << exc.What() << std::endl;
-
85  quick_exit(-1010);
-
86  }
-
87  else
-
88  throw exc; // yeet
-
89  }
-
90 
-
91  // Catch --help parameter
-
92  if ((catchHelp) && (HasParam("--help")))
-
93  {
-
94  std::cout << GenerateDocumentation() << std::endl;
-
95  quick_exit(0);
-
96  }
-
97 
-
98  return;
-
99 }
-
100 
-
101 std::size_t CmdArgsInterface::ParseNextParameter(const std::size_t parIndex, Parameter*& out_Par)
-
102 {
-
103  std::size_t i = parIndex;
-
104  const std::string key = rawArgs[parIndex];
-
105  std::vector<std::string> values;
-
106 
-
107  // Get values
-
108  for (i++; i < rawArgs.size(); i++)
-
109  // If not another parameter
-
110  if ((rawArgs[i].length() < 2) || (rawArgs[i].substr(0, 2) != "--"))
-
111  values.emplace_back(rawArgs[i]);
-
112  else
-
113  {
-
114  break;
-
115  }
-
116 
-
117  // Fetch constraint info
-
118  const ParamConstraint* pcn = GetConstraintForKey(key);
-
119 
-
120  Value* parsedVal = ParseValue(values, pcn);
-
121  if (parsedVal != nullptr)
-
122  {
-
123  out_Par = new Parameter(key, parsedVal);
+
48  // Read and parse all parameters
+
49  std::size_t i = 1;
+
50  while (i < rawArgs.size())
+
51  {
+
52  if ((rawArgs[i].length() > 2) && (rawArgs[i].substr(0, 2) == "--"))
+
53  {
+
54  Parameter* param = nullptr;
+
55  i = ParseNextParameter(i, param);
+
56 
+
57  parameters.insert(std::pair<std::string, Parameter*>(param->Key(), param));
+
58  }
+
59  else
+
60  i++;
+
61  }
+
62 
+
63  // Apply constraints such as default values, and required parameters.
+
64  // Types have already been enforced.
+
65  // Dont apply constraints when we are just printind the param docs
+
66  if ((!catchHelp) || (!HasParam("--help")))
+
67  ApplyConstraints();
+
68  }
+
69  catch (const HazelnuppConstraintIncompatibleParameters& exc)
+
70  {
+
71  if (crashOnFail)
+
72  {
+
73  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
74  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
75  quick_exit(-1000);
+
76  }
+
77  else
+
78  throw exc; // yeet
+
79  }
+
80  catch (const HazelnuppConstraintMissingValue& exc)
+
81  {
+
82  if (crashOnFail)
+
83  {
+
84  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
85  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
86  quick_exit(-1001);
+
87  }
+
88  else
+
89  throw exc; // yeet
+
90  }
+
91  catch (const HazelnuppConstraintTypeMissmatch& exc)
+
92  {
+
93  if (crashOnFail)
+
94  {
+
95  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
96  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
97  quick_exit(-1002);
+
98  }
+
99  else
+
100  throw exc; // yeet
+
101  }
+
102  catch (const HazelnuppConstraintException& exc)
+
103  {
+
104  if (crashOnFail)
+
105  {
+
106  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
107  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
108  quick_exit(-1003);
+
109  }
+
110  else
+
111  throw exc; // yeet
+
112  }
+
113  catch (const HazelnuppException& exc)
+
114  {
+
115  if (crashOnFail)
+
116  {
+
117  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
118  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
119  quick_exit(-1004);
+
120  }
+
121  else
+
122  throw exc; // yeet
+
123  }
124 
-
125  delete parsedVal;
-
126  parsedVal = nullptr;
-
127  }
-
128  else
-
129  throw std::runtime_error("Unable to parse parameter!");
-
130 
-
131  return i;
-
132 }
-
133 
-
134 void CmdArgsInterface::PopulateRawArgs(const int argc, const char* const* argv)
-
135 {
-
136  rawArgs.clear();
-
137  rawArgs.reserve(argc);
-
138 
-
139  for (int i = 0; i < argc; i++)
-
140  rawArgs.emplace_back(std::string(argv[i]));
-
141 
-
142  return;
-
143 }
-
144 
-
145 void CmdArgsInterface::ExpandAbbreviations()
-
146 {
-
147  // Abort if no abbreviations
-
148  if (parameterAbreviations.size() == 0)
-
149  return;
+
125  // Catch --help parameter
+
126  if ((catchHelp) && (HasParam("--help")))
+
127  {
+
128  std::cout << GenerateDocumentation() << std::endl;
+
129  quick_exit(0);
+
130  }
+
131 
+
132  return;
+
133 }
+
134 
+
135 std::size_t CmdArgsInterface::ParseNextParameter(const std::size_t parIndex, Parameter*& out_Par)
+
136 {
+
137  std::size_t i = parIndex;
+
138  const std::string key = rawArgs[parIndex];
+
139  std::vector<std::string> values;
+
140 
+
141  // Get values
+
142  for (i++; i < rawArgs.size(); i++)
+
143  // If not another parameter
+
144  if ((rawArgs[i].length() < 2) || (rawArgs[i].substr(0, 2) != "--"))
+
145  values.emplace_back(rawArgs[i]);
+
146  else
+
147  {
+
148  break;
+
149  }
150 
-
151  for (std::string& arg : rawArgs)
-
152  {
-
153  // Is arg registered as an abbreviation?
-
154  auto abbr = parameterAbreviations.find(arg);
-
155  if (abbr != parameterAbreviations.end())
-
156  {
-
157  // Yes: replace arg with the long form
-
158  arg = abbr->second;
-
159  }
-
160  }
-
161 
-
162  return;
-
163 }
+
151  // Fetch constraint info
+
152  const ParamConstraint* pcn = GetConstraintForKey(key);
+
153 
+
154  Value* parsedVal = ParseValue(values, pcn);
+
155  if (parsedVal != nullptr)
+
156  {
+
157  out_Par = new Parameter(key, parsedVal);
+
158 
+
159  delete parsedVal;
+
160  parsedVal = nullptr;
+
161  }
+
162  else
+
163  throw std::runtime_error("Unable to parse parameter!");
164 
-
165 bool CmdArgsInterface::HasParam(const std::string& key) const
-
166 {
-
167  return parameters.find(key) != parameters.end();
-
168 }
-
169 
-
170 Value* CmdArgsInterface::ParseValue(const std::vector<std::string>& values, const ParamConstraint* constraint)
-
171 {
-
172  // This is the raw (unconverted) data type the user provided
-
173  DATA_TYPE rawInputType;
-
174 
-
175  // Constraint values
-
176  const bool constrainType = (constraint != nullptr) && (constraint->constrainType);
-
177 
-
178  // Void-type
-
179  if (values.size() == 0)
-
180  {
-
181  rawInputType = DATA_TYPE::VOID;
-
182 
-
183  // Is a list forced via a constraint? If yes, return an empty list
-
184  if ((constrainType) &&
-
185  (constraint->requiredType == DATA_TYPE::LIST))
-
186  return new ListValue();
-
187 
-
188  // Is a string forced via a constraint? If yes, return an empty string
-
189  else if ((constrainType) &&
-
190  (constraint->requiredType == DATA_TYPE::STRING))
-
191  return new StringValue("");
-
192 
-
193  // Is an int or float forced via constraint? If yes, throw an exception
-
194  else if ((constrainType) &&
-
195  ((constraint->requiredType == DATA_TYPE::INT) ||
-
196  (constraint->requiredType == DATA_TYPE::FLOAT)))
-
197  throw HazelnuppConstraintTypeMissmatch(
-
198  constraint->key,
-
199  constraint->requiredType,
-
200  rawInputType,
-
201  GetDescription(constraint->key)
-
202  );
+
165  return i;
+
166 }
+
167 
+
168 void CmdArgsInterface::PopulateRawArgs(const int argc, const char* const* argv)
+
169 {
+
170  rawArgs.clear();
+
171  rawArgs.reserve(argc);
+
172 
+
173  for (int i = 0; i < argc; i++)
+
174  rawArgs.emplace_back(std::string(argv[i]));
+
175 
+
176  return;
+
177 }
+
178 
+
179 void CmdArgsInterface::ExpandAbbreviations()
+
180 {
+
181  // Abort if no abbreviations
+
182  if (parameterAbreviations.size() == 0)
+
183  return;
+
184 
+
185  for (std::string& arg : rawArgs)
+
186  {
+
187  // Is arg registered as an abbreviation?
+
188  auto abbr = parameterAbreviations.find(arg);
+
189  if (abbr != parameterAbreviations.end())
+
190  {
+
191  // Yes: replace arg with the long form
+
192  arg = abbr->second;
+
193  }
+
194  }
+
195 
+
196  return;
+
197 }
+
198 
+
199 bool CmdArgsInterface::HasParam(const std::string& key) const
+
200 {
+
201  return parameters.find(key) != parameters.end();
+
202 }
203 
-
204  // Else, just return the void type
-
205  return new VoidValue;
-
206  }
-
207 
-
208  // Force void type by constraint
-
209  else if ((constrainType) &&
-
210  (constraint->requiredType == DATA_TYPE::VOID))
-
211  {
-
212  return new VoidValue;
-
213  }
-
214 
-
215  // List-type
-
216  else if (values.size() > 1)
-
217  {
-
218  rawInputType = DATA_TYPE::LIST;
-
219 
-
220  // Should the type be something other than list?
-
221  if ((constrainType) &&
-
222  (constraint->requiredType != DATA_TYPE::LIST))
-
223  {
-
224  throw HazelnuppConstraintTypeMissmatch(
-
225  constraint->key,
-
226  constraint->requiredType,
-
227  rawInputType,
-
228  GetDescription(constraint->key)
-
229  );
-
230  }
-
231 
-
232  ListValue* newList = new ListValue();
-
233  for (const std::string& val : values)
-
234  {
-
235  Value* tmp = ParseValue({ val });
-
236  newList->AddValue(tmp);
-
237  delete tmp;
-
238  }
-
239  return newList;
+
204 Value* CmdArgsInterface::ParseValue(const std::vector<std::string>& values, const ParamConstraint* constraint)
+
205 {
+
206  // This is the raw (unconverted) data type the user provided
+
207  DATA_TYPE rawInputType;
+
208 
+
209  // Constraint values
+
210  const bool constrainType = (constraint != nullptr) && (constraint->constrainType);
+
211 
+
212  // Void-type
+
213  if (values.size() == 0)
+
214  {
+
215  rawInputType = DATA_TYPE::VOID;
+
216 
+
217  // Is a list forced via a constraint? If yes, return an empty list
+
218  if ((constrainType) &&
+
219  (constraint->requiredType == DATA_TYPE::LIST))
+
220  return new ListValue();
+
221 
+
222  // Is a string forced via a constraint? If yes, return an empty string
+
223  else if ((constrainType) &&
+
224  (constraint->requiredType == DATA_TYPE::STRING))
+
225  return new StringValue("");
+
226 
+
227  // Is an int or float forced via constraint? If yes, throw an exception
+
228  else if ((constrainType) &&
+
229  ((constraint->requiredType == DATA_TYPE::INT) ||
+
230  (constraint->requiredType == DATA_TYPE::FLOAT)))
+
231  throw HazelnuppConstraintTypeMissmatch(
+
232  constraint->key,
+
233  constraint->requiredType,
+
234  rawInputType,
+
235  GetDescription(constraint->key)
+
236  );
+
237 
+
238  // Else, just return the void type
+
239  return new VoidValue;
240  }
241 
-
242  // Now we're only dealing with a single value
-
243  const std::string& val = values[0];
-
244 
-
245  // String
-
246  if (!Internal::StringTools::IsNumeric(val, true))
-
247  {
-
248  rawInputType = DATA_TYPE::STRING;
-
249 
-
250  // Is the type not supposed to be a string?
-
251  // void and list are already sorted out
-
252  if ((constrainType) &&
-
253  (constraint->requiredType != DATA_TYPE::STRING))
-
254  {
-
255  // We can only force a list-value from here
-
256  if (constraint->requiredType == DATA_TYPE::LIST)
-
257  {
-
258  ListValue* list = new ListValue();
-
259  Value* tmp = ParseValue({ val });
-
260  list->AddValue(tmp);
-
261  delete tmp;
-
262  tmp = nullptr;
-
263  return list;
-
264  }
-
265  // Else it is not possible to convert to a numeric
-
266  else
-
267  throw HazelnuppConstraintTypeMissmatch(
-
268  constraint->key,
-
269  constraint->requiredType,
-
270  rawInputType,
-
271  GetDescription(constraint->key)
-
272  );
-
273  }
-
274 
-
275  return new StringValue(val);
-
276  }
-
277 
-
278  // In this case we have a numeric value.
-
279  // We should still produce a string if requested
-
280  if ((constrainType) &&
-
281  (constraint->requiredType == DATA_TYPE::STRING))
-
282  return new StringValue(val);
+
242  // Force void type by constraint
+
243  else if ((constrainType) &&
+
244  (constraint->requiredType == DATA_TYPE::VOID))
+
245  {
+
246  return new VoidValue;
+
247  }
+
248 
+
249  // List-type
+
250  else if (values.size() > 1)
+
251  {
+
252  rawInputType = DATA_TYPE::LIST;
+
253 
+
254  // Should the type be something other than list?
+
255  if ((constrainType) &&
+
256  (constraint->requiredType != DATA_TYPE::LIST))
+
257  {
+
258  throw HazelnuppConstraintTypeMissmatch(
+
259  constraint->key,
+
260  constraint->requiredType,
+
261  rawInputType,
+
262  GetDescription(constraint->key)
+
263  );
+
264  }
+
265 
+
266  ListValue* newList = new ListValue();
+
267  for (const std::string& val : values)
+
268  {
+
269  Value* tmp = ParseValue({ val });
+
270  newList->AddValue(tmp);
+
271  delete tmp;
+
272  }
+
273  return newList;
+
274  }
+
275 
+
276  // Now we're only dealing with a single value
+
277  const std::string& val = values[0];
+
278 
+
279  // String
+
280  if (!Internal::StringTools::IsNumeric(val, true))
+
281  {
+
282  rawInputType = DATA_TYPE::STRING;
283 
-
284  // Numeric
-
285  bool isInt;
-
286  long double num;
-
287 
-
288  if (Internal::StringTools::ParseNumber(val, isInt, num))
-
289  {
-
290  rawInputType = isInt ? DATA_TYPE::INT : DATA_TYPE::FLOAT;
-
291 
-
292  // Is the type constrained?
-
293  // (only int and float left)
-
294  if (constrainType)
-
295  {
-
296  // Must it be an integer?
-
297  if (constraint->requiredType == DATA_TYPE::INT)
-
298  return new IntValue((long long int)num);
-
299  // Must it be a floating point?
-
300  else if (constraint->requiredType == DATA_TYPE::FLOAT)
-
301  return new FloatValue(num);
-
302  // Else it must be a List
-
303  else
-
304  {
-
305  ListValue* list = new ListValue();
-
306  Value* tmp = ParseValue({ val });
-
307  list->AddValue(tmp);
-
308  delete tmp;
-
309  tmp = nullptr;
-
310  return list;
-
311  }
-
312  }
-
313  // Type is not constrained
-
314  else
-
315  {
-
316  // Integer
-
317  if (isInt)
-
318  return new IntValue((long long int)num);
-
319 
-
320  // Double
-
321  return new FloatValue(num);
-
322  }
-
323  }
-
324 
-
325  // Failed
-
326  return nullptr;
-
327 }
-
328 
-
329 bool CmdArgsInterface::GetCrashOnFail() const
-
330 {
-
331  return crashOnFail;
-
332 }
-
333 
-
334 void CmdArgsInterface::SetCatchHelp(bool catchHelp)
-
335 {
-
336  this->catchHelp = catchHelp;
-
337  return;
-
338 }
-
339 
-
340 bool CmdArgsInterface::GetCatchHelp() const
-
341 {
-
342  return catchHelp;
-
343 }
-
344 
-
345 void CmdArgsInterface::SetBriefDescription(const std::string& description)
-
346 {
-
347  briefDescription = description;
-
348  return;
-
349 }
-
350 
-
351 const std::string& CmdArgsInterface::GetBriefDescription()
-
352 {
-
353  return briefDescription;
-
354 }
-
355 
-
356 void Hazelnp::CmdArgsInterface::RegisterDescription(const std::string& parameter, const std::string& description)
-
357 {
-
358  parameterDescriptions[parameter] = description;
-
359  return;
-
360 }
-
361 
-
362 const std::string& Hazelnp::CmdArgsInterface::GetDescription(const std::string& parameter) const
-
363 {
-
364  // Do we already have a description for this parameter?
-
365  if (!HasDescription(parameter))
-
366  // No? Then return ""
-
367  return Placeholders::g_emptyString;
-
368 
-
369  // We do? Then return it
-
370  return parameterDescriptions.find(parameter)->second;
-
371 }
-
372 
-
373 bool CmdArgsInterface::HasDescription(const std::string& parameter) const
-
374 {
-
375  return parameterDescriptions.find(parameter) != parameterDescriptions.end();
-
376 }
-
377 
-
378 void CmdArgsInterface::ClearDescription(const std::string& parameter)
-
379 {
-
380  // This will just do nothing if the entry does not exist
-
381  parameterDescriptions.erase(parameter);
+
284  // Is the type not supposed to be a string?
+
285  // void and list are already sorted out
+
286  if ((constrainType) &&
+
287  (constraint->requiredType != DATA_TYPE::STRING))
+
288  {
+
289  // We can only force a list-value from here
+
290  if (constraint->requiredType == DATA_TYPE::LIST)
+
291  {
+
292  ListValue* list = new ListValue();
+
293  Value* tmp = ParseValue({ val });
+
294  list->AddValue(tmp);
+
295  delete tmp;
+
296  tmp = nullptr;
+
297  return list;
+
298  }
+
299  // Else it is not possible to convert to a numeric
+
300  else
+
301  throw HazelnuppConstraintTypeMissmatch(
+
302  constraint->key,
+
303  constraint->requiredType,
+
304  rawInputType,
+
305  GetDescription(constraint->key)
+
306  );
+
307  }
+
308 
+
309  return new StringValue(val);
+
310  }
+
311 
+
312  // In this case we have a numeric value.
+
313  // We should still produce a string if requested
+
314  if ((constrainType) &&
+
315  (constraint->requiredType == DATA_TYPE::STRING))
+
316  return new StringValue(val);
+
317 
+
318  // Numeric
+
319  bool isInt;
+
320  long double num;
+
321 
+
322  if (Internal::StringTools::ParseNumber(val, isInt, num))
+
323  {
+
324  rawInputType = isInt ? DATA_TYPE::INT : DATA_TYPE::FLOAT;
+
325 
+
326  // Is the type constrained?
+
327  // (only int and float left)
+
328  if (constrainType)
+
329  {
+
330  // Must it be an integer?
+
331  if (constraint->requiredType == DATA_TYPE::INT)
+
332  return new IntValue((long long int)num);
+
333  // Must it be a floating point?
+
334  else if (constraint->requiredType == DATA_TYPE::FLOAT)
+
335  return new FloatValue(num);
+
336  // Else it must be a List
+
337  else
+
338  {
+
339  ListValue* list = new ListValue();
+
340  Value* tmp = ParseValue({ val });
+
341  list->AddValue(tmp);
+
342  delete tmp;
+
343  tmp = nullptr;
+
344  return list;
+
345  }
+
346  }
+
347  // Type is not constrained
+
348  else
+
349  {
+
350  // Integer
+
351  if (isInt)
+
352  return new IntValue((long long int)num);
+
353 
+
354  // Double
+
355  return new FloatValue(num);
+
356  }
+
357  }
+
358 
+
359  // Failed
+
360  return nullptr;
+
361 }
+
362 
+
363 bool CmdArgsInterface::GetCrashOnFail() const
+
364 {
+
365  return crashOnFail;
+
366 }
+
367 
+
368 void CmdArgsInterface::SetCatchHelp(bool catchHelp)
+
369 {
+
370  this->catchHelp = catchHelp;
+
371  return;
+
372 }
+
373 
+
374 bool CmdArgsInterface::GetCatchHelp() const
+
375 {
+
376  return catchHelp;
+
377 }
+
378 
+
379 void CmdArgsInterface::SetBriefDescription(const std::string& description)
+
380 {
+
381  briefDescription = description;
382  return;
383 }
384 
-
385 void Hazelnp::CmdArgsInterface::ClearDescriptions()
+
385 const std::string& CmdArgsInterface::GetBriefDescription()
386 {
-
387  parameterDescriptions.clear();
-
388  return;
-
389 }
-
390 
-
391 std::string CmdArgsInterface::GenerateDocumentation() const
-
392 {
-
393  std::stringstream ss;
-
394 
-
395  // Add brief, if available
-
396  if (briefDescription.length() > 0)
-
397  ss << briefDescription << std::endl;
-
398 
-
399  // Collect parameter information
-
400  struct ParamDocEntry
-
401  {
-
402  std::string abbreviation;
-
403  std::string description;
-
404  std::string type;
-
405  bool required = false;
-
406  bool typeIsForced = false;
-
407  std::string defaultVal;
-
408  };
-
409  std::unordered_map<std::string, ParamDocEntry> paramInfos;
-
410 
-
411  // Collect descriptions
-
412  for (const auto& it : parameterDescriptions)
-
413  {
-
414  // Do we already have that param in the paramInfo set?
-
415  if (paramInfos.find(it.first) == paramInfos.end())
-
416  // No? Create it.
-
417  paramInfos[it.first] = ParamDocEntry();
+
387  return briefDescription;
+
388 }
+
389 
+
390 void Hazelnp::CmdArgsInterface::RegisterDescription(const std::string& parameter, const std::string& description)
+
391 {
+
392  parameterDescriptions[parameter] = description;
+
393  return;
+
394 }
+
395 
+
396 const std::string& Hazelnp::CmdArgsInterface::GetDescription(const std::string& parameter) const
+
397 {
+
398  // Do we already have a description for this parameter?
+
399  if (!HasDescription(parameter))
+
400  // No? Then return ""
+
401  return Placeholders::g_emptyString;
+
402 
+
403  // We do? Then return it
+
404  return parameterDescriptions.find(parameter)->second;
+
405 }
+
406 
+
407 bool CmdArgsInterface::HasDescription(const std::string& parameter) const
+
408 {
+
409  return parameterDescriptions.find(parameter) != parameterDescriptions.end();
+
410 }
+
411 
+
412 void CmdArgsInterface::ClearDescription(const std::string& parameter)
+
413 {
+
414  // This will just do nothing if the entry does not exist
+
415  parameterDescriptions.erase(parameter);
+
416  return;
+
417 }
418 
-
419  paramInfos[it.first].description = it.second;
-
420  }
-
421 
-
422  // Collect abbreviations
-
423  // first value is abbreviation, second is long form
-
424  for (const auto& it : parameterAbreviations)
-
425  {
-
426  // Do we already have that param in the paramInfo set?
-
427  if (paramInfos.find(it.second) == paramInfos.end())
-
428  // No? Create it.
-
429  paramInfos[it.second] = ParamDocEntry();
-
430 
-
431  paramInfos[it.second].abbreviation = it.first;
-
432  }
-
433 
-
434  // Collect constraints
-
435  for (const auto& it : parameterConstraints)
-
436  {
-
437  // Do we already have that param in the paramInfo set?
-
438  if (paramInfos.find(it.first) == paramInfos.end())
-
439  // No? Create it.
-
440  paramInfos[it.first] = ParamDocEntry();
-
441 
-
442  ParamDocEntry& cached = paramInfos[it.first];
-
443  cached.required = it.second.required;
-
444  cached.typeIsForced = it.second.constrainType;
-
445  cached.type = DataTypeToString(it.second.requiredType);
-
446 
-
447  std::stringstream defaultValueSs;
-
448  for (const std::string& s : it.second.defaultValue)
-
449  {
-
450  defaultValueSs << '\'' << s << '\'';
-
451 
-
452  // Add a space if we are not at the last entry
-
453  if ((void*)&s != (void*)&it.second.defaultValue.back())
-
454  defaultValueSs << " ";
-
455  }
-
456  cached.defaultVal = defaultValueSs.str();
-
457  }
-
458 
-
459  // Now generate the documentatino body
-
460  if (paramInfos.size() > 0)
-
461  {
-
462  ss << std::endl
-
463  << "==== AVAILABLE PARAMETERS ===="
-
464  << std::endl << std::endl;
-
465 
-
466  std::size_t counter = 0;
-
467  for (const auto& it : paramInfos)
-
468  {
-
469  const ParamDocEntry& pde = it.second;
-
470 
-
471  // Put name
-
472  ss << it.first << " ";
-
473 
-
474  // Put abbreviation
-
475  if (pde.abbreviation.length() > 0)
-
476  ss << pde.abbreviation << " ";
-
477 
-
478  // Put type
-
479  if (pde.typeIsForced)
-
480  ss << pde.type << " ";
-
481 
-
482  // Put default value
-
483  if (pde.defaultVal.length() > 0)
-
484  ss << "default=[" << pde.defaultVal << "] ";
+
419 void Hazelnp::CmdArgsInterface::ClearDescriptions()
+
420 {
+
421  parameterDescriptions.clear();
+
422  return;
+
423 }
+
424 
+
425 std::string CmdArgsInterface::GenerateDocumentation() const
+
426 {
+
427  std::stringstream ss;
+
428 
+
429  // Add brief, if available
+
430  if (briefDescription.length() > 0)
+
431  ss << briefDescription << std::endl;
+
432 
+
433  // Collect parameter information
+
434  struct ParamDocEntry
+
435  {
+
436  std::string abbreviation;
+
437  std::string description;
+
438  std::string type;
+
439  bool required = false;
+
440  bool typeIsForced = false;
+
441  std::string defaultVal;
+
442  };
+
443  std::unordered_map<std::string, ParamDocEntry> paramInfos;
+
444 
+
445  // Collect descriptions
+
446  for (const auto& it : parameterDescriptions)
+
447  {
+
448  // Do we already have that param in the paramInfo set?
+
449  if (paramInfos.find(it.first) == paramInfos.end())
+
450  // No? Create it.
+
451  paramInfos[it.first] = ParamDocEntry();
+
452 
+
453  paramInfos[it.first].description = it.second;
+
454  }
+
455 
+
456  // Collect abbreviations
+
457  // first value is abbreviation, second is long form
+
458  for (const auto& it : parameterAbreviations)
+
459  {
+
460  // Do we already have that param in the paramInfo set?
+
461  if (paramInfos.find(it.second) == paramInfos.end())
+
462  // No? Create it.
+
463  paramInfos[it.second] = ParamDocEntry();
+
464 
+
465  paramInfos[it.second].abbreviation = it.first;
+
466  }
+
467 
+
468  // Collect constraints
+
469  for (const auto& it : parameterConstraints)
+
470  {
+
471  // Do we already have that param in the paramInfo set?
+
472  if (paramInfos.find(it.first) == paramInfos.end())
+
473  // No? Create it.
+
474  paramInfos[it.first] = ParamDocEntry();
+
475 
+
476  ParamDocEntry& cached = paramInfos[it.first];
+
477  cached.required = it.second.required;
+
478  cached.typeIsForced = it.second.constrainType;
+
479  cached.type = DataTypeToString(it.second.requiredType);
+
480 
+
481  std::stringstream defaultValueSs;
+
482  for (const std::string& s : it.second.defaultValue)
+
483  {
+
484  defaultValueSs << '\'' << s << '\'';
485 
-
486  // Put required tag, but only if no default value
-
487  if ((pde.required) && (pde.defaultVal.length() == 0))
-
488  ss << "[[REQUIRED]] ";
-
489 
-
490  // Put brief description
-
491  if (pde.description.length() > 0)
-
492  ss << pde.description;
-
493 
-
494  // Omit linebreaks when we're on the last element
-
495  if (counter < paramInfos.size()-1)
-
496  ss << std::endl << std::endl;
-
497 
-
498  counter++;
-
499  }
-
500  }
-
501 
-
502  return ss.str();
-
503 }
+
486  // Add a space if we are not at the last entry
+
487  if ((void*)&s != (void*)&it.second.defaultValue.back())
+
488  defaultValueSs << " ";
+
489  }
+
490  cached.defaultVal = defaultValueSs.str();
+
491  }
+
492 
+
493  // Now generate the documentatino body
+
494  if (paramInfos.size() > 0)
+
495  {
+
496  ss << std::endl
+
497  << "==== AVAILABLE PARAMETERS ===="
+
498  << std::endl << std::endl;
+
499 
+
500  std::size_t counter = 0;
+
501  for (const auto& it : paramInfos)
+
502  {
+
503  const ParamDocEntry& pde = it.second;
504 
-
505 void CmdArgsInterface::ApplyConstraints()
-
506 {
-
507  // Enforce required parameters / default values
-
508  for (const auto& pc : parameterConstraints)
-
509  // Parameter in question is not supplied
-
510  if (!HasParam(pc.second.key))
-
511  {
-
512  // Do we have a default value?
-
513  if (pc.second.defaultValue.size() > 0)
-
514  {
-
515  // Then create it now, by its default value
-
516 
-
517  Value* tmp = ParseValue(pc.second.defaultValue, &pc.second);
-
518  parameters.insert(std::pair<std::string, Parameter*>(
-
519  pc.second.key,
-
520  new Parameter(pc.second.key, tmp)
-
521  ));
-
522 
-
523  delete tmp;
-
524  tmp = nullptr;
-
525  }
-
526  // So we do not have a default value...
-
527  else
-
528  {
-
529  // Is it important to have the missing parameter?
-
530  if (pc.second.required)
-
531  // Throw an error message then
-
532  throw HazelnuppConstraintMissingValue(
-
533  pc.second.key,
-
534  GetDescription(pc.second.key)
-
535  );
-
536  }
-
537  }
+
505  // Put name
+
506  ss << it.first << " ";
+
507 
+
508  // Put abbreviation
+
509  if (pde.abbreviation.length() > 0)
+
510  ss << pde.abbreviation << " ";
+
511 
+
512  // Put type
+
513  if (pde.typeIsForced)
+
514  ss << pde.type << " ";
+
515 
+
516  // Put default value
+
517  if (pde.defaultVal.length() > 0)
+
518  ss << "default=[" << pde.defaultVal << "] ";
+
519 
+
520  // Put required tag, but only if no default value
+
521  if ((pde.required) && (pde.defaultVal.length() == 0))
+
522  ss << "[[REQUIRED]] ";
+
523 
+
524  // Put brief description
+
525  if (pde.description.length() > 0)
+
526  ss << pde.description;
+
527 
+
528  // Omit linebreaks when we're on the last element
+
529  if (counter < paramInfos.size()-1)
+
530  ss << std::endl << std::endl;
+
531 
+
532  counter++;
+
533  }
+
534  }
+
535 
+
536  return ss.str();
+
537 }
538 
-
539  return;
-
540 }
-
541 
-
542 ParamConstraint CmdArgsInterface::GetConstraint(const std::string& parameter) const
-
543 {
-
544  return parameterConstraints.find(parameter)->second;
-
545 }
-
546 
-
547 void CmdArgsInterface::ClearConstraint(const std::string& parameter)
-
548 {
-
549  parameterConstraints.erase(parameter);
-
550  return;
-
551 }
-
552 
-
553 const std::string& CmdArgsInterface::GetExecutableName() const
-
554 {
-
555  return executableName;
-
556 }
-
557 
-
558 const Value& CmdArgsInterface::operator[](const std::string& key) const
-
559 {
-
560  // Throw exception if param is unknown
-
561  if (!HasParam(key))
-
562  throw HazelnuppInvalidKeyException();
-
563 
-
564  return *parameters.find(key)->second->GetValue();
-
565 }
-
566 
-
567 void CmdArgsInterface::RegisterAbbreviation(const std::string& abbrev, const std::string& target)
-
568 {
-
569  parameterAbreviations.insert(std::pair<std::string, std::string>(abbrev, target));
-
570  return;
-
571 }
-
572 
-
573 const std::string& CmdArgsInterface::GetAbbreviation(const std::string& abbrev) const
-
574 {
-
575  if (!HasAbbreviation(abbrev))
-
576  return Placeholders::g_emptyString;
-
577 
-
578  return parameterAbreviations.find(abbrev)->second;
-
579 }
-
580 
-
581 bool CmdArgsInterface::HasAbbreviation(const std::string& abbrev) const
-
582 {
-
583  return parameterAbreviations.find(abbrev) != parameterAbreviations.end();
-
584 }
-
585 
-
586 void CmdArgsInterface::ClearAbbreviation(const std::string& abbrevation)
-
587 {
-
588  parameterAbreviations.erase(abbrevation);
-
589  return;
-
590 }
-
591 
-
592 void CmdArgsInterface::ClearAbbreviations()
-
593 {
-
594  parameterAbreviations.clear();
-
595  return;
-
596 }
-
597 
-
598 void CmdArgsInterface::RegisterConstraint(const std::string& key, const ParamConstraint& constraint)
-
599 {
-
600  // Magic syntax, wooo
-
601  (parameterConstraints[key] = constraint).key = key;
-
602  return;
-
603 }
-
604 
-
605 void CmdArgsInterface::ClearConstraints()
-
606 {
-
607  parameterConstraints.clear();
-
608  return;
-
609 }
-
610 
-
611 void CmdArgsInterface::SetCrashOnFail(bool crashOnFail)
-
612 {
-
613  this->crashOnFail = crashOnFail;
-
614  return;
-
615 }
-
616 
-
617 const ParamConstraint* CmdArgsInterface::GetConstraintForKey(const std::string& key) const
-
618 {
-
619  const auto constraint = parameterConstraints.find(key);
-
620 
-
621  if (constraint == parameterConstraints.end())
-
622  return nullptr;
+
539 void CmdArgsInterface::ApplyConstraints()
+
540 {
+
541  // Enforce required parameters / default values
+
542  for (const auto& pc : parameterConstraints)
+
543  // Parameter in question is not supplied
+
544  if (!HasParam(pc.second.key))
+
545  {
+
546  // Do we have a default value?
+
547  if (pc.second.defaultValue.size() > 0)
+
548  {
+
549  // Then create it now, by its default value
+
550  Value* tmp = ParseValue(pc.second.defaultValue, &pc.second);
+
551  parameters.insert(std::pair<std::string, Parameter*>(
+
552  pc.second.key,
+
553  new Parameter(pc.second.key, tmp)
+
554  ));
+
555 
+
556  delete tmp;
+
557  tmp = nullptr;
+
558  }
+
559  // So we do not have a default value...
+
560  else
+
561  {
+
562  // Is it important to have the missing parameter?
+
563  if (pc.second.required)
+
564  // Throw an error message then
+
565  throw HazelnuppConstraintMissingValue(
+
566  pc.second.key,
+
567  GetDescription(pc.second.key)
+
568  );
+
569  }
+
570  }
+
571  // The parameter in question IS supplied
+
572  else
+
573  {
+
574  // Enforce parameter incompatibility
+
575 
+
576  // Is ANY parameter present listed as incompatible with our current one?
+
577  for (const std::string& incompatibility : pc.second.incompatibleParameters)
+
578  for (const std::pair<std::string, Parameter*>& otherParam : parameters)
+
579  {
+
580  if (otherParam.first == incompatibility)
+
581  throw HazelnuppConstraintIncompatibleParameters(pc.second.key, incompatibility);
+
582  }
+
583  }
+
584 
+
585  return;
+
586 }
+
587 
+
588 ParamConstraint CmdArgsInterface::GetConstraint(const std::string& parameter) const
+
589 {
+
590  return parameterConstraints.find(parameter)->second;
+
591 }
+
592 
+
593 void CmdArgsInterface::ClearConstraint(const std::string& parameter)
+
594 {
+
595  parameterConstraints.erase(parameter);
+
596  return;
+
597 }
+
598 
+
599 const std::string& CmdArgsInterface::GetExecutableName() const
+
600 {
+
601  return executableName;
+
602 }
+
603 
+
604 const Value& CmdArgsInterface::operator[](const std::string& key) const
+
605 {
+
606  // Throw exception if param is unknown
+
607  if (!HasParam(key))
+
608  throw HazelnuppInvalidKeyException();
+
609 
+
610  return *parameters.find(key)->second->GetValue();
+
611 }
+
612 
+
613 void CmdArgsInterface::RegisterAbbreviation(const std::string& abbrev, const std::string& target)
+
614 {
+
615  parameterAbreviations.insert(std::pair<std::string, std::string>(abbrev, target));
+
616  return;
+
617 }
+
618 
+
619 const std::string& CmdArgsInterface::GetAbbreviation(const std::string& abbrev) const
+
620 {
+
621  if (!HasAbbreviation(abbrev))
+
622  return Placeholders::g_emptyString;
623 
-
624  return &constraint->second;
+
624  return parameterAbreviations.find(abbrev)->second;
625 }
+
626 
+
627 bool CmdArgsInterface::HasAbbreviation(const std::string& abbrev) const
+
628 {
+
629  return parameterAbreviations.find(abbrev) != parameterAbreviations.end();
+
630 }
+
631 
+
632 void CmdArgsInterface::ClearAbbreviation(const std::string& abbrevation)
+
633 {
+
634  parameterAbreviations.erase(abbrevation);
+
635  return;
+
636 }
+
637 
+
638 void CmdArgsInterface::ClearAbbreviations()
+
639 {
+
640  parameterAbreviations.clear();
+
641  return;
+
642 }
+
643 
+
644 void CmdArgsInterface::RegisterConstraint(const std::string& key, const ParamConstraint& constraint)
+
645 {
+
646  // Magic syntax, wooo
+
647  (parameterConstraints[key] = constraint).key = key;
+
648  return;
+
649 }
+
650 
+
651 void CmdArgsInterface::ClearConstraints()
+
652 {
+
653  parameterConstraints.clear();
+
654  return;
+
655 }
+
656 
+
657 void CmdArgsInterface::SetCrashOnFail(bool crashOnFail)
+
658 {
+
659  this->crashOnFail = crashOnFail;
+
660  return;
+
661 }
+
662 
+
663 const ParamConstraint* CmdArgsInterface::GetConstraintForKey(const std::string& key) const
+
664 {
+
665  const auto constraint = parameterConstraints.find(key);
+
666 
+
667  if (constraint == parameterConstraints.end())
+
668  return nullptr;
+
669 
+
670  return &constraint->second;
+
671 }
-
Hazelnp::CmdArgsInterface::GetCatchHelp
bool GetCatchHelp() const
Retruns whether the CmdArgsInterface should automatically catch the –help parameter,...
Definition: CmdArgsInterface.cpp:340
+
Hazelnp::CmdArgsInterface::GetCatchHelp
bool GetCatchHelp() const
Retruns whether the CmdArgsInterface should automatically catch the –help parameter,...
Definition: CmdArgsInterface.cpp:374
HazelnuppException.h
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::IntValue
Specializations for integer values (uses long long int)
Definition: IntValue.h:8
-
Hazelnp::CmdArgsInterface::GetConstraint
ParamConstraint GetConstraint(const std::string &parameter) const
Will return the constraint information for a specific parameter.
Definition: CmdArgsInterface.cpp:542
-
Hazelnp::CmdArgsInterface::ClearAbbreviations
void ClearAbbreviations()
Will delete all abbreviations.
Definition: CmdArgsInterface.cpp:592
-
Hazelnp::CmdArgsInterface::SetCatchHelp
void SetCatchHelp(bool catchHelp)
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter...
Definition: CmdArgsInterface.cpp:334
-
Hazelnp::CmdArgsInterface::HasAbbreviation
bool HasAbbreviation(const std::string &abbrev) const
Will check wether or not an abbreviation is registered.
Definition: CmdArgsInterface.cpp:581
+
Hazelnp::CmdArgsInterface::GetConstraint
ParamConstraint GetConstraint(const std::string &parameter) const
Will return the constraint information for a specific parameter.
Definition: CmdArgsInterface.cpp:588
+
Hazelnp::CmdArgsInterface::ClearAbbreviations
void ClearAbbreviations()
Will delete all abbreviations.
Definition: CmdArgsInterface.cpp:638
+
Hazelnp::HazelnuppConstraintIncompatibleParameters
Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied along...
Definition: HazelnuppException.h:101
+
Hazelnp::CmdArgsInterface::SetCatchHelp
void SetCatchHelp(bool catchHelp)
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter...
Definition: CmdArgsInterface.cpp:368
+
Hazelnp::CmdArgsInterface::HasAbbreviation
bool HasAbbreviation(const std::string &abbrev) const
Will check wether or not an abbreviation is registered.
Definition: CmdArgsInterface.cpp:627
Hazelnp::HazelnuppInvalidKeyException
Gets thrown when an non-existent key gets dereferenced.
Definition: HazelnuppException.h:29
-
Hazelnp::CmdArgsInterface::RegisterConstraint
void RegisterConstraint(const std::string &key, const ParamConstraint &constraint)
Will register a constraint for a parameter.
Definition: CmdArgsInterface.cpp:598
+
Hazelnp::CmdArgsInterface::RegisterConstraint
void RegisterConstraint(const std::string &key, const ParamConstraint &constraint)
Will register a constraint for a parameter.
Definition: CmdArgsInterface.cpp:644
StringValue.h
CmdArgsInterface.h
Hazelnp::HazelnuppException::What
const std::string & What() const
Will return an error message.
Definition: HazelnuppException.h:18
@@ -721,55 +768,57 @@ $(function() {
Placeholders.h
Hazelnp::DATA_TYPE::VOID
@ VOID
Hazelnp::FloatValue
Specializations for floating point values (uses long double)
Definition: FloatValue.h:9
-
Hazelnp::CmdArgsInterface::ClearConstraint
void ClearConstraint(const std::string &parameter)
Will the constraint of a specific parameter.
Definition: CmdArgsInterface.cpp:547
-
Hazelnp::ParamConstraint::requiredType
DATA_TYPE requiredType
Constrain the parameter to this value. Requires constrainType to be set to true.
Definition: ParamConstraint.h:51
+
Hazelnp::CmdArgsInterface::ClearConstraint
void ClearConstraint(const std::string &parameter)
Will the constraint of a specific parameter.
Definition: CmdArgsInterface.cpp:593
+
Hazelnp::ParamConstraint::requiredType
DATA_TYPE requiredType
Constrain the parameter to this value. Requires constrainType to be set to true.
Definition: ParamConstraint.h:73
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
-
Hazelnp::CmdArgsInterface::RegisterAbbreviation
void RegisterAbbreviation(const std::string &abbrev, const std::string &target)
Will register an abbreviation (like -f for –force)
Definition: CmdArgsInterface.cpp:567
-
Hazelnp::CmdArgsInterface::HasParam
bool HasParam(const std::string &key) const
Will check wether a parameter exists given a key, or not.
Definition: CmdArgsInterface.cpp:165
+
Hazelnp::HazelnuppConstraintException
Gets thrown something bad happens because of parameter constraints.
Definition: HazelnuppException.h:47
+
Hazelnp::CmdArgsInterface::RegisterAbbreviation
void RegisterAbbreviation(const std::string &abbrev, const std::string &target)
Will register an abbreviation (like -f for –force)
Definition: CmdArgsInterface.cpp:613
+
Hazelnp::CmdArgsInterface::HasParam
bool HasParam(const std::string &key) const
Will check wether a parameter exists given a key, or not.
Definition: CmdArgsInterface.cpp:199
Hazelnp::DATA_TYPE::LIST
@ LIST
-
Hazelnp::CmdArgsInterface::ClearConstraints
void ClearConstraints()
Will delete all constraints.
Definition: CmdArgsInterface.cpp:605
+
Hazelnp::CmdArgsInterface::ClearConstraints
void ClearConstraints()
Will delete all constraints.
Definition: CmdArgsInterface.cpp:651
Hazelnp::Parameter
Definition: Parameter.h:8
Hazelnp::ParamConstraint
Definition: ParamConstraint.h:8
Hazelnp::Placeholders::g_emptyString
static const std::string g_emptyString
The only purpose of this is to provide the ability to return an empty string as an error for std::str...
Definition: Placeholders.h:9
-
Hazelnp::CmdArgsInterface::GetCrashOnFail
bool GetCrashOnFail() const
Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
Definition: CmdArgsInterface.cpp:329
-
Hazelnp::CmdArgsInterface::HasDescription
bool HasDescription(const std::string &parameter) const
Returns whether or not a given parameter has a registered description.
Definition: CmdArgsInterface.cpp:373
-
Hazelnp::CmdArgsInterface::ClearDescription
void ClearDescription(const std::string &parameter)
Will delete the description of a parameter if it exists.
Definition: CmdArgsInterface.cpp:378
+
Hazelnp::CmdArgsInterface::GetCrashOnFail
bool GetCrashOnFail() const
Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
Definition: CmdArgsInterface.cpp:363
+
Hazelnp::CmdArgsInterface::HasDescription
bool HasDescription(const std::string &parameter) const
Returns whether or not a given parameter has a registered description.
Definition: CmdArgsInterface.cpp:407
+
Hazelnp::CmdArgsInterface::ClearDescription
void ClearDescription(const std::string &parameter)
Will delete the description of a parameter if it exists.
Definition: CmdArgsInterface.cpp:412
ListValue.h
-
Hazelnp::ParamConstraint::constrainType
bool constrainType
Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
Definition: ParamConstraint.h:48
+
Hazelnp::ParamConstraint::constrainType
bool constrainType
Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
Definition: ParamConstraint.h:70
+
Hazelnp::HazelnuppException
Generic hazelnupp exception.
Definition: HazelnuppException.h:11
Hazelnp::CmdArgsInterface::CmdArgsInterface
CmdArgsInterface()
Definition: CmdArgsInterface.cpp:15
Hazelnp::Parameter::Key
const std::string & Key() const
Will return the key of this parameter.
Definition: Parameter.cpp:21
Hazelnp::HazelnuppConstraintMissingValue
Gets thrown when a parameter constrained to be required is not provided, and has no default value set...
Definition: HazelnuppException.h:80
-
Hazelnp::CmdArgsInterface::ClearAbbreviation
void ClearAbbreviation(const std::string &abbrevation)
Will delete the abbreviation for a given parameter.
Definition: CmdArgsInterface.cpp:586
+
Hazelnp::CmdArgsInterface::ClearAbbreviation
void ClearAbbreviation(const std::string &abbrevation)
Will delete the abbreviation for a given parameter.
Definition: CmdArgsInterface.cpp:632
Hazelnp::HazelnuppConstraintTypeMissmatch
Gets thrown when a parameter is of a type that does not match the required type, and is not convertib...
Definition: HazelnuppException.h:56
VoidValue.h
Hazelnp::CmdArgsInterface::Parse
void Parse(const int argc, const char *const *argv)
Will parse command line arguments.
Definition: CmdArgsInterface.cpp:36
-
Hazelnp::CmdArgsInterface::SetBriefDescription
void SetBriefDescription(const std::string &description)
Sets a brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:345
-
Hazelnp::CmdArgsInterface::GetBriefDescription
const std::string & GetBriefDescription()
Returns the brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:351
-
Hazelnp::CmdArgsInterface::operator[]
const Value & operator[](const std::string &key) const
Will return the value given a key.
Definition: CmdArgsInterface.cpp:558
-
Hazelnp::CmdArgsInterface::ClearDescriptions
void ClearDescriptions()
Will delete all parameter descriptions.
Definition: CmdArgsInterface.cpp:385
+
Hazelnp::CmdArgsInterface::SetBriefDescription
void SetBriefDescription(const std::string &description)
Sets a brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:379
+
Hazelnp::CmdArgsInterface::GetBriefDescription
const std::string & GetBriefDescription()
Returns the brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:385
+
Hazelnp::CmdArgsInterface::operator[]
const Value & operator[](const std::string &key) const
Will return the value given a key.
Definition: CmdArgsInterface.cpp:604
+
Hazelnp::CmdArgsInterface::ClearDescriptions
void ClearDescriptions()
Will delete all parameter descriptions.
Definition: CmdArgsInterface.cpp:419
Hazelnp::ListValue::AddValue
void AddValue(const Value *value)
Will add this value to the list.
Definition: ListValue.cpp:33
Hazelnp::VoidValue
Specializations for void values.
Definition: VoidValue.h:8
-
Hazelnp::CmdArgsInterface::GenerateDocumentation
std::string GenerateDocumentation() const
Will generate a text-based documentation suited to show the user, for example on –help.
Definition: CmdArgsInterface.cpp:391
-
Hazelnp::CmdArgsInterface::RegisterDescription
void RegisterDescription(const std::string &parameter, const std::string &description)
Willl register a short description for a parameter.
Definition: CmdArgsInterface.cpp:356
+
Hazelnp::CmdArgsInterface::GenerateDocumentation
std::string GenerateDocumentation() const
Will generate a text-based documentation suited to show the user, for example on –help.
Definition: CmdArgsInterface.cpp:425
+
Hazelnp::CmdArgsInterface::RegisterDescription
void RegisterDescription(const std::string &parameter, const std::string &description)
Willl register a short description for a parameter.
Definition: CmdArgsInterface.cpp:390
Hazelnp::Internal::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
Hazelnp::DATA_TYPE::FLOAT
@ FLOAT
-
Hazelnp::CmdArgsInterface::GetDescription
const std::string & GetDescription(const std::string &parameter) const
Will return a short description for a parameter, if it exists.
Definition: CmdArgsInterface.cpp:362
+
Hazelnp::CmdArgsInterface::GetDescription
const std::string & GetDescription(const std::string &parameter) const
Will return a short description for a parameter, if it exists.
Definition: CmdArgsInterface.cpp:396
Hazelnp::DATA_TYPE::INT
@ INT
FloatValue.h
Hazelnp::DATA_TYPE
DATA_TYPE
The different data types a paramater can be.
Definition: DataType.h:8
-
Hazelnp::CmdArgsInterface::GetAbbreviation
const std::string & GetAbbreviation(const std::string &abbrev) const
Will return the long form of an abbreviation (like –force for -f) Returns "" if no match is found.
Definition: CmdArgsInterface.cpp:573
+
Hazelnp::CmdArgsInterface::GetAbbreviation
const std::string & GetAbbreviation(const std::string &abbrev) const
Will return the long form of an abbreviation (like –force for -f) Returns "" if no match is found.
Definition: CmdArgsInterface.cpp:619
Hazelnp::DATA_TYPE::STRING
@ STRING
-
Hazelnp::CmdArgsInterface::GetExecutableName
const std::string & GetExecutableName() const
Will return argv[0], the name of the executable.
Definition: CmdArgsInterface.cpp:553
+
Hazelnp::CmdArgsInterface::GetExecutableName
const std::string & GetExecutableName() const
Will return argv[0], the name of the executable.
Definition: CmdArgsInterface.cpp:599
Hazelnp::DataTypeToString
static std::string DataTypeToString(DATA_TYPE type)
Definition: DataType.h:17
Hazelnp::Internal::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
-
Hazelnp::CmdArgsInterface::SetCrashOnFail
void SetCrashOnFail(bool crashOnFail)
Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsin...
Definition: CmdArgsInterface.cpp:611
+
Hazelnp::CmdArgsInterface::SetCrashOnFail
void SetCrashOnFail(bool crashOnFail)
Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsin...
Definition: CmdArgsInterface.cpp:657
Hazelnp::ListValue
Specializations for list values (uses std::vector<Value*>)
Definition: ListValue.h:9
Hazelnp::StringValue
Specializations for string values (uses std::string)
Definition: StringValue.h:9
StringTools.h
Hazelnp::CmdArgsInterface::~CmdArgsInterface
~CmdArgsInterface()
Definition: CmdArgsInterface.cpp:26
diff --git a/docs/CmdArgsInterface_8h.html b/docs/CmdArgsInterface_8h.html index f365594..b077e53 100644 --- a/docs/CmdArgsInterface_8h.html +++ b/docs/CmdArgsInterface_8h.html @@ -85,20 +85,22 @@ $(function() { #include "ParamConstraint.h"
#include <unordered_map>
#include <vector>
+#include "Version.h"
Include dependency graph for CmdArgsInterface.h:
- + - - + + - - - - + + + + +
@@ -127,7 +129,7 @@ Namespaces
diff --git a/docs/CmdArgsInterface_8h__incl.map b/docs/CmdArgsInterface_8h__incl.map index 8ac268e..2daed24 100644 --- a/docs/CmdArgsInterface_8h__incl.map +++ b/docs/CmdArgsInterface_8h__incl.map @@ -1,11 +1,12 @@ - + - - + + - - - - + + + + + diff --git a/docs/CmdArgsInterface_8h__incl.md5 b/docs/CmdArgsInterface_8h__incl.md5 index cef96ca..5906ee6 100644 --- a/docs/CmdArgsInterface_8h__incl.md5 +++ b/docs/CmdArgsInterface_8h__incl.md5 @@ -1 +1 @@ -8ab680b9e8342db6d2471c14b295e135 \ No newline at end of file +1b40cfe17dfb4f2d2222d0c51471439e \ No newline at end of file diff --git a/docs/CmdArgsInterface_8h__incl.png b/docs/CmdArgsInterface_8h__incl.png index 029210b..22014bf 100644 Binary files a/docs/CmdArgsInterface_8h__incl.png and b/docs/CmdArgsInterface_8h__incl.png differ diff --git a/docs/CmdArgsInterface_8h_source.html b/docs/CmdArgsInterface_8h_source.html index c1ff68f..472a2d6 100644 --- a/docs/CmdArgsInterface_8h_source.html +++ b/docs/CmdArgsInterface_8h_source.html @@ -84,184 +84,187 @@ $(function() {
4 #include <unordered_map>
5 #include <vector>
6 
-
7 namespace Hazelnp
-
8 {
-
9  /** The main class to interface with
-
10  */
-
11  class CmdArgsInterface
-
12  {
-
13  public:
-
14  CmdArgsInterface();
-
15  CmdArgsInterface(const int argc, const char* const* argv);
-
16 
-
17  ~CmdArgsInterface();
-
18 
-
19  //! Will parse command line arguments
-
20  void Parse(const int argc, const char* const* argv);
-
21 
-
22  //! Will return argv[0], the name of the executable.
-
23  const std::string& GetExecutableName() const;
-
24 
-
25  //! Will return the value given a key
-
26  const Value& operator[](const std::string& key) const;
-
27 
-
28  //! Will check wether a parameter exists given a key, or not
-
29  bool HasParam(const std::string& key) const;
-
30 
-
31  // Abbreviations
-
32  //! Will register an abbreviation (like -f for --force)
-
33  void RegisterAbbreviation(const std::string& abbrev, const std::string& target);
-
34 
-
35  //! Will return the long form of an abbreviation (like --force for -f)
-
36  //! Returns "" if no match is found
-
37  const std::string& GetAbbreviation(const std::string& abbrev) const;
-
38 
-
39  //! Will check wether or not an abbreviation is registered
-
40  bool HasAbbreviation(const std::string& abbrev) const;
-
41 
-
42  //! Will delete the abbreviation for a given parameter.
-
43  //! IMPORTANT: This parameter is the abbreviation! Not the long form!
-
44  void ClearAbbreviation(const std::string& abbrevation);
-
45 
-
46  //! Will delete all abbreviations
-
47  void ClearAbbreviations();
-
48 
-
49  //! Will register a constraint for a parameter.
-
50  //! IMPORTANT: Any parameter can only have ONE constraint. Applying a new one will overwrite the old one!
-
51  //! Construct the ParamConstraint struct yourself to combine Require and TypeSafety! You can also use the ParamConstraint constructor!
-
52  void RegisterConstraint(const std::string& key, const ParamConstraint& constraint);
-
53 
-
54  //! Will return the constraint information for a specific parameter
-
55  ParamConstraint GetConstraint(const std::string& parameter) const;
-
56 
-
57  //! Will the constraint of a specific parameter
-
58  void ClearConstraint(const std::string& parameter);
-
59 
-
60  //! Will delete all constraints
-
61  void ClearConstraints();
-
62 
-
63  //! Sets whether to crash the application, and print to stderr, when an exception is
-
64  //! raised whilst parsing, or not.
-
65  void SetCrashOnFail(bool crashOnFail);
-
66 
-
67  //! Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
-
68  bool GetCrashOnFail() const;
-
69 
-
70  //! Sets whether the CmdArgsInterface should automatically catch the --help parameter, print the parameter documentation to stdout, and exit or not.
-
71  void SetCatchHelp(bool catchHelp);
-
72 
-
73  //! Retruns whether the CmdArgsInterface should automatically catch the --help parameter, print the parameter documentation to stdout, and exit or not.
-
74  bool GetCatchHelp() const;
-
75 
-
76  //! Sets a brief description of the application to be automatically added to the documentation.
-
77  void SetBriefDescription(const std::string& description);
-
78 
-
79  //! Returns the brief description of the application to be automatically added to the documentation.
-
80  const std::string& GetBriefDescription();
-
81 
-
82  //! Willl register a short description for a parameter.
-
83  //! Will overwrite existing descriptions for that parameter.
-
84  void RegisterDescription(const std::string& parameter, const std::string& description);
-
85 
-
86  //! Will return a short description for a parameter, if it exists.
-
87  //! Empty string if it does not exist.
-
88  const std::string& GetDescription(const std::string& parameter) const;
-
89 
-
90  //! Returns whether or not a given parameter has a registered description
-
91  bool HasDescription(const std::string& parameter) const;
-
92 
-
93  //! Will delete the description of a parameter if it exists.
-
94  void ClearDescription(const std::string& parameter);
-
95 
-
96  //! Will delete all parameter descriptions
-
97  void ClearDescriptions();
-
98 
-
99  //! Will generate a text-based documentation suited to show the user, for example on --help.
-
100  std::string GenerateDocumentation() const;
-
101 
-
102  private:
-
103  //! Will translate the c-like args to an std::vector
-
104  void PopulateRawArgs(const int argc, const char* const* argv);
-
105 
-
106  //! Will replace all args matching an abbreviation with their long form (like -f for --force)
-
107  void ExpandAbbreviations();
-
108 
-
109  //! Will parse the next parameter. Returns the index of the next parameter.
-
110  std::size_t ParseNextParameter(const std::size_t parIndex, Parameter*& out_Par);
-
111 
-
112  //! Will convert a vector of string-values to an actual Value
-
113  Value* ParseValue(const std::vector<std::string>& values, const ParamConstraint* constraint = nullptr);
-
114 
-
115  //! Will apply the loaded constraints on the loaded values, exluding types.
-
116  void ApplyConstraints();
-
117 
-
118  //! Will return a pointer to a paramConstraint given a key. If there is no, it returns nullptr
-
119  const ParamConstraint* GetConstraintForKey(const std::string& key) const;
-
120 
-
121  std::string executableName; //! The path of the executable. Always argv[0]
-
122  std::unordered_map<std::string, Parameter*> parameters;
-
123 
-
124  //! These are abbreviations. Like, -f for --force.
-
125  std::unordered_map<std::string, std::string> parameterAbreviations;
-
126 
-
127  //! Parameter constraints, mapped to keys
-
128  std::unordered_map<std::string, ParamConstraint> parameterConstraints;
-
129 
-
130  //! Raw argv
-
131  std::vector<std::string> rawArgs;
-
132 
-
133  //! Short descriptions for parameters
-
134  //! First member is the abbreviation
-
135  std::unordered_map<std::string, std::string> parameterDescriptions;
-
136 
-
137  //! A brief description of the application to be added to the generated documentation. Optional.
-
138  std::string briefDescription;
-
139 
-
140  //! If set to true, CmdArgsInterface will automatically catch the --help parameter, print the parameter documentation to stdout and exit.
-
141  bool catchHelp = true;
-
142 
-
143  //! If set to true, CmdArgsInterface will crash the application with output to stderr when an exception is thrown whilst parsing.
-
144  bool crashOnFail = true;
-
145  };
-
146 }
+
7 #include "Version.h"
+
8 
+
9 namespace Hazelnp
+
10 {
+
11  /** The main class to interface with
+
12  */
+
13  class CmdArgsInterface
+
14  {
+
15  public:
+
16  CmdArgsInterface();
+
17  CmdArgsInterface(const int argc, const char* const* argv);
+
18 
+
19  ~CmdArgsInterface();
+
20 
+
21  //! Will parse command line arguments
+
22  void Parse(const int argc, const char* const* argv);
+
23 
+
24  //! Will return argv[0], the name of the executable.
+
25  const std::string& GetExecutableName() const;
+
26 
+
27  //! Will return the value given a key
+
28  const Value& operator[](const std::string& key) const;
+
29 
+
30  //! Will check wether a parameter exists given a key, or not
+
31  bool HasParam(const std::string& key) const;
+
32 
+
33  // Abbreviations
+
34  //! Will register an abbreviation (like -f for --force)
+
35  void RegisterAbbreviation(const std::string& abbrev, const std::string& target);
+
36 
+
37  //! Will return the long form of an abbreviation (like --force for -f)
+
38  //! Returns "" if no match is found
+
39  const std::string& GetAbbreviation(const std::string& abbrev) const;
+
40 
+
41  //! Will check wether or not an abbreviation is registered
+
42  bool HasAbbreviation(const std::string& abbrev) const;
+
43 
+
44  //! Will delete the abbreviation for a given parameter.
+
45  //! IMPORTANT: This parameter is the abbreviation! Not the long form!
+
46  void ClearAbbreviation(const std::string& abbrevation);
+
47 
+
48  //! Will delete all abbreviations
+
49  void ClearAbbreviations();
+
50 
+
51  //! Will register a constraint for a parameter.
+
52  //! IMPORTANT: Any parameter can only have ONE constraint. Applying a new one will overwrite the old one!
+
53  //! Construct the ParamConstraint struct yourself to combine Require, TypeSafety and Incompatibilities! You can also use the ParamConstraint constructor!
+
54  void RegisterConstraint(const std::string& key, const ParamConstraint& constraint);
+
55 
+
56  //! Will return the constraint information for a specific parameter
+
57  ParamConstraint GetConstraint(const std::string& parameter) const;
+
58 
+
59  //! Will the constraint of a specific parameter
+
60  void ClearConstraint(const std::string& parameter);
+
61 
+
62  //! Will delete all constraints
+
63  void ClearConstraints();
+
64 
+
65  //! Sets whether to crash the application, and print to stderr, when an exception is
+
66  //! raised whilst parsing, or not.
+
67  void SetCrashOnFail(bool crashOnFail);
+
68 
+
69  //! Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
+
70  bool GetCrashOnFail() const;
+
71 
+
72  //! Sets whether the CmdArgsInterface should automatically catch the --help parameter, print the parameter documentation to stdout, and exit or not.
+
73  void SetCatchHelp(bool catchHelp);
+
74 
+
75  //! Retruns whether the CmdArgsInterface should automatically catch the --help parameter, print the parameter documentation to stdout, and exit or not.
+
76  bool GetCatchHelp() const;
+
77 
+
78  //! Sets a brief description of the application to be automatically added to the documentation.
+
79  void SetBriefDescription(const std::string& description);
+
80 
+
81  //! Returns the brief description of the application to be automatically added to the documentation.
+
82  const std::string& GetBriefDescription();
+
83 
+
84  //! Willl register a short description for a parameter.
+
85  //! Will overwrite existing descriptions for that parameter.
+
86  void RegisterDescription(const std::string& parameter, const std::string& description);
+
87 
+
88  //! Will return a short description for a parameter, if it exists.
+
89  //! Empty string if it does not exist.
+
90  const std::string& GetDescription(const std::string& parameter) const;
+
91 
+
92  //! Returns whether or not a given parameter has a registered description
+
93  bool HasDescription(const std::string& parameter) const;
+
94 
+
95  //! Will delete the description of a parameter if it exists.
+
96  void ClearDescription(const std::string& parameter);
+
97 
+
98  //! Will delete all parameter descriptions
+
99  void ClearDescriptions();
+
100 
+
101  //! Will generate a text-based documentation suited to show the user, for example on --help.
+
102  std::string GenerateDocumentation() const;
+
103 
+
104  private:
+
105  //! Will translate the c-like args to an std::vector
+
106  void PopulateRawArgs(const int argc, const char* const* argv);
+
107 
+
108  //! Will replace all args matching an abbreviation with their long form (like -f for --force)
+
109  void ExpandAbbreviations();
+
110 
+
111  //! Will parse the next parameter. Returns the index of the next parameter.
+
112  std::size_t ParseNextParameter(const std::size_t parIndex, Parameter*& out_Par);
+
113 
+
114  //! Will convert a vector of string-values to an actual Value
+
115  Value* ParseValue(const std::vector<std::string>& values, const ParamConstraint* constraint = nullptr);
+
116 
+
117  //! Will apply the loaded constraints on the loaded values, exluding types.
+
118  void ApplyConstraints();
+
119 
+
120  //! Will return a pointer to a paramConstraint given a key. If there is no, it returns nullptr
+
121  const ParamConstraint* GetConstraintForKey(const std::string& key) const;
+
122 
+
123  std::string executableName; //! The path of the executable. Always argv[0]
+
124  std::unordered_map<std::string, Parameter*> parameters;
+
125 
+
126  //! These are abbreviations. Like, -f for --force.
+
127  std::unordered_map<std::string, std::string> parameterAbreviations;
+
128 
+
129  //! Parameter constraints, mapped to keys
+
130  std::unordered_map<std::string, ParamConstraint> parameterConstraints;
+
131 
+
132  //! Raw argv
+
133  std::vector<std::string> rawArgs;
+
134 
+
135  //! Short descriptions for parameters
+
136  //! First member is the abbreviation
+
137  std::unordered_map<std::string, std::string> parameterDescriptions;
+
138 
+
139  //! A brief description of the application to be added to the generated documentation. Optional.
+
140  std::string briefDescription;
+
141 
+
142  //! If set to true, CmdArgsInterface will automatically catch the --help parameter, print the parameter documentation to stdout and exit.
+
143  bool catchHelp = true;
+
144 
+
145  //! If set to true, CmdArgsInterface will crash the application with output to stderr when an exception is thrown whilst parsing.
+
146  bool crashOnFail = true;
+
147  };
+
148 }
-
Hazelnp::CmdArgsInterface::GetCatchHelp
bool GetCatchHelp() const
Retruns whether the CmdArgsInterface should automatically catch the –help parameter,...
Definition: CmdArgsInterface.cpp:340
-
Hazelnp
Definition: CmdArgsInterface.h:7
-
Hazelnp::CmdArgsInterface
The main class to interface with.
Definition: CmdArgsInterface.h:11
-
Hazelnp::CmdArgsInterface::GetConstraint
ParamConstraint GetConstraint(const std::string &parameter) const
Will return the constraint information for a specific parameter.
Definition: CmdArgsInterface.cpp:542
-
Hazelnp::CmdArgsInterface::ClearAbbreviations
void ClearAbbreviations()
Will delete all abbreviations.
Definition: CmdArgsInterface.cpp:592
-
Hazelnp::CmdArgsInterface::SetCatchHelp
void SetCatchHelp(bool catchHelp)
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter...
Definition: CmdArgsInterface.cpp:334
-
Hazelnp::CmdArgsInterface::HasAbbreviation
bool HasAbbreviation(const std::string &abbrev) const
Will check wether or not an abbreviation is registered.
Definition: CmdArgsInterface.cpp:581
-
Hazelnp::CmdArgsInterface::RegisterConstraint
void RegisterConstraint(const std::string &key, const ParamConstraint &constraint)
Will register a constraint for a parameter.
Definition: CmdArgsInterface.cpp:598
-
Hazelnp::CmdArgsInterface::ClearConstraint
void ClearConstraint(const std::string &parameter)
Will the constraint of a specific parameter.
Definition: CmdArgsInterface.cpp:547
+
Hazelnp::CmdArgsInterface::GetCatchHelp
bool GetCatchHelp() const
Retruns whether the CmdArgsInterface should automatically catch the –help parameter,...
Definition: CmdArgsInterface.cpp:374
+
Hazelnp
Definition: CmdArgsInterface.h:9
+
Hazelnp::CmdArgsInterface
The main class to interface with.
Definition: CmdArgsInterface.h:13
+
Hazelnp::CmdArgsInterface::GetConstraint
ParamConstraint GetConstraint(const std::string &parameter) const
Will return the constraint information for a specific parameter.
Definition: CmdArgsInterface.cpp:588
+
Hazelnp::CmdArgsInterface::ClearAbbreviations
void ClearAbbreviations()
Will delete all abbreviations.
Definition: CmdArgsInterface.cpp:638
+
Hazelnp::CmdArgsInterface::SetCatchHelp
void SetCatchHelp(bool catchHelp)
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter...
Definition: CmdArgsInterface.cpp:368
+
Hazelnp::CmdArgsInterface::HasAbbreviation
bool HasAbbreviation(const std::string &abbrev) const
Will check wether or not an abbreviation is registered.
Definition: CmdArgsInterface.cpp:627
+
Hazelnp::CmdArgsInterface::RegisterConstraint
void RegisterConstraint(const std::string &key, const ParamConstraint &constraint)
Will register a constraint for a parameter.
Definition: CmdArgsInterface.cpp:644
+
Hazelnp::CmdArgsInterface::ClearConstraint
void ClearConstraint(const std::string &parameter)
Will the constraint of a specific parameter.
Definition: CmdArgsInterface.cpp:593
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
ParamConstraint.h
-
Hazelnp::CmdArgsInterface::RegisterAbbreviation
void RegisterAbbreviation(const std::string &abbrev, const std::string &target)
Will register an abbreviation (like -f for –force)
Definition: CmdArgsInterface.cpp:567
-
Hazelnp::CmdArgsInterface::HasParam
bool HasParam(const std::string &key) const
Will check wether a parameter exists given a key, or not.
Definition: CmdArgsInterface.cpp:165
-
Hazelnp::CmdArgsInterface::ClearConstraints
void ClearConstraints()
Will delete all constraints.
Definition: CmdArgsInterface.cpp:605
+
Hazelnp::CmdArgsInterface::RegisterAbbreviation
void RegisterAbbreviation(const std::string &abbrev, const std::string &target)
Will register an abbreviation (like -f for –force)
Definition: CmdArgsInterface.cpp:613
+
Hazelnp::CmdArgsInterface::HasParam
bool HasParam(const std::string &key) const
Will check wether a parameter exists given a key, or not.
Definition: CmdArgsInterface.cpp:199
+
Hazelnp::CmdArgsInterface::ClearConstraints
void ClearConstraints()
Will delete all constraints.
Definition: CmdArgsInterface.cpp:651
Hazelnp::Parameter
Definition: Parameter.h:8
Hazelnp::ParamConstraint
Definition: ParamConstraint.h:8
-
Hazelnp::CmdArgsInterface::GetCrashOnFail
bool GetCrashOnFail() const
Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
Definition: CmdArgsInterface.cpp:329
-
Hazelnp::CmdArgsInterface::HasDescription
bool HasDescription(const std::string &parameter) const
Returns whether or not a given parameter has a registered description.
Definition: CmdArgsInterface.cpp:373
-
Hazelnp::CmdArgsInterface::ClearDescription
void ClearDescription(const std::string &parameter)
Will delete the description of a parameter if it exists.
Definition: CmdArgsInterface.cpp:378
+
Version.h
+
Hazelnp::CmdArgsInterface::GetCrashOnFail
bool GetCrashOnFail() const
Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
Definition: CmdArgsInterface.cpp:363
+
Hazelnp::CmdArgsInterface::HasDescription
bool HasDescription(const std::string &parameter) const
Returns whether or not a given parameter has a registered description.
Definition: CmdArgsInterface.cpp:407
+
Hazelnp::CmdArgsInterface::ClearDescription
void ClearDescription(const std::string &parameter)
Will delete the description of a parameter if it exists.
Definition: CmdArgsInterface.cpp:412
Hazelnp::CmdArgsInterface::CmdArgsInterface
CmdArgsInterface()
Definition: CmdArgsInterface.cpp:15
-
Hazelnp::CmdArgsInterface::ClearAbbreviation
void ClearAbbreviation(const std::string &abbrevation)
Will delete the abbreviation for a given parameter.
Definition: CmdArgsInterface.cpp:586
+
Hazelnp::CmdArgsInterface::ClearAbbreviation
void ClearAbbreviation(const std::string &abbrevation)
Will delete the abbreviation for a given parameter.
Definition: CmdArgsInterface.cpp:632
Hazelnp::CmdArgsInterface::Parse
void Parse(const int argc, const char *const *argv)
Will parse command line arguments.
Definition: CmdArgsInterface.cpp:36
-
Hazelnp::CmdArgsInterface::SetBriefDescription
void SetBriefDescription(const std::string &description)
Sets a brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:345
-
Hazelnp::CmdArgsInterface::GetBriefDescription
const std::string & GetBriefDescription()
Returns the brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:351
-
Hazelnp::CmdArgsInterface::operator[]
const Value & operator[](const std::string &key) const
Will return the value given a key.
Definition: CmdArgsInterface.cpp:558
-
Hazelnp::CmdArgsInterface::ClearDescriptions
void ClearDescriptions()
Will delete all parameter descriptions.
Definition: CmdArgsInterface.cpp:385
+
Hazelnp::CmdArgsInterface::SetBriefDescription
void SetBriefDescription(const std::string &description)
Sets a brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:379
+
Hazelnp::CmdArgsInterface::GetBriefDescription
const std::string & GetBriefDescription()
Returns the brief description of the application to be automatically added to the documentation.
Definition: CmdArgsInterface.cpp:385
+
Hazelnp::CmdArgsInterface::operator[]
const Value & operator[](const std::string &key) const
Will return the value given a key.
Definition: CmdArgsInterface.cpp:604
+
Hazelnp::CmdArgsInterface::ClearDescriptions
void ClearDescriptions()
Will delete all parameter descriptions.
Definition: CmdArgsInterface.cpp:419
Parameter.h
-
Hazelnp::CmdArgsInterface::GenerateDocumentation
std::string GenerateDocumentation() const
Will generate a text-based documentation suited to show the user, for example on –help.
Definition: CmdArgsInterface.cpp:391
-
Hazelnp::CmdArgsInterface::RegisterDescription
void RegisterDescription(const std::string &parameter, const std::string &description)
Willl register a short description for a parameter.
Definition: CmdArgsInterface.cpp:356
-
Hazelnp::CmdArgsInterface::GetDescription
const std::string & GetDescription(const std::string &parameter) const
Will return a short description for a parameter, if it exists.
Definition: CmdArgsInterface.cpp:362
-
Hazelnp::CmdArgsInterface::GetAbbreviation
const std::string & GetAbbreviation(const std::string &abbrev) const
Will return the long form of an abbreviation (like –force for -f) Returns "" if no match is found.
Definition: CmdArgsInterface.cpp:573
-
Hazelnp::CmdArgsInterface::GetExecutableName
const std::string & GetExecutableName() const
Will return argv[0], the name of the executable.
Definition: CmdArgsInterface.cpp:553
-
Hazelnp::CmdArgsInterface::SetCrashOnFail
void SetCrashOnFail(bool crashOnFail)
Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsin...
Definition: CmdArgsInterface.cpp:611
+
Hazelnp::CmdArgsInterface::GenerateDocumentation
std::string GenerateDocumentation() const
Will generate a text-based documentation suited to show the user, for example on –help.
Definition: CmdArgsInterface.cpp:425
+
Hazelnp::CmdArgsInterface::RegisterDescription
void RegisterDescription(const std::string &parameter, const std::string &description)
Willl register a short description for a parameter.
Definition: CmdArgsInterface.cpp:390
+
Hazelnp::CmdArgsInterface::GetDescription
const std::string & GetDescription(const std::string &parameter) const
Will return a short description for a parameter, if it exists.
Definition: CmdArgsInterface.cpp:396
+
Hazelnp::CmdArgsInterface::GetAbbreviation
const std::string & GetAbbreviation(const std::string &abbrev) const
Will return the long form of an abbreviation (like –force for -f) Returns "" if no match is found.
Definition: CmdArgsInterface.cpp:619
+
Hazelnp::CmdArgsInterface::GetExecutableName
const std::string & GetExecutableName() const
Will return argv[0], the name of the executable.
Definition: CmdArgsInterface.cpp:599
+
Hazelnp::CmdArgsInterface::SetCrashOnFail
void SetCrashOnFail(bool crashOnFail)
Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsin...
Definition: CmdArgsInterface.cpp:657
Hazelnp::CmdArgsInterface::~CmdArgsInterface
~CmdArgsInterface()
Definition: CmdArgsInterface.cpp:26
diff --git a/docs/DataType_8h.html b/docs/DataType_8h.html index 17e3811..6775d0e 100644 --- a/docs/DataType_8h.html +++ b/docs/DataType_8h.html @@ -148,7 +148,7 @@ Functions diff --git a/docs/DataType_8h_source.html b/docs/DataType_8h_source.html index a6187f1..e2a996d 100644 --- a/docs/DataType_8h_source.html +++ b/docs/DataType_8h_source.html @@ -118,7 +118,7 @@ $(function() {
38  }
39 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::DATA_TYPE::VOID
@ VOID
Hazelnp::DATA_TYPE::LIST
@ LIST
Hazelnp::DATA_TYPE::FLOAT
@ FLOAT
@@ -128,7 +128,7 @@ $(function() {
Hazelnp::DataTypeToString
static std::string DataTypeToString(DATA_TYPE type)
Definition: DataType.h:17
diff --git a/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html b/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html index 5557477..5107001 100644 --- a/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html +++ b/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/FloatValue_8cpp.html b/docs/FloatValue_8cpp.html index 7fdc7d7..c61a61e 100644 --- a/docs/FloatValue_8cpp.html +++ b/docs/FloatValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for FloatValue.cpp: diff --git a/docs/FloatValue_8cpp_source.html b/docs/FloatValue_8cpp_source.html index 4ad52cd..20272e8 100644 --- a/docs/FloatValue_8cpp_source.html +++ b/docs/FloatValue_8cpp_source.html @@ -156,7 +156,7 @@ $(function() {
Hazelnp::FloatValue::GetFloat64
long double GetFloat64() const override
Will return the data as a long double.
Definition: FloatValue.cpp:54
HazelnuppException.h
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::FloatValue::GetString
std::string GetString() const override
Will return the data as a string.
Definition: FloatValue.cpp:64
Hazelnp::FloatValue::GetList
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: FloatValue.cpp:72
Hazelnp::FloatValue::GetInt64
long long int GetInt64() const override
Will return the data as a long long int.
Definition: FloatValue.cpp:44
@@ -173,7 +173,7 @@ $(function() {
Hazelnp::FloatValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: FloatValue.cpp:49
diff --git a/docs/FloatValue_8h.html b/docs/FloatValue_8h.html index 6008583..00a31e6 100644 --- a/docs/FloatValue_8h.html +++ b/docs/FloatValue_8h.html @@ -123,7 +123,7 @@ Namespaces diff --git a/docs/FloatValue_8h_source.html b/docs/FloatValue_8h_source.html index e045c9f..31415bf 100644 --- a/docs/FloatValue_8h_source.html +++ b/docs/FloatValue_8h_source.html @@ -126,7 +126,7 @@ $(function() {
46 }
Hazelnp::FloatValue::GetFloat64
long double GetFloat64() const override
Will return the data as a long double.
Definition: FloatValue.cpp:54
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::FloatValue::~FloatValue
~FloatValue() override
Definition: FloatValue.h:13
Hazelnp::FloatValue::GetString
std::string GetString() const override
Will return the data as a string.
Definition: FloatValue.cpp:64
Hazelnp::FloatValue::GetList
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: FloatValue.cpp:72
@@ -142,7 +142,7 @@ $(function() {
Hazelnp::FloatValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: FloatValue.cpp:49
diff --git a/docs/HazelnuppException_8h.html b/docs/HazelnuppException_8h.html index 5f0a082..07a0d5b 100644 --- a/docs/HazelnuppException_8h.html +++ b/docs/HazelnuppException_8h.html @@ -134,6 +134,9 @@ Classes class  Hazelnp::HazelnuppConstraintMissingValue  Gets thrown when a parameter constrained to be required is not provided, and has no default value set. More...
  +class  Hazelnp::HazelnuppConstraintIncompatibleParameters + Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones. More...
+  @@ -143,7 +146,7 @@ Namespaces diff --git a/docs/HazelnuppException_8h_source.html b/docs/HazelnuppException_8h_source.html index d86014a..6928984 100644 --- a/docs/HazelnuppException_8h_source.html +++ b/docs/HazelnuppException_8h_source.html @@ -175,12 +175,30 @@ $(function() {
95  return;
96  };
97  };
-
98 }
+
98 
+
99  /** Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones
+
100  */
+
101  class HazelnuppConstraintIncompatibleParameters : public HazelnuppConstraintException
+
102  {
+
103  public:
+
104  HazelnuppConstraintIncompatibleParameters() : HazelnuppConstraintException() {};
+
105  HazelnuppConstraintIncompatibleParameters(const std::string& key1, const std::string& key2)
+
106  {
+
107  // Generate descriptive error message
+
108  std::stringstream ss;
+
109  ss << "Parameter \"" << key1 << "\" is NOT compatible with parameter \"" << key2 << "\"!";
+
110 
+
111  message = ss.str();
+
112  return;
+
113  };
+
114  };
+
115 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
DataType.h
Hazelnp::HazelnuppInvalidKeyException::HazelnuppInvalidKeyException
HazelnuppInvalidKeyException(const std::string &msg)
Definition: HazelnuppException.h:33
Hazelnp::HazelnuppConstraintException::HazelnuppConstraintException
HazelnuppConstraintException()
Definition: HazelnuppException.h:50
+
Hazelnp::HazelnuppConstraintIncompatibleParameters
Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied along...
Definition: HazelnuppException.h:101
Hazelnp::HazelnuppInvalidKeyException
Gets thrown when an non-existent key gets dereferenced.
Definition: HazelnuppException.h:29
Hazelnp::HazelnuppConstraintException::HazelnuppConstraintException
HazelnuppConstraintException(const std::string &msg)
Definition: HazelnuppException.h:51
Hazelnp::HazelnuppException::HazelnuppException
HazelnuppException(const std::string &msg)
Definition: HazelnuppException.h:15
@@ -188,12 +206,14 @@ $(function() {
Hazelnp::HazelnuppConstraintMissingValue::HazelnuppConstraintMissingValue
HazelnuppConstraintMissingValue()
Definition: HazelnuppException.h:83
Hazelnp::HazelnuppConstraintTypeMissmatch::HazelnuppConstraintTypeMissmatch
HazelnuppConstraintTypeMissmatch()
Definition: HazelnuppException.h:59
Hazelnp::HazelnuppConstraintException
Gets thrown something bad happens because of parameter constraints.
Definition: HazelnuppException.h:47
+
Hazelnp::HazelnuppConstraintIncompatibleParameters::HazelnuppConstraintIncompatibleParameters
HazelnuppConstraintIncompatibleParameters(const std::string &key1, const std::string &key2)
Definition: HazelnuppException.h:105
Hazelnp::HazelnuppException
Generic hazelnupp exception.
Definition: HazelnuppException.h:11
Hazelnp::HazelnuppConstraintMissingValue
Gets thrown when a parameter constrained to be required is not provided, and has no default value set...
Definition: HazelnuppException.h:80
Hazelnp::HazelnuppConstraintTypeMissmatch
Gets thrown when a parameter is of a type that does not match the required type, and is not convertib...
Definition: HazelnuppException.h:56
Hazelnp::HazelnuppException::HazelnuppException
HazelnuppException()
Definition: HazelnuppException.h:14
Hazelnp::HazelnuppException::message
std::string message
Definition: HazelnuppException.h:24
Hazelnp::HazelnuppValueNotConvertibleException::HazelnuppValueNotConvertibleException
HazelnuppValueNotConvertibleException(const std::string &msg)
Definition: HazelnuppException.h:42
+
Hazelnp::HazelnuppConstraintIncompatibleParameters::HazelnuppConstraintIncompatibleParameters
HazelnuppConstraintIncompatibleParameters()
Definition: HazelnuppException.h:104
Hazelnp::DATA_TYPE
DATA_TYPE
The different data types a paramater can be.
Definition: DataType.h:8
Hazelnp::HazelnuppConstraintMissingValue::HazelnuppConstraintMissingValue
HazelnuppConstraintMissingValue(const std::string &key, const std::string &paramDescription="")
Definition: HazelnuppException.h:84
Hazelnp::HazelnuppConstraintTypeMissmatch::HazelnuppConstraintTypeMissmatch
HazelnuppConstraintTypeMissmatch(const std::string &key, const DATA_TYPE requiredType, const DATA_TYPE actualType, const std::string &paramDescription="")
Definition: HazelnuppException.h:62
@@ -204,7 +224,7 @@ $(function() {
Hazelnp::HazelnuppInvalidKeyException::HazelnuppInvalidKeyException
HazelnuppInvalidKeyException()
Definition: HazelnuppException.h:32
diff --git a/docs/IntValue_8cpp.html b/docs/IntValue_8cpp.html index e41ff97..453ed68 100644 --- a/docs/IntValue_8cpp.html +++ b/docs/IntValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for IntValue.cpp: diff --git a/docs/IntValue_8cpp_source.html b/docs/IntValue_8cpp_source.html index bd6115c..0d88ce1 100644 --- a/docs/IntValue_8cpp_source.html +++ b/docs/IntValue_8cpp_source.html @@ -156,7 +156,7 @@ $(function() {
HazelnuppException.h
Hazelnp::IntValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: IntValue.cpp:20
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::IntValue::GetFloat32
double GetFloat32() const override
Will return the data as a double.
Definition: IntValue.cpp:59
IntValue.h
Hazelnp::IntValue::IntValue
IntValue(const long long int &value)
Definition: IntValue.cpp:7
@@ -173,7 +173,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/IntValue_8h.html b/docs/IntValue_8h.html index 14aad36..0e2b3da 100644 --- a/docs/IntValue_8h.html +++ b/docs/IntValue_8h.html @@ -122,7 +122,7 @@ Namespaces diff --git a/docs/IntValue_8h_source.html b/docs/IntValue_8h_source.html index 4591c41..4a91cd3 100644 --- a/docs/IntValue_8h_source.html +++ b/docs/IntValue_8h_source.html @@ -126,7 +126,7 @@ $(function() {
46 }
Hazelnp::IntValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: IntValue.cpp:20
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::IntValue
Specializations for integer values (uses long long int)
Definition: IntValue.h:8
Hazelnp::IntValue::GetFloat32
double GetFloat32() const override
Will return the data as a double.
Definition: IntValue.cpp:59
Hazelnp::IntValue::~IntValue
~IntValue() override
Definition: IntValue.h:12
@@ -142,7 +142,7 @@ $(function() {
Value.h
diff --git a/docs/ListValue_8cpp.html b/docs/ListValue_8cpp.html index 16ee4d5..19e9be7 100644 --- a/docs/ListValue_8cpp.html +++ b/docs/ListValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for ListValue.cpp: diff --git a/docs/ListValue_8cpp_source.html b/docs/ListValue_8cpp_source.html index 3dd95fb..b112bf6 100644 --- a/docs/ListValue_8cpp_source.html +++ b/docs/ListValue_8cpp_source.html @@ -178,7 +178,7 @@ $(function() {
Hazelnp::ListValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: ListValue.cpp:44
HazelnuppException.h
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::ListValue::GetFloat32
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:84
Hazelnp::ListValue::GetString
std::string GetString() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:89
Hazelnp::ListValue::GetList
const std::vector< Value * > & GetList() const override
Will return this values list.
Definition: ListValue.cpp:94
@@ -199,7 +199,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/ListValue_8h.html b/docs/ListValue_8h.html index 9e7da07..4bf111e 100644 --- a/docs/ListValue_8h.html +++ b/docs/ListValue_8h.html @@ -123,7 +123,7 @@ Namespaces diff --git a/docs/ListValue_8h_source.html b/docs/ListValue_8h_source.html index 778ea05..9939aac 100644 --- a/docs/ListValue_8h_source.html +++ b/docs/ListValue_8h_source.html @@ -128,7 +128,7 @@ $(function() {
48 }
Hazelnp::ListValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: ListValue.cpp:44
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::ListValue::GetFloat32
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:84
Hazelnp::ListValue::GetString
std::string GetString() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:89
Hazelnp::ListValue::GetList
const std::vector< Value * > & GetList() const override
Will return this values list.
Definition: ListValue.cpp:94
@@ -145,7 +145,7 @@ $(function() {
Value.h
diff --git a/docs/ParamConstraint_8h.html b/docs/ParamConstraint_8h.html index c9118fe..54b1519 100644 --- a/docs/ParamConstraint_8h.html +++ b/docs/ParamConstraint_8h.html @@ -121,7 +121,7 @@ Namespaces diff --git a/docs/ParamConstraint_8h_source.html b/docs/ParamConstraint_8h_source.html index 1857d54..e31dddb 100644 --- a/docs/ParamConstraint_8h_source.html +++ b/docs/ParamConstraint_8h_source.html @@ -93,7 +93,7 @@ $(function() {
13 
14  //! Constructs a require constraint.
15  //! Think of the default value like of a list ofparameters. Like {"--width", "800"}
-
16  static ParamConstraint Require(const std::vector<std::string>& defaultValue = {}, bool required = true)
+
16  static ParamConstraint Require(const std::initializer_list<std::string>& defaultValue = {}, bool required = true)
17  {
18  ParamConstraint pc;
19  pc.defaultValue = defaultValue;
@@ -112,59 +112,87 @@ $(function() {
32  return pc;
33  }
34 
-
35  //! Whole constructor
-
36  ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::vector<std::string>& defaultValue, bool required)
-
37  :
-
38  constrainType{ constrainType },
-
39  requiredType{ requiredType },
-
40  defaultValue{ defaultValue },
-
41  required{ required }
-
42  {
-
43  return;
-
44  }
-
45 
-
46  //! Should this parameter be forced to be of a certain type?
-
47  //! Remember to set `constrainTo` to the wanted type
-
48  bool constrainType = false;
-
49 
-
50  //! Constrain the parameter to this value. Requires `constrainType` to be set to true.
-
51  DATA_TYPE requiredType = DATA_TYPE::VOID;
-
52 
-
53  //! The default value for this parameter.
-
54  //! Gets applied if this parameter was not given.
-
55  //! Think of this like a list of parameters. Like {"--width", "800"}
-
56  std::vector<std::string> defaultValue;
-
57 
-
58  //! If set to true, and no default value set,
-
59  //! an error will be produced if this parameter is not supplied by the user.
-
60  bool required = false;
-
61 
-
62  private:
-
63  //! The parameter this constraint is for.
-
64  //! This value is automatically set by Hazelnupp.
-
65  std::string key;
-
66 
-
67  friend class CmdArgsInterface;
-
68  };
-
69 }
+
35  //! Constructs an incompatibility constraint.
+
36  //! This means, that the following parameters are NOT compatible with this one and will throw an error if passed together
+
37  static ParamConstraint Incompatibility(const std::initializer_list<std::string>& incompatibleParameters)
+
38  {
+
39  ParamConstraint pc;
+
40  pc.incompatibleParameters = incompatibleParameters;
+
41 
+
42  return pc;
+
43  }
+
44 
+
45  //! Constructs an incompatibility constraint.
+
46  //! This means, that the following parameters are NOT compatible with this one and will throw an error if passed together.
+
47  //! Syntactical-sugar proxy method that will convert the lonely string to an initializer list for you :3
+
48  static ParamConstraint Incompatibility(const std::string& incompatibleParameters)
+
49  {
+
50  ParamConstraint pc;
+
51  pc.incompatibleParameters = { incompatibleParameters };
+
52 
+
53  return pc;
+
54  }
+
55 
+
56  //! Whole constructor
+
57  ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::initializer_list<std::string>& defaultValue, bool required, const std::initializer_list<std::string>& incompatibleParameters)
+
58  :
+
59  constrainType{ constrainType },
+
60  requiredType{ requiredType },
+
61  defaultValue{ defaultValue },
+
62  required{ required },
+
63  incompatibleParameters{incompatibleParameters}
+
64  {
+
65  return;
+
66  }
+
67 
+
68  //! Should this parameter be forced to be of a certain type?
+
69  //! Remember to set `constrainTo` to the wanted type
+
70  bool constrainType = false;
+
71 
+
72  //! Constrain the parameter to this value. Requires `constrainType` to be set to true.
+
73  DATA_TYPE requiredType = DATA_TYPE::VOID;
+
74 
+
75  //! The default value for this parameter.
+
76  //! Gets applied if this parameter was not given.
+
77  //! Think of this like a list of parameters. Like {"--width", "800"}
+
78  std::vector<std::string> defaultValue;
+
79 
+
80  //! If set to true, and no default value set,
+
81  //! an error will be produced if this parameter is not supplied by the user.
+
82  bool required = false;
+
83 
+
84  //! Parameters that are incompatible with this parameter
+
85  std::vector<std::string> incompatibleParameters;
+
86 
+
87  private:
+
88  //! The parameter this constraint is for.
+
89  //! This value is automatically set by Hazelnupp.
+
90  std::string key;
+
91 
+
92  friend class CmdArgsInterface;
+
93  };
+
94 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
+
Hazelnp::ParamConstraint::Require
static ParamConstraint Require(const std::initializer_list< std::string > &defaultValue={}, bool required=true)
Constructs a require constraint.
Definition: ParamConstraint.h:16
DataType.h
-
Hazelnp::CmdArgsInterface
The main class to interface with.
Definition: CmdArgsInterface.h:11
+
Hazelnp::CmdArgsInterface
The main class to interface with.
Definition: CmdArgsInterface.h:13
+
Hazelnp::ParamConstraint::Incompatibility
static ParamConstraint Incompatibility(const std::string &incompatibleParameters)
Constructs an incompatibility constraint.
Definition: ParamConstraint.h:48
+
Hazelnp::ParamConstraint::Incompatibility
static ParamConstraint Incompatibility(const std::initializer_list< std::string > &incompatibleParameters)
Constructs an incompatibility constraint.
Definition: ParamConstraint.h:37
+
Hazelnp::ParamConstraint::ParamConstraint
ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::initializer_list< std::string > &defaultValue, bool required, const std::initializer_list< std::string > &incompatibleParameters)
Whole constructor.
Definition: ParamConstraint.h:57
Hazelnp::DATA_TYPE::VOID
@ VOID
-
Hazelnp::ParamConstraint::requiredType
DATA_TYPE requiredType
Constrain the parameter to this value. Requires constrainType to be set to true.
Definition: ParamConstraint.h:51
+
Hazelnp::ParamConstraint::requiredType
DATA_TYPE requiredType
Constrain the parameter to this value. Requires constrainType to be set to true.
Definition: ParamConstraint.h:73
Hazelnp::ParamConstraint
Definition: ParamConstraint.h:8
-
Hazelnp::ParamConstraint::constrainType
bool constrainType
Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
Definition: ParamConstraint.h:48
+
Hazelnp::ParamConstraint::constrainType
bool constrainType
Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
Definition: ParamConstraint.h:70
Hazelnp::ParamConstraint::ParamConstraint
ParamConstraint()=default
Empty constructor.
-
Hazelnp::ParamConstraint::required
bool required
If set to true, and no default value set, an error will be produced if this parameter is not supplied...
Definition: ParamConstraint.h:60
+
Hazelnp::ParamConstraint::incompatibleParameters
std::vector< std::string > incompatibleParameters
Parameters that are incompatible with this parameter.
Definition: ParamConstraint.h:85
+
Hazelnp::ParamConstraint::required
bool required
If set to true, and no default value set, an error will be produced if this parameter is not supplied...
Definition: ParamConstraint.h:82
Hazelnp::ParamConstraint::TypeSafety
static ParamConstraint TypeSafety(DATA_TYPE requiredType, bool constrainType=true)
Constructs a type-safety constraint.
Definition: ParamConstraint.h:26
Hazelnp::DATA_TYPE
DATA_TYPE
The different data types a paramater can be.
Definition: DataType.h:8
-
Hazelnp::ParamConstraint::defaultValue
std::vector< std::string > defaultValue
The default value for this parameter.
Definition: ParamConstraint.h:56
-
Hazelnp::ParamConstraint::Require
static ParamConstraint Require(const std::vector< std::string > &defaultValue={}, bool required=true)
Constructs a require constraint.
Definition: ParamConstraint.h:16
-
Hazelnp::ParamConstraint::ParamConstraint
ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::vector< std::string > &defaultValue, bool required)
Whole constructor.
Definition: ParamConstraint.h:36
+
Hazelnp::ParamConstraint::defaultValue
std::vector< std::string > defaultValue
The default value for this parameter.
Definition: ParamConstraint.h:78
diff --git a/docs/Parameter_8cpp.html b/docs/Parameter_8cpp.html index 0f1f582..6f99d7e 100644 --- a/docs/Parameter_8cpp.html +++ b/docs/Parameter_8cpp.html @@ -98,7 +98,7 @@ Include dependency graph for Parameter.cpp: diff --git a/docs/Parameter_8cpp_source.html b/docs/Parameter_8cpp_source.html index e292630..8cd13db 100644 --- a/docs/Parameter_8cpp_source.html +++ b/docs/Parameter_8cpp_source.html @@ -108,7 +108,7 @@ $(function() {
28  return value;
29 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::Parameter::~Parameter
~Parameter()
Definition: Parameter.cpp:13
Hazelnp::Parameter::GetValue
const Value * GetValue() const
Will return the value of this parameter.
Definition: Parameter.cpp:26
Hazelnp::Parameter::Key
const std::string & Key() const
Will return the key of this parameter.
Definition: Parameter.cpp:21
@@ -116,7 +116,7 @@ $(function() {
Parameter.h
diff --git a/docs/Parameter_8h.html b/docs/Parameter_8h.html index c3c696e..f6479e5 100644 --- a/docs/Parameter_8h.html +++ b/docs/Parameter_8h.html @@ -124,7 +124,7 @@ Namespaces diff --git a/docs/Parameter_8h_source.html b/docs/Parameter_8h_source.html index ba70fb8..5cea65a 100644 --- a/docs/Parameter_8h_source.html +++ b/docs/Parameter_8h_source.html @@ -108,7 +108,7 @@ $(function() {
28  };
29 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::Parameter::~Parameter
~Parameter()
Definition: Parameter.cpp:13
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
Hazelnp::Parameter
Definition: Parameter.h:8
@@ -119,7 +119,7 @@ $(function() {
Value.h
diff --git a/docs/Placeholders_8h.html b/docs/Placeholders_8h.html index 8cd5562..ceb7b7f 100644 --- a/docs/Placeholders_8h.html +++ b/docs/Placeholders_8h.html @@ -119,7 +119,7 @@ Variables diff --git a/docs/Placeholders_8h_source.html b/docs/Placeholders_8h_source.html index 5636f6c..a8812ad 100644 --- a/docs/Placeholders_8h_source.html +++ b/docs/Placeholders_8h_source.html @@ -90,11 +90,11 @@ $(function() {
10  }
11 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::Placeholders::g_emptyString
static const std::string g_emptyString
The only purpose of this is to provide the ability to return an empty string as an error for std::str...
Definition: Placeholders.h:9
diff --git a/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html b/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html index 835a1fb..31bfa75 100644 --- a/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html +++ b/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/StringTools_8cpp.html b/docs/StringTools_8cpp.html index 483a706..704217c 100644 --- a/docs/StringTools_8cpp.html +++ b/docs/StringTools_8cpp.html @@ -97,7 +97,7 @@ Include dependency graph for StringTools.cpp: diff --git a/docs/StringTools_8cpp_source.html b/docs/StringTools_8cpp_source.html index 77398f5..8004039 100644 --- a/docs/StringTools_8cpp_source.html +++ b/docs/StringTools_8cpp_source.html @@ -265,7 +265,7 @@ $(function() {
185  return ss.str();
186 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::Internal::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
Hazelnp::Internal::StringTools::ToLower
static std::string ToLower(const std::string &str)
Will make a string all lower-case.
Definition: StringTools.cpp:173
Hazelnp::Internal::StringTools::Replace
static std::string Replace(const std::string &str, const char find, const std::string &subst)
Will replace a part of a string with another string.
Definition: StringTools.cpp:14
@@ -275,7 +275,7 @@ $(function() {
StringTools.h
diff --git a/docs/StringTools_8h.html b/docs/StringTools_8h.html index 1e80dac..97941f8 100644 --- a/docs/StringTools_8h.html +++ b/docs/StringTools_8h.html @@ -126,7 +126,7 @@ Namespaces diff --git a/docs/StringTools_8h_source.html b/docs/StringTools_8h_source.html index 9af49e8..ef0eba9 100644 --- a/docs/StringTools_8h_source.html +++ b/docs/StringTools_8h_source.html @@ -123,7 +123,7 @@ $(function() {
43 }
44 
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::Internal::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
Hazelnp::Internal::StringTools::ToLower
static std::string ToLower(const std::string &str)
Will make a string all lower-case.
Definition: StringTools.cpp:173
Hazelnp::Internal::StringTools
Internal helper class.
Definition: StringTools.h:13
@@ -133,7 +133,7 @@ $(function() {
Hazelnp::Internal::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
diff --git a/docs/StringValue_8cpp.html b/docs/StringValue_8cpp.html index 89bb8c9..bde395a 100644 --- a/docs/StringValue_8cpp.html +++ b/docs/StringValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for StringValue.cpp: diff --git a/docs/StringValue_8cpp_source.html b/docs/StringValue_8cpp_source.html index ec50099..55a29de 100644 --- a/docs/StringValue_8cpp_source.html +++ b/docs/StringValue_8cpp_source.html @@ -147,7 +147,7 @@ $(function() {
67 }
HazelnuppException.h
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::StringValue::GetInt32
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:44
Hazelnp::StringValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: StringValue.cpp:20
Hazelnp::StringValue::StringValue
StringValue(const std::string &value)
Definition: StringValue.cpp:7
@@ -165,7 +165,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/StringValue_8h.html b/docs/StringValue_8h.html index 73c27d2..ab48635 100644 --- a/docs/StringValue_8h.html +++ b/docs/StringValue_8h.html @@ -123,7 +123,7 @@ Namespaces diff --git a/docs/StringValue_8h_source.html b/docs/StringValue_8h_source.html index 87093e4..df058a6 100644 --- a/docs/StringValue_8h_source.html +++ b/docs/StringValue_8h_source.html @@ -124,7 +124,7 @@ $(function() {
44  };
45 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::StringValue::GetInt32
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:44
Hazelnp::StringValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: StringValue.cpp:20
Hazelnp::StringValue::StringValue
StringValue(const std::string &value)
Definition: StringValue.cpp:7
@@ -141,7 +141,7 @@ $(function() {
Value.h
diff --git a/docs/Value_8cpp.html b/docs/Value_8cpp.html index 7cd94ed..8874cb2 100644 --- a/docs/Value_8cpp.html +++ b/docs/Value_8cpp.html @@ -97,7 +97,7 @@ Include dependency graph for Value.cpp: diff --git a/docs/Value_8cpp_source.html b/docs/Value_8cpp_source.html index 8cddbd0..b163d91 100644 --- a/docs/Value_8cpp_source.html +++ b/docs/Value_8cpp_source.html @@ -94,7 +94,7 @@ $(function() {
14  return type;
15 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::Value::Value
Value(DATA_TYPE type)
Definition: Value.cpp:5
Hazelnp::Value::GetDataType
DATA_TYPE GetDataType() const
Will return the data type of this value.
Definition: Value.cpp:12
Hazelnp::DATA_TYPE
DATA_TYPE
The different data types a paramater can be.
Definition: DataType.h:8
@@ -102,7 +102,7 @@ $(function() {
Value.h
diff --git a/docs/Value_8h.html b/docs/Value_8h.html index 97461e5..6287b61 100644 --- a/docs/Value_8h.html +++ b/docs/Value_8h.html @@ -136,7 +136,7 @@ Namespaces diff --git a/docs/Value_8h_source.html b/docs/Value_8h_source.html index 2a39fd1..cb69dae 100644 --- a/docs/Value_8h_source.html +++ b/docs/Value_8h_source.html @@ -129,7 +129,7 @@ $(function() {
49  };
50 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
DataType.h
Hazelnp::Value::GetFloat32
virtual double GetFloat32() const =0
Will attempt to return the floating-point data (double)
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
@@ -148,7 +148,7 @@ $(function() {
Hazelnp::Value::GetFloat64
virtual long double GetFloat64() const =0
Will attempt to return the floating-point data (long double)
diff --git a/docs/Version_8h.html b/docs/Version_8h.html new file mode 100644 index 0000000..88eb5c0 --- /dev/null +++ b/docs/Version_8h.html @@ -0,0 +1,126 @@ + + + + + + + +Leonetienne/Hazelnupp: Hazelnupp/Version.h File Reference + + + + + + + + + + + +
+
+

Namespaces

+ + + + + + +
+
Leonetienne/Hazelnupp +
+
Simple, easy to use, command line parameter interface
+
+ + + + + + + + + +
+
+ + +
+ +
+ + + +
+
+Macros
+
+
Version.h File Reference
+
+
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Macros

#define HAZELNUPP_VERSION   (1.1)
 
+

Macro Definition Documentation

+ +

◆ HAZELNUPP_VERSION

+ +
+
+ + + + +
#define HAZELNUPP_VERSION   (1.1)
+
+ +

Definition at line 2 of file Version.h.

+ +
+
+
+ + + + diff --git a/docs/Version_8h__dep__incl.map b/docs/Version_8h__dep__incl.map new file mode 100644 index 0000000..ec3789b --- /dev/null +++ b/docs/Version_8h__dep__incl.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/Version_8h__dep__incl.md5 b/docs/Version_8h__dep__incl.md5 new file mode 100644 index 0000000..37e3bcb --- /dev/null +++ b/docs/Version_8h__dep__incl.md5 @@ -0,0 +1 @@ +92ebb13d9fcb4c4be1ddcf0283b48ade \ No newline at end of file diff --git a/docs/Version_8h__dep__incl.png b/docs/Version_8h__dep__incl.png new file mode 100644 index 0000000..f14d5a2 Binary files /dev/null and b/docs/Version_8h__dep__incl.png differ diff --git a/docs/Version_8h_source.html b/docs/Version_8h_source.html new file mode 100644 index 0000000..ed9aadc --- /dev/null +++ b/docs/Version_8h_source.html @@ -0,0 +1,91 @@ + + + + + + + +Leonetienne/Hazelnupp: Hazelnupp/Version.h Source File + + + + + + + + + + + +
+
+ + + + + + + +
+
Leonetienne/Hazelnupp +
+
Simple, easy to use, command line parameter interface
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Version.h
+
+
+Go to the documentation of this file.
1 #pragma once
+
2 #define HAZELNUPP_VERSION (1.1)
+
+ + + + diff --git a/docs/VoidValue_8cpp.html b/docs/VoidValue_8cpp.html index eb60109..b08eaba 100644 --- a/docs/VoidValue_8cpp.html +++ b/docs/VoidValue_8cpp.html @@ -102,7 +102,7 @@ Include dependency graph for VoidValue.cpp: diff --git a/docs/VoidValue_8cpp_source.html b/docs/VoidValue_8cpp_source.html index 782f759..ff2e019 100644 --- a/docs/VoidValue_8cpp_source.html +++ b/docs/VoidValue_8cpp_source.html @@ -134,7 +134,7 @@ $(function() {
54 }
HazelnuppException.h
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::VoidValue::GetInt64
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:25
Hazelnp::VoidValue::GetFloat64
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:35
Hazelnp::DATA_TYPE::VOID
@ VOID
@@ -151,7 +151,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/VoidValue_8h.html b/docs/VoidValue_8h.html index 37b30ff..9782ef7 100644 --- a/docs/VoidValue_8h.html +++ b/docs/VoidValue_8h.html @@ -122,7 +122,7 @@ Namespaces diff --git a/docs/VoidValue_8h_source.html b/docs/VoidValue_8h_source.html index 7c95c5e..7f8c44b 100644 --- a/docs/VoidValue_8h_source.html +++ b/docs/VoidValue_8h_source.html @@ -115,7 +115,7 @@ $(function() {
35  };
36 }
-
Hazelnp
Definition: CmdArgsInterface.h:7
+
Hazelnp
Definition: CmdArgsInterface.h:9
Hazelnp::VoidValue::GetInt64
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:25
Hazelnp::VoidValue::~VoidValue
~VoidValue() override
Definition: VoidValue.h:12
Hazelnp::VoidValue::GetFloat64
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:35
@@ -131,7 +131,7 @@ $(function() {
Value.h
diff --git a/docs/annotated.html b/docs/annotated.html index f636bfa..b160b04 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -82,24 +82,25 @@ $(function() {  CCmdArgsInterfaceThe main class to interface with  CFloatValueSpecializations for floating point values (uses long double)  CHazelnuppConstraintExceptionGets thrown something bad happens because of parameter constraints - CHazelnuppConstraintMissingValueGets thrown when a parameter constrained to be required is not provided, and has no default value set - CHazelnuppConstraintTypeMissmatchGets thrown when a parameter is of a type that does not match the required type, and is not convertible to it - CHazelnuppExceptionGeneric hazelnupp exception - CHazelnuppInvalidKeyExceptionGets thrown when an non-existent key gets dereferenced - CHazelnuppValueNotConvertibleExceptionGets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible - CIntValueSpecializations for integer values (uses long long int) - CListValueSpecializations for list values (uses std::vector<Value*>) - CParamConstraint - CParameter - CStringValueSpecializations for string values (uses std::string) - CValueAbstract class for values - CVoidValueSpecializations for void values + CHazelnuppConstraintIncompatibleParametersGets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones + CHazelnuppConstraintMissingValueGets thrown when a parameter constrained to be required is not provided, and has no default value set + CHazelnuppConstraintTypeMissmatchGets thrown when a parameter is of a type that does not match the required type, and is not convertible to it + CHazelnuppExceptionGeneric hazelnupp exception + CHazelnuppInvalidKeyExceptionGets thrown when an non-existent key gets dereferenced + CHazelnuppValueNotConvertibleExceptionGets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible + CIntValueSpecializations for integer values (uses long long int) + CListValueSpecializations for list values (uses std::vector<Value*>) + CParamConstraint + CParameter + CStringValueSpecializations for string values (uses std::string) + CValueAbstract class for values + CVoidValueSpecializations for void values diff --git a/docs/classHazelnp_1_1CmdArgsInterface-members.html b/docs/classHazelnp_1_1CmdArgsInterface-members.html index c45ece5..d81f960 100644 --- a/docs/classHazelnp_1_1CmdArgsInterface-members.html +++ b/docs/classHazelnp_1_1CmdArgsInterface-members.html @@ -112,7 +112,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1CmdArgsInterface.html b/docs/classHazelnp_1_1CmdArgsInterface.html index 68ba37c..d3025f7 100644 --- a/docs/classHazelnp_1_1CmdArgsInterface.html +++ b/docs/classHazelnp_1_1CmdArgsInterface.html @@ -175,7 +175,7 @@ Public Member Functions

Detailed Description

The main class to interface with.

-

Definition at line 11 of file CmdArgsInterface.h.

+

Definition at line 13 of file CmdArgsInterface.h.

Constructor & Destructor Documentation

◆ CmdArgsInterface() [1/2]

@@ -281,11 +281,11 @@ Public Member Functions


IMPORTANT: This parameter is the abbreviation! Not the long form!

-

Definition at line 586 of file CmdArgsInterface.cpp.

-
587 {
-
588  parameterAbreviations.erase(abbrevation);
-
589  return;
-
590 }
+

Definition at line 632 of file CmdArgsInterface.cpp.

+
633 {
+
634  parameterAbreviations.erase(abbrevation);
+
635  return;
+
636 }
@@ -306,11 +306,11 @@ Public Member Functions

Will delete all abbreviations.

-

Definition at line 592 of file CmdArgsInterface.cpp.

-
593 {
-
594  parameterAbreviations.clear();
-
595  return;
-
596 }
+

Definition at line 638 of file CmdArgsInterface.cpp.

+
639 {
+
640  parameterAbreviations.clear();
+
641  return;
+
642 }
@@ -332,11 +332,11 @@ Public Member Functions

Will the constraint of a specific parameter.

-

Definition at line 547 of file CmdArgsInterface.cpp.

-
548 {
-
549  parameterConstraints.erase(parameter);
-
550  return;
-
551 }
+

Definition at line 593 of file CmdArgsInterface.cpp.

+
594 {
+
595  parameterConstraints.erase(parameter);
+
596  return;
+
597 }
@@ -357,11 +357,11 @@ Public Member Functions

Will delete all constraints.

-

Definition at line 605 of file CmdArgsInterface.cpp.

-
606 {
-
607  parameterConstraints.clear();
-
608  return;
-
609 }
+

Definition at line 651 of file CmdArgsInterface.cpp.

+
652 {
+
653  parameterConstraints.clear();
+
654  return;
+
655 }
@@ -383,12 +383,12 @@ Public Member Functions

Will delete the description of a parameter if it exists.

-

Definition at line 378 of file CmdArgsInterface.cpp.

-
379 {
-
380  // This will just do nothing if the entry does not exist
-
381  parameterDescriptions.erase(parameter);
-
382  return;
-
383 }
+

Definition at line 412 of file CmdArgsInterface.cpp.

+
413 {
+
414  // This will just do nothing if the entry does not exist
+
415  parameterDescriptions.erase(parameter);
+
416  return;
+
417 }
@@ -409,11 +409,11 @@ Public Member Functions

Will delete all parameter descriptions.

-

Definition at line 385 of file CmdArgsInterface.cpp.

-
386 {
-
387  parameterDescriptions.clear();
-
388  return;
-
389 }
+

Definition at line 419 of file CmdArgsInterface.cpp.

+
420 {
+
421  parameterDescriptions.clear();
+
422  return;
+
423 }
@@ -434,119 +434,119 @@ Public Member Functions

Will generate a text-based documentation suited to show the user, for example on –help.

-

Definition at line 391 of file CmdArgsInterface.cpp.

-
392 {
-
393  std::stringstream ss;
-
394 
-
395  // Add brief, if available
-
396  if (briefDescription.length() > 0)
-
397  ss << briefDescription << std::endl;
-
398 
-
399  // Collect parameter information
-
400  struct ParamDocEntry
-
401  {
-
402  std::string abbreviation;
-
403  std::string description;
-
404  std::string type;
-
405  bool required = false;
-
406  bool typeIsForced = false;
-
407  std::string defaultVal;
-
408  };
-
409  std::unordered_map<std::string, ParamDocEntry> paramInfos;
-
410 
-
411  // Collect descriptions
-
412  for (const auto& it : parameterDescriptions)
-
413  {
-
414  // Do we already have that param in the paramInfo set?
-
415  if (paramInfos.find(it.first) == paramInfos.end())
-
416  // No? Create it.
-
417  paramInfos[it.first] = ParamDocEntry();
-
418 
-
419  paramInfos[it.first].description = it.second;
-
420  }
-
421 
-
422  // Collect abbreviations
-
423  // first value is abbreviation, second is long form
-
424  for (const auto& it : parameterAbreviations)
-
425  {
-
426  // Do we already have that param in the paramInfo set?
-
427  if (paramInfos.find(it.second) == paramInfos.end())
-
428  // No? Create it.
-
429  paramInfos[it.second] = ParamDocEntry();
-
430 
-
431  paramInfos[it.second].abbreviation = it.first;
-
432  }
-
433 
-
434  // Collect constraints
-
435  for (const auto& it : parameterConstraints)
-
436  {
-
437  // Do we already have that param in the paramInfo set?
-
438  if (paramInfos.find(it.first) == paramInfos.end())
-
439  // No? Create it.
-
440  paramInfos[it.first] = ParamDocEntry();
-
441 
-
442  ParamDocEntry& cached = paramInfos[it.first];
-
443  cached.required = it.second.required;
-
444  cached.typeIsForced = it.second.constrainType;
-
445  cached.type = DataTypeToString(it.second.requiredType);
-
446 
-
447  std::stringstream defaultValueSs;
-
448  for (const std::string& s : it.second.defaultValue)
-
449  {
-
450  defaultValueSs << '\'' << s << '\'';
-
451 
-
452  // Add a space if we are not at the last entry
-
453  if ((void*)&s != (void*)&it.second.defaultValue.back())
-
454  defaultValueSs << " ";
-
455  }
-
456  cached.defaultVal = defaultValueSs.str();
-
457  }
-
458 
-
459  // Now generate the documentatino body
-
460  if (paramInfos.size() > 0)
-
461  {
-
462  ss << std::endl
-
463  << "==== AVAILABLE PARAMETERS ===="
-
464  << std::endl << std::endl;
-
465 
-
466  std::size_t counter = 0;
-
467  for (const auto& it : paramInfos)
-
468  {
-
469  const ParamDocEntry& pde = it.second;
-
470 
-
471  // Put name
-
472  ss << it.first << " ";
-
473 
-
474  // Put abbreviation
-
475  if (pde.abbreviation.length() > 0)
-
476  ss << pde.abbreviation << " ";
-
477 
-
478  // Put type
-
479  if (pde.typeIsForced)
-
480  ss << pde.type << " ";
-
481 
-
482  // Put default value
-
483  if (pde.defaultVal.length() > 0)
-
484  ss << "default=[" << pde.defaultVal << "] ";
+

Definition at line 425 of file CmdArgsInterface.cpp.

+
426 {
+
427  std::stringstream ss;
+
428 
+
429  // Add brief, if available
+
430  if (briefDescription.length() > 0)
+
431  ss << briefDescription << std::endl;
+
432 
+
433  // Collect parameter information
+
434  struct ParamDocEntry
+
435  {
+
436  std::string abbreviation;
+
437  std::string description;
+
438  std::string type;
+
439  bool required = false;
+
440  bool typeIsForced = false;
+
441  std::string defaultVal;
+
442  };
+
443  std::unordered_map<std::string, ParamDocEntry> paramInfos;
+
444 
+
445  // Collect descriptions
+
446  for (const auto& it : parameterDescriptions)
+
447  {
+
448  // Do we already have that param in the paramInfo set?
+
449  if (paramInfos.find(it.first) == paramInfos.end())
+
450  // No? Create it.
+
451  paramInfos[it.first] = ParamDocEntry();
+
452 
+
453  paramInfos[it.first].description = it.second;
+
454  }
+
455 
+
456  // Collect abbreviations
+
457  // first value is abbreviation, second is long form
+
458  for (const auto& it : parameterAbreviations)
+
459  {
+
460  // Do we already have that param in the paramInfo set?
+
461  if (paramInfos.find(it.second) == paramInfos.end())
+
462  // No? Create it.
+
463  paramInfos[it.second] = ParamDocEntry();
+
464 
+
465  paramInfos[it.second].abbreviation = it.first;
+
466  }
+
467 
+
468  // Collect constraints
+
469  for (const auto& it : parameterConstraints)
+
470  {
+
471  // Do we already have that param in the paramInfo set?
+
472  if (paramInfos.find(it.first) == paramInfos.end())
+
473  // No? Create it.
+
474  paramInfos[it.first] = ParamDocEntry();
+
475 
+
476  ParamDocEntry& cached = paramInfos[it.first];
+
477  cached.required = it.second.required;
+
478  cached.typeIsForced = it.second.constrainType;
+
479  cached.type = DataTypeToString(it.second.requiredType);
+
480 
+
481  std::stringstream defaultValueSs;
+
482  for (const std::string& s : it.second.defaultValue)
+
483  {
+
484  defaultValueSs << '\'' << s << '\'';
485 
-
486  // Put required tag, but only if no default value
-
487  if ((pde.required) && (pde.defaultVal.length() == 0))
-
488  ss << "[[REQUIRED]] ";
-
489 
-
490  // Put brief description
-
491  if (pde.description.length() > 0)
-
492  ss << pde.description;
-
493 
-
494  // Omit linebreaks when we're on the last element
-
495  if (counter < paramInfos.size()-1)
-
496  ss << std::endl << std::endl;
-
497 
-
498  counter++;
-
499  }
-
500  }
-
501 
-
502  return ss.str();
-
503 }
+
486  // Add a space if we are not at the last entry
+
487  if ((void*)&s != (void*)&it.second.defaultValue.back())
+
488  defaultValueSs << " ";
+
489  }
+
490  cached.defaultVal = defaultValueSs.str();
+
491  }
+
492 
+
493  // Now generate the documentatino body
+
494  if (paramInfos.size() > 0)
+
495  {
+
496  ss << std::endl
+
497  << "==== AVAILABLE PARAMETERS ===="
+
498  << std::endl << std::endl;
+
499 
+
500  std::size_t counter = 0;
+
501  for (const auto& it : paramInfos)
+
502  {
+
503  const ParamDocEntry& pde = it.second;
+
504 
+
505  // Put name
+
506  ss << it.first << " ";
+
507 
+
508  // Put abbreviation
+
509  if (pde.abbreviation.length() > 0)
+
510  ss << pde.abbreviation << " ";
+
511 
+
512  // Put type
+
513  if (pde.typeIsForced)
+
514  ss << pde.type << " ";
+
515 
+
516  // Put default value
+
517  if (pde.defaultVal.length() > 0)
+
518  ss << "default=[" << pde.defaultVal << "] ";
+
519 
+
520  // Put required tag, but only if no default value
+
521  if ((pde.required) && (pde.defaultVal.length() == 0))
+
522  ss << "[[REQUIRED]] ";
+
523 
+
524  // Put brief description
+
525  if (pde.description.length() > 0)
+
526  ss << pde.description;
+
527 
+
528  // Omit linebreaks when we're on the last element
+
529  if (counter < paramInfos.size()-1)
+
530  ss << std::endl << std::endl;
+
531 
+
532  counter++;
+
533  }
+
534  }
+
535 
+
536  return ss.str();
+
537 }
@@ -569,13 +569,13 @@ Public Member Functions

Will return the long form of an abbreviation (like –force for -f)
Returns "" if no match is found.

-

Definition at line 573 of file CmdArgsInterface.cpp.

-
574 {
-
575  if (!HasAbbreviation(abbrev))
-
576  return Placeholders::g_emptyString;
-
577 
-
578  return parameterAbreviations.find(abbrev)->second;
-
579 }
+

Definition at line 619 of file CmdArgsInterface.cpp.

+
620 {
+
621  if (!HasAbbreviation(abbrev))
+ +
623 
+
624  return parameterAbreviations.find(abbrev)->second;
+
625 }
@@ -596,10 +596,10 @@ Public Member Functions

Returns the brief description of the application to be automatically added to the documentation.

-

Definition at line 351 of file CmdArgsInterface.cpp.

-
352 {
-
353  return briefDescription;
-
354 }
+

Definition at line 385 of file CmdArgsInterface.cpp.

+
386 {
+
387  return briefDescription;
+
388 }
@@ -620,10 +620,10 @@ Public Member Functions

Retruns whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter documentation to stdout, and exit or not.

-

Definition at line 340 of file CmdArgsInterface.cpp.

-
341 {
-
342  return catchHelp;
-
343 }
+

Definition at line 374 of file CmdArgsInterface.cpp.

+
375 {
+
376  return catchHelp;
+
377 }
@@ -645,10 +645,10 @@ Public Member Functions

Will return the constraint information for a specific parameter.

-

Definition at line 542 of file CmdArgsInterface.cpp.

-
543 {
-
544  return parameterConstraints.find(parameter)->second;
-
545 }
+

Definition at line 588 of file CmdArgsInterface.cpp.

+
589 {
+
590  return parameterConstraints.find(parameter)->second;
+
591 }
@@ -669,10 +669,10 @@ Public Member Functions

Gets whether the application crashes on an exception whilst parsing, and prints to stderr.

-

Definition at line 329 of file CmdArgsInterface.cpp.

-
330 {
-
331  return crashOnFail;
-
332 }
+

Definition at line 363 of file CmdArgsInterface.cpp.

+
364 {
+
365  return crashOnFail;
+
366 }
@@ -696,16 +696,16 @@ Public Member Functions


Empty string if it does not exist.

-

Definition at line 362 of file CmdArgsInterface.cpp.

-
363 {
-
364  // Do we already have a description for this parameter?
-
365  if (!HasDescription(parameter))
-
366  // No? Then return ""
-
367  return Placeholders::g_emptyString;
-
368 
-
369  // We do? Then return it
-
370  return parameterDescriptions.find(parameter)->second;
-
371 }
+

Definition at line 396 of file CmdArgsInterface.cpp.

+
397 {
+
398  // Do we already have a description for this parameter?
+
399  if (!HasDescription(parameter))
+
400  // No? Then return ""
+ +
402 
+
403  // We do? Then return it
+
404  return parameterDescriptions.find(parameter)->second;
+
405 }
@@ -726,10 +726,10 @@ Public Member Functions

Will return argv[0], the name of the executable.

-

Definition at line 553 of file CmdArgsInterface.cpp.

-
554 {
-
555  return executableName;
-
556 }
+

Definition at line 599 of file CmdArgsInterface.cpp.

+
600 {
+
601  return executableName;
+
602 }
@@ -751,10 +751,10 @@ Public Member Functions

Will check wether or not an abbreviation is registered.

-

Definition at line 581 of file CmdArgsInterface.cpp.

-
582 {
-
583  return parameterAbreviations.find(abbrev) != parameterAbreviations.end();
-
584 }
+

Definition at line 627 of file CmdArgsInterface.cpp.

+
628 {
+
629  return parameterAbreviations.find(abbrev) != parameterAbreviations.end();
+
630 }
@@ -776,10 +776,10 @@ Public Member Functions

Returns whether or not a given parameter has a registered description.

-

Definition at line 373 of file CmdArgsInterface.cpp.

-
374 {
-
375  return parameterDescriptions.find(parameter) != parameterDescriptions.end();
-
376 }
+

Definition at line 407 of file CmdArgsInterface.cpp.

+
408 {
+
409  return parameterDescriptions.find(parameter) != parameterDescriptions.end();
+
410 }
@@ -801,10 +801,10 @@ Public Member Functions

Will check wether a parameter exists given a key, or not.

-

Definition at line 165 of file CmdArgsInterface.cpp.

-
166 {
-
167  return parameters.find(key) != parameters.end();
-
168 }
+

Definition at line 199 of file CmdArgsInterface.cpp.

+
200 {
+
201  return parameters.find(key) != parameters.end();
+
202 }
@@ -826,14 +826,14 @@ Public Member Functions

Will return the value given a key.

-

Definition at line 558 of file CmdArgsInterface.cpp.

-
559 {
-
560  // Throw exception if param is unknown
-
561  if (!HasParam(key))
-
562  throw HazelnuppInvalidKeyException();
-
563 
-
564  return *parameters.find(key)->second->GetValue();
-
565 }
+

Definition at line 604 of file CmdArgsInterface.cpp.

+
605 {
+
606  // Throw exception if param is unknown
+
607  if (!HasParam(key))
+ +
609 
+
610  return *parameters.find(key)->second->GetValue();
+
611 }
@@ -877,58 +877,92 @@ Public Member Functions
45 
46  executableName = std::string(rawArgs[0]);
47 
-
48  std::size_t i = 1;
-
49  while (i < rawArgs.size())
-
50  {
-
51  if ((rawArgs[i].length() > 2) && (rawArgs[i].substr(0, 2) == "--"))
-
52  {
-
53  Parameter* param = nullptr;
-
54  i = ParseNextParameter(i, param);
-
55 
-
56  parameters.insert(std::pair<std::string, Parameter*>(param->Key(), param));
-
57  }
-
58  else
-
59  i++;
-
60  }
-
61 
-
62  // Apply constraints such as default values, and required parameters.
-
63  // Types have already been enforced.
-
64  // Dont apply constraints when we are just printind the param docs
-
65  if ((!catchHelp) || (!HasParam("--help")))
-
66  ApplyConstraints();
-
67  }
-
68  catch (const HazelnuppConstraintTypeMissmatch& exc)
-
69  {
-
70  if (crashOnFail)
-
71  {
-
72  std::cout << GenerateDocumentation() << std::endl << std::endl;
-
73  std::cerr << "Parameter error: " << exc.What() << std::endl;
-
74  quick_exit(-1009);
-
75  }
-
76  else
-
77  throw exc; // yeet
-
78  }
-
79  catch (const HazelnuppConstraintMissingValue& exc)
-
80  {
-
81  if (crashOnFail)
-
82  {
-
83  std::cout << GenerateDocumentation() << std::endl << std::endl;
-
84  std::cerr << "Parameter error: " << exc.What() << std::endl;
-
85  quick_exit(-1010);
-
86  }
-
87  else
-
88  throw exc; // yeet
-
89  }
-
90 
-
91  // Catch --help parameter
-
92  if ((catchHelp) && (HasParam("--help")))
-
93  {
-
94  std::cout << GenerateDocumentation() << std::endl;
-
95  quick_exit(0);
-
96  }
-
97 
-
98  return;
-
99 }
+
48  // Read and parse all parameters
+
49  std::size_t i = 1;
+
50  while (i < rawArgs.size())
+
51  {
+
52  if ((rawArgs[i].length() > 2) && (rawArgs[i].substr(0, 2) == "--"))
+
53  {
+
54  Parameter* param = nullptr;
+
55  i = ParseNextParameter(i, param);
+
56 
+
57  parameters.insert(std::pair<std::string, Parameter*>(param->Key(), param));
+
58  }
+
59  else
+
60  i++;
+
61  }
+
62 
+
63  // Apply constraints such as default values, and required parameters.
+
64  // Types have already been enforced.
+
65  // Dont apply constraints when we are just printind the param docs
+
66  if ((!catchHelp) || (!HasParam("--help")))
+
67  ApplyConstraints();
+
68  }
+
69  catch (const HazelnuppConstraintIncompatibleParameters& exc)
+
70  {
+
71  if (crashOnFail)
+
72  {
+
73  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
74  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
75  quick_exit(-1000);
+
76  }
+
77  else
+
78  throw exc; // yeet
+
79  }
+
80  catch (const HazelnuppConstraintMissingValue& exc)
+
81  {
+
82  if (crashOnFail)
+
83  {
+
84  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
85  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
86  quick_exit(-1001);
+
87  }
+
88  else
+
89  throw exc; // yeet
+
90  }
+
91  catch (const HazelnuppConstraintTypeMissmatch& exc)
+
92  {
+
93  if (crashOnFail)
+
94  {
+
95  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
96  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
97  quick_exit(-1002);
+
98  }
+
99  else
+
100  throw exc; // yeet
+
101  }
+
102  catch (const HazelnuppConstraintException& exc)
+
103  {
+
104  if (crashOnFail)
+
105  {
+
106  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
107  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
108  quick_exit(-1003);
+
109  }
+
110  else
+
111  throw exc; // yeet
+
112  }
+
113  catch (const HazelnuppException& exc)
+
114  {
+
115  if (crashOnFail)
+
116  {
+
117  std::cout << GenerateDocumentation() << std::endl << std::endl;
+
118  std::cerr << "Parameter error: " << exc.What() << std::endl;
+
119  quick_exit(-1004);
+
120  }
+
121  else
+
122  throw exc; // yeet
+
123  }
+
124 
+
125  // Catch --help parameter
+
126  if ((catchHelp) && (HasParam("--help")))
+
127  {
+
128  std::cout << GenerateDocumentation() << std::endl;
+
129  quick_exit(0);
+
130  }
+
131 
+
132  return;
+
133 }
@@ -960,11 +994,11 @@ Public Member Functions

Will register an abbreviation (like -f for –force)

-

Definition at line 567 of file CmdArgsInterface.cpp.

-
568 {
-
569  parameterAbreviations.insert(std::pair<std::string, std::string>(abbrev, target));
-
570  return;
-
571 }
+

Definition at line 613 of file CmdArgsInterface.cpp.

+
614 {
+
615  parameterAbreviations.insert(std::pair<std::string, std::string>(abbrev, target));
+
616  return;
+
617 }
@@ -995,14 +1029,14 @@ Public Member Functions

Will register a constraint for a parameter.

-

IMPORTANT: Any parameter can only have ONE constraint. Applying a new one will overwrite the old one! Construct the ParamConstraint struct yourself to combine Require and TypeSafety! You can also use the ParamConstraint constructor!

+

IMPORTANT: Any parameter can only have ONE constraint. Applying a new one will overwrite the old one! Construct the ParamConstraint struct yourself to combine Require, TypeSafety and Incompatibilities! You can also use the ParamConstraint constructor!

-

Definition at line 598 of file CmdArgsInterface.cpp.

-
599 {
-
600  // Magic syntax, wooo
-
601  (parameterConstraints[key] = constraint).key = key;
-
602  return;
-
603 }
+

Definition at line 644 of file CmdArgsInterface.cpp.

+
645 {
+
646  // Magic syntax, wooo
+
647  (parameterConstraints[key] = constraint).key = key;
+
648  return;
+
649 }
@@ -1036,11 +1070,11 @@ Public Member Functions


Will overwrite existing descriptions for that parameter.

-

Definition at line 356 of file CmdArgsInterface.cpp.

-
357 {
-
358  parameterDescriptions[parameter] = description;
-
359  return;
-
360 }
+

Definition at line 390 of file CmdArgsInterface.cpp.

+
391 {
+
392  parameterDescriptions[parameter] = description;
+
393  return;
+
394 }
@@ -1062,11 +1096,11 @@ Public Member Functions

Sets a brief description of the application to be automatically added to the documentation.

-

Definition at line 345 of file CmdArgsInterface.cpp.

-
346 {
-
347  briefDescription = description;
-
348  return;
-
349 }
+

Definition at line 379 of file CmdArgsInterface.cpp.

+
380 {
+
381  briefDescription = description;
+
382  return;
+
383 }
@@ -1088,11 +1122,11 @@ Public Member Functions

Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter documentation to stdout, and exit or not.

-

Definition at line 334 of file CmdArgsInterface.cpp.

-
335 {
-
336  this->catchHelp = catchHelp;
-
337  return;
-
338 }
+

Definition at line 368 of file CmdArgsInterface.cpp.

+
369 {
+
370  this->catchHelp = catchHelp;
+
371  return;
+
372 }
@@ -1114,11 +1148,11 @@ Public Member Functions

Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsing, or not.

-

Definition at line 611 of file CmdArgsInterface.cpp.

-
612 {
-
613  this->crashOnFail = crashOnFail;
-
614  return;
-
615 }
+

Definition at line 657 of file CmdArgsInterface.cpp.

+
658 {
+
659  this->crashOnFail = crashOnFail;
+
660  return;
+
661 }
@@ -1127,22 +1161,25 @@ Public Member Functions
  • Hazelnupp/CmdArgsInterface.cpp
  • -
    Hazelnp::CmdArgsInterface::HasAbbreviation
    bool HasAbbreviation(const std::string &abbrev) const
    Will check wether or not an abbreviation is registered.
    Definition: CmdArgsInterface.cpp:581
    +
    Hazelnp::HazelnuppConstraintIncompatibleParameters
    Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied along...
    Definition: HazelnuppException.h:101
    +
    Hazelnp::CmdArgsInterface::HasAbbreviation
    bool HasAbbreviation(const std::string &abbrev) const
    Will check wether or not an abbreviation is registered.
    Definition: CmdArgsInterface.cpp:627
    Hazelnp::HazelnuppInvalidKeyException
    Gets thrown when an non-existent key gets dereferenced.
    Definition: HazelnuppException.h:29
    Hazelnp::HazelnuppException::What
    const std::string & What() const
    Will return an error message.
    Definition: HazelnuppException.h:18
    -
    Hazelnp::CmdArgsInterface::HasParam
    bool HasParam(const std::string &key) const
    Will check wether a parameter exists given a key, or not.
    Definition: CmdArgsInterface.cpp:165
    +
    Hazelnp::HazelnuppConstraintException
    Gets thrown something bad happens because of parameter constraints.
    Definition: HazelnuppException.h:47
    +
    Hazelnp::CmdArgsInterface::HasParam
    bool HasParam(const std::string &key) const
    Will check wether a parameter exists given a key, or not.
    Definition: CmdArgsInterface.cpp:199
    Hazelnp::Parameter
    Definition: Parameter.h:8
    Hazelnp::Placeholders::g_emptyString
    static const std::string g_emptyString
    The only purpose of this is to provide the ability to return an empty string as an error for std::str...
    Definition: Placeholders.h:9
    -
    Hazelnp::CmdArgsInterface::HasDescription
    bool HasDescription(const std::string &parameter) const
    Returns whether or not a given parameter has a registered description.
    Definition: CmdArgsInterface.cpp:373
    +
    Hazelnp::CmdArgsInterface::HasDescription
    bool HasDescription(const std::string &parameter) const
    Returns whether or not a given parameter has a registered description.
    Definition: CmdArgsInterface.cpp:407
    +
    Hazelnp::HazelnuppException
    Generic hazelnupp exception.
    Definition: HazelnuppException.h:11
    Hazelnp::Parameter::Key
    const std::string & Key() const
    Will return the key of this parameter.
    Definition: Parameter.cpp:21
    Hazelnp::HazelnuppConstraintMissingValue
    Gets thrown when a parameter constrained to be required is not provided, and has no default value set...
    Definition: HazelnuppException.h:80
    Hazelnp::HazelnuppConstraintTypeMissmatch
    Gets thrown when a parameter is of a type that does not match the required type, and is not convertib...
    Definition: HazelnuppException.h:56
    Hazelnp::CmdArgsInterface::Parse
    void Parse(const int argc, const char *const *argv)
    Will parse command line arguments.
    Definition: CmdArgsInterface.cpp:36
    -
    Hazelnp::CmdArgsInterface::GenerateDocumentation
    std::string GenerateDocumentation() const
    Will generate a text-based documentation suited to show the user, for example on –help.
    Definition: CmdArgsInterface.cpp:391
    +
    Hazelnp::CmdArgsInterface::GenerateDocumentation
    std::string GenerateDocumentation() const
    Will generate a text-based documentation suited to show the user, for example on –help.
    Definition: CmdArgsInterface.cpp:425
    Hazelnp::DataTypeToString
    static std::string DataTypeToString(DATA_TYPE type)
    Definition: DataType.h:17
    diff --git a/docs/classHazelnp_1_1FloatValue-members.html b/docs/classHazelnp_1_1FloatValue-members.html index 7fab487..a2822fa 100644 --- a/docs/classHazelnp_1_1FloatValue-members.html +++ b/docs/classHazelnp_1_1FloatValue-members.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1FloatValue.html b/docs/classHazelnp_1_1FloatValue.html index 51ab16b..8977d18 100644 --- a/docs/classHazelnp_1_1FloatValue.html +++ b/docs/classHazelnp_1_1FloatValue.html @@ -574,7 +574,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppValueNotConvertibleException
    Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
    Definition: HazelnuppException.h:38
    diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException-members.html b/docs/classHazelnp_1_1HazelnuppConstraintException-members.html index 0abd054..9d79ff1 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintException-members.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintException-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException.html b/docs/classHazelnp_1_1HazelnuppConstraintException.html index 8655c35..037af04 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintException.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintException.html @@ -91,11 +91,12 @@ Inheritance diagram for Hazelnp::HazelnuppConstraintException:
    Inheritance graph
    - - - - - + + + + + +
    [legend]
    @@ -201,7 +202,7 @@ Additional Inherited Members
    HazelnuppException()
    diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.map b/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.map index e549bde..dc8e7de 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.map +++ b/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.map @@ -1,7 +1,8 @@ - - - - - + + + + + + diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.md5 b/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.md5 index 2e1f6f1..abdf318 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.md5 +++ b/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.md5 @@ -1 +1 @@ -6bfea744987fc602457174078cb295d2 \ No newline at end of file +17838dc81928478a02ebb9e9c8a70244 \ No newline at end of file diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.png b/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.png index 81563bd..ec7bde4 100644 Binary files a/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.png and b/docs/classHazelnp_1_1HazelnuppConstraintException__inherit__graph.png differ diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters-members.html b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters-members.html new file mode 100644 index 0000000..3b79b2b --- /dev/null +++ b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters-members.html @@ -0,0 +1,100 @@ + + + + + + + +Leonetienne/Hazelnupp: Member List + + + + + + + + + + + +
    +
    + + + + + + + +
    +
    Leonetienne/Hazelnupp +
    +
    Simple, easy to use, command line parameter interface
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + + +
    +
    +
    +
    Hazelnp::HazelnuppConstraintIncompatibleParameters Member List
    +
    +
    + +

    This is the complete list of members for Hazelnp::HazelnuppConstraintIncompatibleParameters, including all inherited members.

    + + + + + + + + + +
    HazelnuppConstraintException()Hazelnp::HazelnuppConstraintExceptioninline
    HazelnuppConstraintException(const std::string &msg)Hazelnp::HazelnuppConstraintExceptioninline
    HazelnuppConstraintIncompatibleParameters()Hazelnp::HazelnuppConstraintIncompatibleParametersinline
    HazelnuppConstraintIncompatibleParameters(const std::string &key1, const std::string &key2)Hazelnp::HazelnuppConstraintIncompatibleParametersinline
    HazelnuppException()Hazelnp::HazelnuppExceptioninline
    HazelnuppException(const std::string &msg)Hazelnp::HazelnuppExceptioninline
    messageHazelnp::HazelnuppExceptionprotected
    What() constHazelnp::HazelnuppExceptioninline
    + + + + diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters.html b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters.html new file mode 100644 index 0000000..b94b0dc --- /dev/null +++ b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters.html @@ -0,0 +1,232 @@ + + + + + + + +Leonetienne/Hazelnupp: Hazelnp::HazelnuppConstraintIncompatibleParameters Class Reference + + + + + + + + + + + +
    +
    + + + + + + + +
    +
    Leonetienne/Hazelnupp +
    +
    Simple, easy to use, command line parameter interface
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + + +
    +
    + +
    +
    Hazelnp::HazelnuppConstraintIncompatibleParameters Class Reference
    +
    +
    + +

    Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones. + More...

    + +

    #include <HazelnuppException.h>

    +
    +Inheritance diagram for Hazelnp::HazelnuppConstraintIncompatibleParameters:
    +
    +
    Inheritance graph
    + + + + + + +
    [legend]
    +
    +Collaboration diagram for Hazelnp::HazelnuppConstraintIncompatibleParameters:
    +
    +
    Collaboration graph
    + + + + + + + + +
    [legend]
    + + + + + + + + + + + + + + + + + + + +

    +Public Member Functions

     HazelnuppConstraintIncompatibleParameters ()
     
     HazelnuppConstraintIncompatibleParameters (const std::string &key1, const std::string &key2)
     
    - Public Member Functions inherited from Hazelnp::HazelnuppConstraintException
     HazelnuppConstraintException ()
     
     HazelnuppConstraintException (const std::string &msg)
     
    - Public Member Functions inherited from Hazelnp::HazelnuppException
     HazelnuppException ()
     
     HazelnuppException (const std::string &msg)
     
    const std::string & What () const
     Will return an error message. More...
     
    + + + + +

    +Additional Inherited Members

    - Protected Attributes inherited from Hazelnp::HazelnuppException
    std::string message
     
    +

    Detailed Description

    +

    Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones.

    + +

    Definition at line 101 of file HazelnuppException.h.

    +

    Constructor & Destructor Documentation

    + +

    ◆ HazelnuppConstraintIncompatibleParameters() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + +
    Hazelnp::HazelnuppConstraintIncompatibleParameters::HazelnuppConstraintIncompatibleParameters ()
    +
    +inline
    +
    + +

    Definition at line 104 of file HazelnuppException.h.

    + +
    +
    + +

    ◆ HazelnuppConstraintIncompatibleParameters() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    Hazelnp::HazelnuppConstraintIncompatibleParameters::HazelnuppConstraintIncompatibleParameters (const std::string & key1,
    const std::string & key2 
    )
    +
    +inline
    +
    + +

    Definition at line 105 of file HazelnuppException.h.

    +
    106  {
    +
    107  // Generate descriptive error message
    +
    108  std::stringstream ss;
    +
    109  ss << "Parameter \"" << key1 << "\" is NOT compatible with parameter \"" << key2 << "\"!";
    +
    110 
    +
    111  message = ss.str();
    +
    112  return;
    +
    113  };
    +
    +
    +
    +
    The documentation for this class was generated from the following file: +
    +
    HazelnuppConstraintException()
    +
    std::string message
    + + + + diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.map b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.map new file mode 100644 index 0000000..4595aa7 --- /dev/null +++ b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.md5 b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.md5 new file mode 100644 index 0000000..d63b369 --- /dev/null +++ b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.md5 @@ -0,0 +1 @@ +ff792383829de5757a3c68b58f7a2cf3 \ No newline at end of file diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.png b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.png new file mode 100644 index 0000000..464b775 Binary files /dev/null and b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__coll__graph.png differ diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.map b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.map new file mode 100644 index 0000000..28db713 --- /dev/null +++ b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.md5 b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.md5 new file mode 100644 index 0000000..e5f1c0e --- /dev/null +++ b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.md5 @@ -0,0 +1 @@ +dc39f190a0e77f6af97e4154d9f9a859 \ No newline at end of file diff --git a/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.png b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.png new file mode 100644 index 0000000..defcd6e Binary files /dev/null and b/docs/classHazelnp_1_1HazelnuppConstraintIncompatibleParameters__inherit__graph.png differ diff --git a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html index ab472b6..8da631e 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html @@ -92,7 +92,7 @@ $(function() {
    diff --git a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html index 4215a19..566f7d6 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html @@ -228,7 +228,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppException::message
    std::string message
    Definition: HazelnuppException.h:24
    diff --git a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html index 5a149a8..691acca 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html index c341c46..9a33e23 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html @@ -273,7 +273,7 @@ Additional Inherited Members
    Hazelnp::DataTypeToString
    static std::string DataTypeToString(DATA_TYPE type)
    Definition: DataType.h:17
    diff --git a/docs/classHazelnp_1_1HazelnuppException-members.html b/docs/classHazelnp_1_1HazelnuppException-members.html index ea6c835..55574d7 100644 --- a/docs/classHazelnp_1_1HazelnuppException-members.html +++ b/docs/classHazelnp_1_1HazelnuppException-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppException.html b/docs/classHazelnp_1_1HazelnuppException.html index 252229b..caf92d2 100644 --- a/docs/classHazelnp_1_1HazelnuppException.html +++ b/docs/classHazelnp_1_1HazelnuppException.html @@ -92,13 +92,14 @@ Inheritance diagram for Hazelnp::HazelnuppException:
    Inheritance graph
    - - - - - - - + + + + + + + +
    [legend]
    @@ -255,7 +256,7 @@ Protected Attributes
    std::string message
    diff --git a/docs/classHazelnp_1_1HazelnuppException__inherit__graph.map b/docs/classHazelnp_1_1HazelnuppException__inherit__graph.map index a6ea366..b911a6d 100644 --- a/docs/classHazelnp_1_1HazelnuppException__inherit__graph.map +++ b/docs/classHazelnp_1_1HazelnuppException__inherit__graph.map @@ -1,9 +1,10 @@ - - - - - - - + + + + + + + + diff --git a/docs/classHazelnp_1_1HazelnuppException__inherit__graph.md5 b/docs/classHazelnp_1_1HazelnuppException__inherit__graph.md5 index 62507df..f8cb4b9 100644 --- a/docs/classHazelnp_1_1HazelnuppException__inherit__graph.md5 +++ b/docs/classHazelnp_1_1HazelnuppException__inherit__graph.md5 @@ -1 +1 @@ -00b4353ac48aa1c3c667f124b7f43920 \ No newline at end of file +c69be8783237f5d99a8ac4955ca40a9d \ No newline at end of file diff --git a/docs/classHazelnp_1_1HazelnuppException__inherit__graph.png b/docs/classHazelnp_1_1HazelnuppException__inherit__graph.png index cd68df8..765dcfd 100644 Binary files a/docs/classHazelnp_1_1HazelnuppException__inherit__graph.png and b/docs/classHazelnp_1_1HazelnuppException__inherit__graph.png differ diff --git a/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html b/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html index 26e24e3..c42b673 100644 --- a/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html +++ b/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html @@ -90,7 +90,7 @@ $(function() {
    diff --git a/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html b/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html index ac0f4a5..b93359c 100644 --- a/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html +++ b/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html @@ -199,7 +199,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppException::HazelnuppException
    HazelnuppException()
    Definition: HazelnuppException.h:14
    diff --git a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html index 7604f41..374f8f6 100644 --- a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html +++ b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html index 4bf567a..a4181b3 100644 --- a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html +++ b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html @@ -199,7 +199,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppException::HazelnuppException
    HazelnuppException()
    Definition: HazelnuppException.h:14
    diff --git a/docs/classHazelnp_1_1IntValue-members.html b/docs/classHazelnp_1_1IntValue-members.html index 644cfcc..ca99408 100644 --- a/docs/classHazelnp_1_1IntValue-members.html +++ b/docs/classHazelnp_1_1IntValue-members.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1IntValue.html b/docs/classHazelnp_1_1IntValue.html index c2c9c9b..93bf8a3 100644 --- a/docs/classHazelnp_1_1IntValue.html +++ b/docs/classHazelnp_1_1IntValue.html @@ -574,7 +574,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppValueNotConvertibleException
    Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
    Definition: HazelnuppException.h:38
    diff --git a/docs/classHazelnp_1_1Internal_1_1StringTools-members.html b/docs/classHazelnp_1_1Internal_1_1StringTools-members.html index 72cf076..2a44f5b 100644 --- a/docs/classHazelnp_1_1Internal_1_1StringTools-members.html +++ b/docs/classHazelnp_1_1Internal_1_1StringTools-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1Internal_1_1StringTools.html b/docs/classHazelnp_1_1Internal_1_1StringTools.html index b5625a0..041fcff 100644 --- a/docs/classHazelnp_1_1Internal_1_1StringTools.html +++ b/docs/classHazelnp_1_1Internal_1_1StringTools.html @@ -626,7 +626,7 @@ Static Public Member Functions
    Hazelnp::Internal::StringTools::SplitString
    static std::vector< std::string > SplitString(const std::string &str, const char delimiter)
    Will split a string by a delimiter char. The delimiter will be excluded!
    Definition: StringTools.cpp:125
    diff --git a/docs/classHazelnp_1_1ListValue-members.html b/docs/classHazelnp_1_1ListValue-members.html index 32ce408..d10bb6c 100644 --- a/docs/classHazelnp_1_1ListValue-members.html +++ b/docs/classHazelnp_1_1ListValue-members.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1ListValue.html b/docs/classHazelnp_1_1ListValue.html index 8e458f7..8bdc99c 100644 --- a/docs/classHazelnp_1_1ListValue.html +++ b/docs/classHazelnp_1_1ListValue.html @@ -601,7 +601,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppValueNotConvertibleException
    Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
    Definition: HazelnuppException.h:38
    diff --git a/docs/classHazelnp_1_1Parameter-members.html b/docs/classHazelnp_1_1Parameter-members.html index e79893b..83491d1 100644 --- a/docs/classHazelnp_1_1Parameter-members.html +++ b/docs/classHazelnp_1_1Parameter-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1Parameter.html b/docs/classHazelnp_1_1Parameter.html index ca33a33..adef864 100644 --- a/docs/classHazelnp_1_1Parameter.html +++ b/docs/classHazelnp_1_1Parameter.html @@ -275,7 +275,7 @@ Friends
    Hazelnp::Value::Deepcopy
    virtual Value * Deepcopy() const =0
    Will return a deeopopy of this object.
    diff --git a/docs/classHazelnp_1_1StringValue-members.html b/docs/classHazelnp_1_1StringValue-members.html index f6b3d06..531a8f9 100644 --- a/docs/classHazelnp_1_1StringValue-members.html +++ b/docs/classHazelnp_1_1StringValue-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1StringValue.html b/docs/classHazelnp_1_1StringValue.html index f7dc7ef..02a9406 100644 --- a/docs/classHazelnp_1_1StringValue.html +++ b/docs/classHazelnp_1_1StringValue.html @@ -547,7 +547,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppValueNotConvertibleException
    Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
    Definition: HazelnuppException.h:38
    diff --git a/docs/classHazelnp_1_1Value-members.html b/docs/classHazelnp_1_1Value-members.html index e43eddc..0eedf6a 100644 --- a/docs/classHazelnp_1_1Value-members.html +++ b/docs/classHazelnp_1_1Value-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1Value.html b/docs/classHazelnp_1_1Value.html index d559254..9b20c1d 100644 --- a/docs/classHazelnp_1_1Value.html +++ b/docs/classHazelnp_1_1Value.html @@ -548,7 +548,7 @@ Friends
    Hazelnp::Value::type
    DATA_TYPE type
    Definition: Value.h:48
    diff --git a/docs/classHazelnp_1_1VoidValue-members.html b/docs/classHazelnp_1_1VoidValue-members.html index 949dec6..0499f22 100644 --- a/docs/classHazelnp_1_1VoidValue-members.html +++ b/docs/classHazelnp_1_1VoidValue-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1VoidValue.html b/docs/classHazelnp_1_1VoidValue.html index 36e1b24..c751f81 100644 --- a/docs/classHazelnp_1_1VoidValue.html +++ b/docs/classHazelnp_1_1VoidValue.html @@ -494,7 +494,7 @@ Additional Inherited Members
    Hazelnp::HazelnuppValueNotConvertibleException
    Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
    Definition: HazelnuppException.h:38
    diff --git a/docs/classes.html b/docs/classes.html index ef13a7e..2a0e0c9 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -78,52 +78,53 @@ $(function() { - + - + - + - + - + - + + - - + - + +
      c  
    HazelnuppConstraintMissingValue (Hazelnp)   HazelnuppConstraintIncompatibleParameters (Hazelnp)   
      l  
      s  
    VoidValue (Hazelnp)   
    HazelnuppConstraintTypeMissmatch (Hazelnp)   
    HazelnuppConstraintMissingValue (Hazelnp)   
    CmdArgsInterface (Hazelnp)   HazelnuppException (Hazelnp)   HazelnuppConstraintTypeMissmatch (Hazelnp)    ListValue (Hazelnp)    StringTools (Hazelnp::Internal)   
      f  
    HazelnuppInvalidKeyException (Hazelnp)   HazelnuppException (Hazelnp)   
      p  
    StringValue (Hazelnp)   
    HazelnuppValueNotConvertibleException (Hazelnp)   
    HazelnuppInvalidKeyException (Hazelnp)   
      v  
    FloatValue (Hazelnp)   
      i  
    -
    HazelnuppValueNotConvertibleException (Hazelnp)    ParamConstraint (Hazelnp)   
      h  
      i  
    +
    Parameter (Hazelnp)    Value (Hazelnp)   
    IntValue (Hazelnp)   
    HazelnuppConstraintException (Hazelnp)   
    IntValue (Hazelnp)   
    c | f | h | i | l | p | s | v
    diff --git a/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html b/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html index 808ddfd..8363b5e 100644 --- a/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html +++ b/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html @@ -128,6 +128,8 @@ Files   file  Value.h [code]   +file  Version.h [code] +  file  VoidValue.cpp [code]   file  VoidValue.h [code] @@ -136,7 +138,7 @@ Files diff --git a/docs/dir_0cc5f59b28c403d42cc56800132eb975.html b/docs/dir_0cc5f59b28c403d42cc56800132eb975.html index 86fb80f..7c7fab5 100644 --- a/docs/dir_0cc5f59b28c403d42cc56800132eb975.html +++ b/docs/dir_0cc5f59b28c403d42cc56800132eb975.html @@ -81,7 +81,7 @@ $(function() { diff --git a/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html b/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html index 67654db..ff43e43 100644 --- a/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html +++ b/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html @@ -81,7 +81,7 @@ $(function() { diff --git a/docs/dir_a8cffda729361e9d9637effa362fcea9.html b/docs/dir_a8cffda729361e9d9637effa362fcea9.html index 29262fd..e2ff909 100644 --- a/docs/dir_a8cffda729361e9d9637effa362fcea9.html +++ b/docs/dir_a8cffda729361e9d9637effa362fcea9.html @@ -81,7 +81,7 @@ $(function() { diff --git a/docs/files.html b/docs/files.html index 94bdee7..d9cc59d 100644 --- a/docs/files.html +++ b/docs/files.html @@ -100,14 +100,15 @@ $(function() {  StringValue.h  Value.cpp  Value.h - VoidValue.cpp - VoidValue.h + Version.h + VoidValue.cpp + VoidValue.h diff --git a/docs/functions.html b/docs/functions.html index f19873b..676a4e8 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -240,6 +240,9 @@ $(function() {
  • HazelnuppConstraintException() : Hazelnp::HazelnuppConstraintException
  • +
  • HazelnuppConstraintIncompatibleParameters() +: Hazelnp::HazelnuppConstraintIncompatibleParameters +
  • HazelnuppConstraintMissingValue() : Hazelnp::HazelnuppConstraintMissingValue
  • @@ -259,6 +262,12 @@ $(function() {

    - i -

    -
    Hazelnp::ParamConstraint::requiredType
    DATA_TYPE requiredType
    Constrain the parameter to this value. Requires constrainType to be set to true.
    Definition: ParamConstraint.h:51
    -
    Hazelnp::ParamConstraint::constrainType
    bool constrainType
    Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
    Definition: ParamConstraint.h:48
    +
    Hazelnp::ParamConstraint::requiredType
    DATA_TYPE requiredType
    Constrain the parameter to this value. Requires constrainType to be set to true.
    Definition: ParamConstraint.h:73
    +
    Hazelnp::ParamConstraint::constrainType
    bool constrainType
    Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
    Definition: ParamConstraint.h:70
    Hazelnp::ParamConstraint::ParamConstraint
    ParamConstraint()=default
    Empty constructor.
    -
    Hazelnp::ParamConstraint::required
    bool required
    If set to true, and no default value set, an error will be produced if this parameter is not supplied...
    Definition: ParamConstraint.h:60
    -
    Hazelnp::ParamConstraint::defaultValue
    std::vector< std::string > defaultValue
    The default value for this parameter.
    Definition: ParamConstraint.h:56
    +
    Hazelnp::ParamConstraint::incompatibleParameters
    std::vector< std::string > incompatibleParameters
    Parameters that are incompatible with this parameter.
    Definition: ParamConstraint.h:85
    +
    Hazelnp::ParamConstraint::required
    bool required
    If set to true, and no default value set, an error will be produced if this parameter is not supplied...
    Definition: ParamConstraint.h:82
    +
    Hazelnp::ParamConstraint::defaultValue
    std::vector< std::string > defaultValue
    The default value for this parameter.
    Definition: ParamConstraint.h:78
    diff --git a/docs/structHazelnp_1_1ParamConstraint__coll__graph.map b/docs/structHazelnp_1_1ParamConstraint__coll__graph.map index a80797d..c44528c 100644 --- a/docs/structHazelnp_1_1ParamConstraint__coll__graph.map +++ b/docs/structHazelnp_1_1ParamConstraint__coll__graph.map @@ -1,5 +1,5 @@ - + diff --git a/docs/structHazelnp_1_1ParamConstraint__coll__graph.md5 b/docs/structHazelnp_1_1ParamConstraint__coll__graph.md5 index 68bbe9f..9cc78e1 100644 --- a/docs/structHazelnp_1_1ParamConstraint__coll__graph.md5 +++ b/docs/structHazelnp_1_1ParamConstraint__coll__graph.md5 @@ -1 +1 @@ -f955d2f831670f6c2a655e2a102ff0d6 \ No newline at end of file +a459875e45a00cc653331d1a1106e8e6 \ No newline at end of file diff --git a/docs/structHazelnp_1_1ParamConstraint__coll__graph.png b/docs/structHazelnp_1_1ParamConstraint__coll__graph.png index a6fdeb9..31bc4a1 100644 Binary files a/docs/structHazelnp_1_1ParamConstraint__coll__graph.png and b/docs/structHazelnp_1_1ParamConstraint__coll__graph.png differ