Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.8 KiB
56 lines
1.8 KiB
// Protocol Buffers - Google's data interchange format |
|
// Copyright 2023 Google LLC. All rights reserved. |
|
// |
|
// Use of this source code is governed by a BSD-style |
|
// license that can be found in the LICENSE file or at |
|
// https://developers.google.com/open-source/licenses/bsd |
|
|
|
#ifndef UPB_MESSAGE_COPY_H_ |
|
#define UPB_MESSAGE_COPY_H_ |
|
|
|
#include "upb/mem/arena.h" |
|
#include "upb/message/array.h" |
|
#include "upb/message/map.h" |
|
#include "upb/message/message.h" |
|
#include "upb/mini_table/message.h" |
|
|
|
// Must be last. |
|
#include "upb/port/def.inc" |
|
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
// Deep clones a message using the provided target arena. |
|
upb_Message* upb_Message_DeepClone(const upb_Message* msg, |
|
const upb_MiniTable* m, upb_Arena* arena); |
|
|
|
// Shallow clones a message using the provided target arena. |
|
upb_Message* upb_Message_ShallowClone(const upb_Message* msg, |
|
const upb_MiniTable* m, upb_Arena* arena); |
|
|
|
// Deep clones array contents. |
|
upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type, |
|
const upb_MiniTable* sub, upb_Arena* arena); |
|
|
|
// Deep clones map contents. |
|
upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type, |
|
upb_CType value_type, |
|
const upb_MiniTable* map_entry_table, |
|
upb_Arena* arena); |
|
|
|
// Deep copies the message from src to dst. |
|
bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src, |
|
const upb_MiniTable* m, upb_Arena* arena); |
|
|
|
// Shallow copies the message from src to dst. |
|
void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src, |
|
const upb_MiniTable* m); |
|
|
|
#ifdef __cplusplus |
|
} /* extern "C" */ |
|
#endif |
|
|
|
#include "upb/port/undef.inc" |
|
|
|
#endif // UPB_MESSAGE_COPY_H_
|
|
|