Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:17

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google LLC.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef UPB_MESSAGE_COPY_H_
0009 #define UPB_MESSAGE_COPY_H_
0010 
0011 #include "upb/mem/arena.h"
0012 #include "upb/message/array.h"
0013 #include "upb/message/map.h"
0014 #include "upb/message/message.h"
0015 #include "upb/mini_table/message.h"
0016 
0017 // Must be last.
0018 #include "upb/port/def.inc"
0019 
0020 #ifdef __cplusplus
0021 extern "C" {
0022 #endif
0023 
0024 // Deep clones a message using the provided target arena.
0025 upb_Message* upb_Message_DeepClone(const upb_Message* msg,
0026                                    const upb_MiniTable* m, upb_Arena* arena);
0027 
0028 // Shallow clones a message using the provided target arena.
0029 upb_Message* upb_Message_ShallowClone(const upb_Message* msg,
0030                                       const upb_MiniTable* m, upb_Arena* arena);
0031 
0032 // Deep clones array contents.
0033 upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
0034                                const upb_MiniTable* sub, upb_Arena* arena);
0035 
0036 // Deep clones map contents.
0037 upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type,
0038                            upb_CType value_type,
0039                            const upb_MiniTable* map_entry_table,
0040                            upb_Arena* arena);
0041 
0042 // Deep copies the message from src to dst.
0043 bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src,
0044                           const upb_MiniTable* m, upb_Arena* arena);
0045 
0046 // Shallow copies the message from src to dst.
0047 void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src,
0048                              const upb_MiniTable* m);
0049 
0050 #ifdef __cplusplus
0051 } /* extern "C" */
0052 #endif
0053 
0054 #include "upb/port/undef.inc"
0055 
0056 #endif  // UPB_MESSAGE_COPY_H_