Go to the documentation of this file.
27 #include <SimoxUtility/algorithm/string/string_tools.h>
32 CppField::CppField(
const std::string& type,
const std::string& name,
const std::string& default_value,
const std::string& doc):
35 default_value(default_value),
40 throw armarx::LocalException(
"Type of a CppField must not be empty!");
64 for (
const auto& line : lines)
66 writer->body.line(
"/// " + line);
69 std::string decl = (type + (name !=
"" ?
" " + name + (default_value !=
"" ?
" = " + default_value :
"") :
""));
77 writer->body.line(decl);
void setDoc(const std::string &documentation)
CppField(const std::string &type, const std::string &name, const std::string &default_value="", const std::string &doc="")
std::string getType() const
std::string getName() const
bool ends_with(const std::string &haystack, const std::string &needle)
std::shared_ptr< CppWriter > CppWriterPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
void writeCpp(const CppWriterPtr &writer)
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)