aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/codegen
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-11-21 09:12:18 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-11-21 09:12:18 -0800
commit73ee7dc5590447bc726f7a1c3e51c2a217c8d5b6 (patch)
treed5ca4978921561ee4e86a04d476dcc3da275f144 /include/grpc++/impl/codegen
parentcca758933384feb49fb981ff224bddc5eeff6f22 (diff)
C++ compiles
Diffstat (limited to 'include/grpc++/impl/codegen')
-rw-r--r--include/grpc++/impl/codegen/slice.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/slice.h b/include/grpc++/impl/codegen/slice.h
index 7280698978..e79754f943 100644
--- a/include/grpc++/impl/codegen/slice.h
+++ b/include/grpc++/impl/codegen/slice.h
@@ -44,6 +44,11 @@ inline grpc::string_ref StringRefFromSlice(grpc_slice slice) {
GRPC_SLICE_LENGTH(slice));
}
+inline grpc::string StringFromCopiedSlice(grpc_slice slice) {
+ return grpc::string(reinterpret_cast<char*>(GRPC_SLICE_START_PTR(slice)),
+ GRPC_SLICE_LENGTH(slice));
+}
+
inline grpc_slice SliceReferencingString(const grpc::string& str) {
return g_core_codegen_interface->grpc_slice_from_static_buffer(str.data(),
str.length());