Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
559fd84a
Commit
559fd84a
authored
Apr 28, 2014
by
Jason Choy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'name' annotation for the C++ annotation to override the basename used for field accessors
parent
30c7de63
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
11 deletions
+43
-11
c++.capnp
c++/src/capnp/c++.capnp
+1
-0
c++.capnp.c++
c++/src/capnp/c++.capnp.c++
+32
-10
c++.capnp.h
c++/src/capnp/c++.capnp.h
+1
-0
capnpc-c++.c++
c++/src/capnp/compiler/capnpc-c++.c++
+9
-1
No files found.
c++/src/capnp/c++.capnp
View file @
559fd84a
...
...
@@ -25,3 +25,4 @@
$namespace("capnp::annotations");
annotation namespace(file): Text;
annotation name(field): Text;
c++/src/capnp/c++.capnp.c++
View file @
559fd84a
...
...
@@ -5,29 +5,51 @@
namespace
capnp
{
namespace
schemas
{
static
const
::
capnp
::
_
::
AlignedData
<
1
9
>
b_b9c6f99ebf805f2c
=
{
static
const
::
capnp
::
_
::
AlignedData
<
1
8
>
b_b9c6f99ebf805f2c
=
{
{
0
,
0
,
0
,
0
,
5
,
0
,
5
,
0
,
44
,
95
,
128
,
191
,
158
,
249
,
198
,
185
,
1
6
,
0
,
0
,
0
,
5
,
0
,
1
,
0
,
1
0
,
0
,
0
,
0
,
5
,
0
,
1
,
0
,
129
,
78
,
48
,
184
,
123
,
125
,
248
,
189
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
17
,
0
,
0
,
0
,
210
,
0
,
0
,
0
,
2
9
,
0
,
0
,
0
,
7
,
0
,
0
,
0
,
17
,
0
,
0
,
0
,
162
,
0
,
0
,
0
,
2
5
,
0
,
0
,
0
,
7
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
4
,
0
,
0
,
0
,
2
,
0
,
1
,
0
,
2
0
,
0
,
0
,
0
,
2
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
99
,
97
,
112
,
110
,
112
,
47
,
99
,
43
,
43
,
46
,
99
,
97
,
112
,
110
,
112
,
58
,
110
,
97
,
109
,
101
,
115
,
112
,
97
,
99
,
101
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
99
,
43
,
43
,
46
,
99
,
97
,
112
,
110
,
112
,
58
,
110
,
97
,
109
,
101
,
115
,
112
,
97
,
99
,
101
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
12
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
}
};
const
::
capnp
::
_
::
RawSchema
s_b9c6f99ebf805f2c
=
{
0xb9c6f99ebf805f2c
,
b_b9c6f99ebf805f2c
.
words
,
19
,
nullptr
,
nullptr
,
0xb9c6f99ebf805f2c
,
b_b9c6f99ebf805f2c
.
words
,
18
,
nullptr
,
nullptr
,
0
,
0
,
nullptr
,
nullptr
,
nullptr
};
static
const
::
capnp
::
_
::
AlignedData
<
17
>
b_f264a779fef191ce
=
{
{
0
,
0
,
0
,
0
,
5
,
0
,
5
,
0
,
206
,
145
,
241
,
254
,
121
,
167
,
100
,
242
,
10
,
0
,
0
,
0
,
5
,
0
,
32
,
0
,
129
,
78
,
48
,
184
,
123
,
125
,
248
,
189
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
17
,
0
,
0
,
0
,
122
,
0
,
0
,
0
,
21
,
0
,
0
,
0
,
7
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
16
,
0
,
0
,
0
,
2
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
99
,
43
,
43
,
46
,
99
,
97
,
112
,
110
,
112
,
58
,
110
,
97
,
109
,
101
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
12
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
}
};
const
::
capnp
::
_
::
RawSchema
s_f264a779fef191ce
=
{
0xf264a779fef191ce
,
b_f264a779fef191ce
.
words
,
17
,
nullptr
,
nullptr
,
0
,
0
,
nullptr
,
nullptr
,
nullptr
};
}
// namespace schemas
...
...
c++/src/capnp/c++.capnp.h
View file @
559fd84a
...
...
@@ -23,6 +23,7 @@ namespace capnp {
namespace
schemas
{
extern
const
::
capnp
::
_
::
RawSchema
s_b9c6f99ebf805f2c
;
extern
const
::
capnp
::
_
::
RawSchema
s_f264a779fef191ce
;
}
// namespace schemas
namespace
_
{
// private
...
...
c++/src/capnp/compiler/capnpc-c++.c++
View file @
559fd84a
...
...
@@ -54,6 +54,7 @@ namespace capnp {
namespace
{
static
constexpr
uint64_t
NAMESPACE_ANNOTATION_ID
=
0xb9c6f99ebf805f2cull
;
static
constexpr
uint64_t
NAME_ANNOTATION_ID
=
0xf264a779fef191ceull
;
static
constexpr
const
char
*
FIELD_SIZE_NAMES
[]
=
{
"VOID"
,
"BIT"
,
"BYTE"
,
"TWO_BYTES"
,
"FOUR_BYTES"
,
"EIGHT_BYTES"
,
"POINTER"
,
"INLINE_COMPOSITE"
...
...
@@ -571,7 +572,14 @@ private:
FieldText
makeFieldText
(
kj
::
StringPtr
scope
,
StructSchema
::
Field
field
)
{
auto
proto
=
field
.
getProto
();
kj
::
String
titleCase
=
toTitleCase
(
proto
.
getName
());
auto
baseName
=
proto
.
getName
();
for
(
auto
annotation
:
proto
.
getAnnotations
())
{
if
(
annotation
.
getId
()
==
NAME_ANNOTATION_ID
)
{
baseName
=
annotation
.
getValue
().
getText
();
break
;
}
}
kj
::
String
titleCase
=
toTitleCase
(
baseName
);
DiscriminantChecks
unionDiscrim
;
if
(
hasDiscriminantValue
(
proto
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment