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>();
64template <typename T, typename std::enable_if<std::is_same<T, std::string>::value>::type* =
nullptr>
constexpr int scheme()
Placeholder to provide an interface for the scheme() function family.
The global namespace for the Goby project.
extern ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::PROTOBUF_NAMESPACE_ID::MessageOptions, ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::goby::GobyMessageOptions >, 11, false > msg
static std::string type_name(const std::string &d=std::string())
static std::shared_ptr< std::string > parse(CharIterator bytes_begin, CharIterator bytes_end, CharIterator &actual_end, const std::string &type=type_name())
static std::vector< char > serialize(const std::string &msg)
Class for parsing and serializing a given marshalling scheme. Must be specialized for a particular sc...
static std::string type_name()
The marshalling scheme specific string name for this type.