mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
Besides unnecessary inconsistency on our C symbols, double underscores anywhere in the name are reserved for stdlib use. In practice its unlikely these symbols would ever hit a collision problem (maybe the prior name 'utf8_debug_string' with no prefix as having some risk), but safer to just standardize on this and have no concerns going forward. PiperOrigin-RevId: 648709299
23 lines
720 B
C++
23 lines
720 B
C++
#include "rust/cpp_kernel/debug.h"
|
|
|
|
#include <string>
|
|
|
|
#include "google/protobuf/message.h"
|
|
#include "google/protobuf/message_lite.h"
|
|
#include "rust/cpp_kernel/strings.h"
|
|
|
|
extern "C" {
|
|
|
|
google::protobuf::rust_internal::RustStringRawParts rust_proto_utf8_debug_string(
|
|
const google::protobuf::Message* msg) {
|
|
std::string text = google::protobuf::Utf8Format(*msg);
|
|
return google::protobuf::rust_internal::RustStringRawParts(text);
|
|
}
|
|
|
|
google::protobuf::rust_internal::RustStringRawParts rust_proto_utf8_debug_string_lite(
|
|
const google::protobuf::MessageLite* msg) {
|
|
std::string text = google::protobuf::Utf8Format(*msg);
|
|
return google::protobuf::rust_internal::RustStringRawParts(text);
|
|
}
|
|
|
|
} // extern "C"
|