Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
external_server_spec.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
17 #ifndef PAGESPEED_SYSTEM_EXTERNAL_SERVER_SPEC_H_
18 #define PAGESPEED_SYSTEM_EXTERNAL_SERVER_SPEC_H_
19 
20 #include <vector>
21 
24 
25 namespace net_instaweb {
26 
28  ExternalServerSpec() : host(), port(0) {}
29  ExternalServerSpec(GoogleString host_, int port_)
30  : host(host_), port(port_) {}
31  bool SetFromString(StringPiece value_string, int default_port,
32  GoogleString* error_detail);
33 
34  bool empty() const { return host.empty() && port == 0; }
37  return empty() ? "" : StrCat(host, ":", IntegerToString(port));
38  }
39 
40  GoogleString host;
41  int port;
42 };
43 
45  bool SetFromString(StringPiece value_string, int default_port,
46  GoogleString* error_detail);
47 
48  bool empty() const { return servers.empty(); }
49  GoogleString ToString() const;
50 
51  std::vector<ExternalServerSpec> servers;
52 };
53 
54 }
55 
56 #endif
Definition: external_server_spec.h:27
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: external_server_spec.h:44
GoogleString ToString() const
Definition: external_server_spec.h:35