PropertyDefinitionBriefHelpFormatter.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarXCore::core
19  * @author Jan Issac (jan dot issac at gmx dot de)
20  * @date 2012
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 
27 
28 #include <SimoxUtility/algorithm/string/string_tools.h>
29 
30 #include <boost/program_options.hpp>
31 
32 #include <sstream>
33 #include <iomanip>
34 
35 namespace armarx
36 {
38  boost::program_options::options_description* optionsDescription)
39  {
40  this->optionsDescription = optionsDescription;
41  }
42 
44  std::string name,
45  std::string description,
46  std::string min,
47  std::string max,
48  std::string defaultValue,
49  std::string casesensitivity,
50  std::string requirement,
51  std::string regex,
52  std::vector<std::string> values,
53  std::string value)
54  {
55  std::string propertyDescription = description + "\n";
56  if (requirement == "no")
57  {
58  propertyDescription += "(Default: " + defaultValue + ")\n";
59  }
60  optionsDescription->add_options()(
61  (getPrefix() + name + " =").c_str(),
62  boost::program_options::value<std::string>(),
63  propertyDescription.c_str());
64 
65  return std::string();
66  }
67 
68  std::string PropertyDefinitionBriefHelpFormatter::formatHeader(std::string headerText)
69  {
70  return "==================================================================\n"
71  + headerText + "\n"
72  + "==================================================================\n\n";
73  }
74 }
armarx::PropertyDefinitionBriefHelpFormatter::formatHeader
std::string formatHeader(std::string headerText) override
Definition: PropertyDefinitionBriefHelpFormatter.cpp:68
armarx::max
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
Definition: VectorHelpers.h:267
armarx::PropertyDefinitionBriefHelpFormatter::optionsDescription
boost::program_options::options_description * optionsDescription
Definition: PropertyDefinitionBriefHelpFormatter.h:111
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::PropertyDefinitionBriefHelpFormatter::formatDefinition
std::string formatDefinition(std::string name, std::string description, std::string min, std::string max, std::string defaultValue, std::string casesensitivity, std::string requirement, std::string reged, std::vector< std::string > values, std::string value) override
Definition: PropertyDefinitionBriefHelpFormatter.cpp:43
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
PropertyDefinitionBriefHelpFormatter.h
armarx::PropertyDefinitionBriefHelpFormatter::PropertyDefinitionBriefHelpFormatter
PropertyDefinitionBriefHelpFormatter(boost::program_options::options_description *optionsDescription)
Definition: PropertyDefinitionBriefHelpFormatter.cpp:37
armarx::PropertyDefinitionFormatter::getPrefix
virtual std::string getPrefix() const
Definition: PropertyDefinitionFormatter.h:75
armarx::min
std::vector< T > min(const std::vector< T > &v1, const std::vector< T > &v2)
Definition: VectorHelpers.h:294
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28