~ubuntu-branches/debian/stretch/protobuf/stretch

« back to all changes in this revision

Viewing changes to src/google/protobuf/io/zero_copy_stream_impl_lite.h

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds
  • Date: 2014-09-11 22:50:10 UTC
  • mfrom: (10.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20140911225010-wt4yo9dpc1fzuq5g
Tags: 2.6.0-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include <iosfwd>
49
49
#include <google/protobuf/io/zero_copy_stream.h>
50
50
#include <google/protobuf/stubs/common.h>
 
51
#include <google/protobuf/stubs/stl_util.h>
51
52
 
52
53
 
53
54
namespace google {
333
334
 
334
335
// ===================================================================
335
336
 
 
337
// Return a pointer to mutable characters underlying the given string.  The
 
338
// return value is valid until the next time the string is resized.  We
 
339
// trust the caller to treat the return value as an array of length s->size().
 
340
inline char* mutable_string_data(string* s) {
 
341
#ifdef LANG_CXX11
 
342
  // This should be simpler & faster than string_as_array() because the latter
 
343
  // is guaranteed to return NULL when *s is empty, so it has to check for that.
 
344
  return &(*s)[0];
 
345
#else
 
346
  return string_as_array(s);
 
347
#endif
 
348
}
 
349
 
336
350
}  // namespace io
337
351
}  // namespace protobuf
338
352