Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
proto_util.h
Go to the documentation of this file.
1 // Copyright 2011 Google Inc.
14 
16 
17 #ifndef PAGESPEED_KERNEL_BASE_PROTO_UTIL_H_
18 #define PAGESPEED_KERNEL_BASE_PROTO_UTIL_H_
19 
23 
24 
25 #include "google/protobuf/io/zero_copy_stream_impl_lite.h"
26 #include "google/protobuf/message.h"
27 #include "google/protobuf/message_lite.h"
28 #include "google/protobuf/repeated_field.h"
29 #include "google/protobuf/text_format.h"
30 
31 namespace net_instaweb {
32 
35 typedef google::protobuf::io::ArrayInputStream ArrayInputStream;
36 
37 namespace protobuf {
38 
40 using namespace google::protobuf;
41 
42 }
43 
45  StringPiece sp, protobuf::MessageLite* proto) {
46  return proto->ParseFromArray(sp.data(), sp.size());
47 }
48 
49 inline bool ParseTextFormatProtoFromString(const GoogleString& s,
50  protobuf::Message* proto) {
51  return google::protobuf::TextFormat::ParseFromString(s, proto);
52 }
53 
54 }
55 
56 
57 #endif
bool ParseProtoFromStringPiece(StringPiece sp, protobuf::MessageLite *proto)
namespace protobuf
Definition: proto_util.h:44
google::protobuf::io::StringOutputStream StringOutputStream
Definition: proto_util.h:34
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24