Google Cloud Bigtable C++ Client  1.33.0
A C++ Client Library for Google Cloud Bigtable
expr.cc
Go to the documentation of this file.
1 // Copyright 2019 Google LLC
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 #include "google/cloud/bigtable/expr.h"
16 
17 namespace google {
18 namespace cloud {
19 namespace bigtable {
21 google::type::Expr Expression(std::string expression, std::string title,
22  std::string description, std::string location) {
23  google::type::Expr expr;
24  expr.set_expression(std::move(expression));
25  expr.set_title(std::move(title));
26  expr.set_description(std::move(description));
27  expr.set_location(std::move(location));
28  return expr;
29 }
30 
31 std::ostream& operator<<(std::ostream& stream, google::type::Expr const& e) {
32  stream << "(" << e.expression();
33  if (!e.title().empty()) {
34  stream << ", title=\"" << e.title() << "\"";
35  }
36  if (!e.description().empty()) {
37  stream << ", description=\"" << e.description() << "\"";
38  }
39  if (!e.location().empty()) {
40  stream << ", location=\"" << e.location() << "\"";
41  }
42  stream << ")";
43  return stream;
44 }
45 
47 } // namespace bigtable
48 } // namespace cloud
49 } // namespace google