24 #ifndef GOBY_MIDDLEWARE_MARSHALLING_CSTR_H
25 #define GOBY_MIDDLEWARE_MARSHALLING_CSTR_H
40 std::vector<char> bytes(std::begin(
msg), std::end(
msg));
41 bytes.push_back(
'\0');
45 static std::string
type_name(
const std::string& d = std::string()) {
return "CSTR"; }
47 template <
typename CharIterator>
48 static std::shared_ptr<std::string>
parse(CharIterator bytes_begin, CharIterator bytes_end,
49 CharIterator& actual_end,
52 actual_end = bytes_end;
53 if (bytes_begin != bytes_end)
55 return std::make_shared<std::string>(bytes_begin, bytes_end - 1);
59 return std::make_shared<std::string>();
64 template <typename T, typename std::enable_if<std::is_same<T, std::string>::value>
::type* =
nullptr>