Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
third_party
upb
upb
util
required_fields.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009-2021, Google LLC
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions are met:
7
* * Redistributions of source code must retain the above copyright
8
* notice, this list of conditions and the following disclaimer.
9
* * Redistributions in binary form must reproduce the above copyright
10
* notice, this list of conditions and the following disclaimer in the
11
* documentation and/or other materials provided with the distribution.
12
* * Neither the name of Google LLC nor the
13
* names of its contributors may be used to endorse or promote products
14
* derived from this software without specific prior written permission.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
* ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
20
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#ifndef UPB_UTIL_REQUIRED_FIELDS_H_
29
#define UPB_UTIL_REQUIRED_FIELDS_H_
30
31
#include "
upb/def.h
"
32
#include "
upb/reflection.h
"
33
34
/* Must be last. */
35
#include "upb/port_def.inc"
36
37
#ifdef __cplusplus
38
extern
"C"
{
39
#endif
40
41
// A FieldPath can be encoded as an array of upb_FieldPathEntry, in the
42
// following format:
43
// { {.field = f1}, {.field = f2} } # f1.f2
44
// { {.field = f1}, {.index = 5}, {.field = f2} } # f1[5].f2
45
// { {.field = f1}, {.key = "abc"}, {.field = f2} } # f1["abc"].f2
46
//
47
// Users must look at the type of `field` to know if an index or map key
48
// follows.
49
//
50
// A field path may be NULL-terminated, in which case a NULL field indicates
51
// the end of the field path.
52
typedef
union
{
53
const
upb_FieldDef
*
field
;
54
size_t
array_index
;
55
upb_MessageValue
map_key
;
56
}
upb_FieldPathEntry
;
57
58
// Writes a string representing `*path` to `buf` in the following textual
59
// format:
60
// foo.bar # Regular fields
61
// repeated_baz[2].bar # Repeated field
62
// int32_msg_map[5].bar # Integer-keyed map
63
// string_msg_map["abc"] # String-keyed map
64
// bool_msg_map[true] # Bool-keyed map
65
//
66
// The input array `*path` must be NULL-terminated. The pointer `*path` will be
67
// updated to point to one past the terminating NULL pointer of the input array.
68
//
69
// The output buffer `buf` will always be NULL-terminated. If the output data
70
// (including NULL terminator) exceeds `size`, the result will be truncated.
71
// Returns the string length of the data we attempted to write, excluding the
72
// terminating NULL.
73
size_t
upb_FieldPath_ToText
(
upb_FieldPathEntry
**
path
,
char
*
buf
,
size_t
size
);
74
75
// Checks whether `msg` or any of its children has unset required fields,
76
// returning `true` if any are found. `msg` may be NULL, in which case the
77
// message will be treated as empty.
78
//
79
// When this function returns true, `fields` is updated (if non-NULL) to point
80
// to a heap-allocated array encoding the field paths of the required fields
81
// that are missing. Each path is terminated with {.field = NULL}, and a final
82
// {.field = NULL} terminates the list of paths. The caller is responsible for
83
// freeing this array.
84
bool
upb_util_HasUnsetRequired
(
const
upb_Message
*
msg
,
const
upb_MessageDef
*
m
,
85
const
upb_DefPool
* ext_pool,
86
upb_FieldPathEntry
**
fields
);
87
88
#ifdef __cplusplus
89
}
/* extern "C" */
90
#endif
91
92
#include "upb/port_undef.inc"
93
94
#endif
/* UPB_UTIL_REQUIRED_FIELDS_H_ */
upb_FieldPathEntry
Definition:
required_fields.h:52
upb_MessageDef
Definition:
upb/upb/def.c:100
buf
voidpf void * buf
Definition:
bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
check_documentation.path
path
Definition:
check_documentation.py:57
upb_MessageValue
Definition:
upb/upb/reflection.h:40
upb_FieldPathEntry::map_key
upb_MessageValue map_key
Definition:
required_fields.h:55
reflection.h
upb_Message
void upb_Message
Definition:
msg.h:49
msg
std::string msg
Definition:
client_interceptors_end2end_test.cc:372
upb_FieldDef
Definition:
upb/upb/def.c:56
def.h
profile_analyzer.fields
list fields
Definition:
profile_analyzer.py:266
upb_FieldPathEntry::array_index
size_t array_index
Definition:
required_fields.h:54
upb_FieldPathEntry::field
const upb_FieldDef * field
Definition:
required_fields.h:53
size
voidpf void uLong size
Definition:
bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
regress.m
m
Definition:
regress/regress.py:25
upb_util_HasUnsetRequired
bool upb_util_HasUnsetRequired(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, upb_FieldPathEntry **fields)
Definition:
required_fields.c:293
upb_DefPool
Definition:
upb/upb/def.c:217
upb_FieldPath_ToText
size_t upb_FieldPath_ToText(upb_FieldPathEntry **path, char *buf, size_t size)
Definition:
required_fields.c:119
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:10