Skip to content
Snippets Groups Projects

F cpp to string

Merged Timm Fitschen requested to merge f-cpp-to-string into dev
All threads resolved!
Files
3
@@ -22,9 +22,11 @@
#ifndef CAOSDB_PROTOBUF_HELPER_H
#define CAOSDB_PROTOBUF_HELPER_H
#include "caosdb/status_code.h"
#include <google/protobuf/arena.h> // for Arena
#include <google/protobuf/extension_set.h> // for Arena
#include "caosdb/status_code.h" // for StatusCode, SUCCESS
#include <google/protobuf/arena.h> // for Arena
#include <google/protobuf/extension_set.h> // for Arena
#include <google/protobuf/util/json_util.h> // for JsonOptions, MessageToJs...
#include <string> // for string
#define CAOSDB_DEBUG_MESSAGE_STRING(message, out) \
std::string out; \
@@ -47,6 +49,14 @@ public:
return StatusCode::SUCCESS;
}
/**
* Return a json representation of this object.
*/
inline auto ToString() const noexcept -> const std::string {
CAOSDB_DEBUG_MESSAGE_STRING(*wrapped, out)
return out;
}
protected:
ProtoMessageWrapper() : ProtoMessageWrapper(Arena::CreateMessage<P>(get_arena())) {}
ProtoMessageWrapper(P *wrapped) : wrapped(wrapped) {}
Loading