26#include <SimoxUtility/algorithm/string/string_tools.h>
34 const std::string& name,
35 const std::string& default_value,
36 const std::string& doc) :
37 type(type), name(name), default_value(default_value), doc(doc)
41 throw armarx::LocalException(
"Type of a CppField must not be empty!");
68 auto lines = simox::alg::split(doc,
"\n",
true,
false);
69 for (
const auto& line : lines)
71 writer->body.line(
"/// " + line);
76 (name !=
"" ?
" " + name + (default_value !=
"" ?
" = " + default_value :
"") :
""));
79 if (not simox::alg::ends_with(simox::alg::trim_copy(decl),
";"))
84 writer->body.line(decl);
void setDoc(const std::string &documentation)
void writeCpp(const CppWriterPtr &writer)
std::string getType() const
std::string getName() const
CppField(const std::string &type, const std::string &name, const std::string &default_value="", const std::string &doc="")
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< CppWriter > CppWriterPtr