~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/pagespeed/kernel/base/proto_util.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 Google Inc.
2
 
//
3
 
// Licensed under the Apache License, Version 2.0 (the "License");
4
 
// you may not use this file except in compliance with the License.
5
 
// You may obtain a copy of the License at
6
 
//
7
 
//      http://www.apache.org/licenses/LICENSE-2.0
8
 
//
9
 
// Unless required by applicable law or agreed to in writing, software
10
 
// distributed under the License is distributed on an "AS IS" BASIS,
11
 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
// See the License for the specific language governing permissions and
13
 
// limitations under the License.
14
 
 
15
 
// Author: jmarantz@google.com (Joshua Marantz)
16
 
 
17
 
#ifndef PAGESPEED_KERNEL_BASE_PROTO_UTIL_H_
18
 
#define PAGESPEED_KERNEL_BASE_PROTO_UTIL_H_
19
 
 
20
 
#include "pagespeed/kernel/base/basictypes.h"
21
 
#include "pagespeed/kernel/base/string_util.h"
22
 
 
23
 
 
24
 
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
25
 
#include "google/protobuf/message_lite.h"
26
 
#include "google/protobuf/repeated_field.h"
27
 
 
28
 
namespace net_instaweb {
29
 
 
30
 
// TODO(sligocki): Get rid of these special cases.
31
 
typedef google::protobuf::io::StringOutputStream StringOutputStream;
32
 
typedef google::protobuf::io::ArrayInputStream ArrayInputStream;
33
 
 
34
 
namespace protobuf {
35
 
 
36
 
// Pulls all google::protobuf namespace into net_instaweb::protobuf namespace.
37
 
using namespace google::protobuf;  // NOLINT
38
 
 
39
 
}  // namespace protobuf
40
 
 
41
 
inline bool ParseProtoFromStringPiece(
42
 
    StringPiece sp, protobuf::MessageLite* proto) {
43
 
  return proto->ParseFromString(sp.as_string());
44
 
}
45
 
 
46
 
}  // namespace net_instaweb
47
 
 
48
 
 
49
 
#endif  // PAGESPEED_KERNEL_BASE_PROTO_UTIL_H_