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
8bbe6b25
Commit
8bbe6b25
authored
Jun 13, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update blob docs.
parent
a2fa6413
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
cxx.md
doc/cxx.md
+3
-14
No files found.
doc/cxx.md
View file @
8bbe6b25
...
...
@@ -308,20 +308,9 @@ to have any value that is within the range of their base type, which for Cap'n P
Blobs are manipulated using the classes
`capnp::Text`
and
`capnp::Data`
. These classes are,
again, just containers for inner classes
`Reader`
and
`Builder`
. These classes are iterable and
implement
`data()`
,
`size()`
, and
`operator[]`
methods, similar to
`std::string`
.
`Builder::operator[]`
even returns a reference (unlike with
`List<T>`
).
`Text::Reader`
additionally has a method
`c_str()`
which returns a NUL-terminated
`const char*`
.
These classes strive to be easy to convert to other common representations of raw data.
Blob readers and builders can be implicitly converted to any class which takes
`(const char*, size_t)`
as its constructor parameters, and from any class which has
`const char* data()`
and
`size_t size()`
methods (in particular,
`std::string`
). Text
readers and builders can additionally be implicitly converted to and from NUL-terminated
`const char*`
s.
Because of this, callers often don't need to know anything about the blob classes. If you use
`std::string`
to represent blobs in your own code, or NUL-terminated character arrays for text,
just pretend that's what Cap'n Proto uses too.
implement
`size()`
and
`operator[]`
methods.
`Builder::operator[]`
even returns a reference
(unlike with
`List<T>`
).
`Text::Reader`
additionally has a method
`cStr()`
which returns a
NUL-terminated
`const char*`
.
## Interfaces
...
...
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