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 <iomanip>
29 #include <sstream>
30 
31 #include <boost/program_options.hpp>
32 
33 #include <SimoxUtility/algorithm/string/string_tools.h>
34 
35 namespace armarx
36 {
38  boost::program_options::options_description* optionsDescription)
39  {
40  this->optionsDescription = optionsDescription;
41  }
42 
43  std::string
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()((getPrefix() + name + " =").c_str(),
61  boost::program_options::value<std::string>(),
62  propertyDescription.c_str());
63 
64  return std::string();
65  }
66 
67  std::string
69  {
70  return "==================================================================\n" + headerText +
71  "\n" + "==================================================================\n\n";
72  }
73 } // namespace armarx
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:297
armarx::PropertyDefinitionBriefHelpFormatter::optionsDescription
boost::program_options::options_description * optionsDescription
Definition: PropertyDefinitionBriefHelpFormatter.h:132
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:44
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
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:78
armarx::min
std::vector< T > min(const std::vector< T > &v1, const std::vector< T > &v2)
Definition: VectorHelpers.h:327
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27