Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
owner.h
1// Copyright 2022 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// https://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#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OWNER_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OWNER_H
17
18#include "google/cloud/storage/version.h"
19#include <string>
20#include <tuple>
21#include <utility>
22
23namespace google {
24namespace cloud {
25namespace storage {
26GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
27
28/// A simple wrapper for the `owner` field in object and bucket metadata.
29struct Owner {
30 std::string entity;
31 std::string entity_id;
32};
33
34inline bool operator==(Owner const& lhs, Owner const& rhs) {
35 return std::tie(lhs.entity, lhs.entity_id) ==
36 std::tie(rhs.entity, rhs.entity_id);
37}
38
39inline bool operator<(Owner const& lhs, Owner const& rhs) {
40 return std::tie(lhs.entity, lhs.entity_id) <
41 std::tie(rhs.entity, rhs.entity_id);
42}
43
44inline bool operator!=(Owner const& lhs, Owner const& rhs) {
45 return std::rel_ops::operator!=(lhs, rhs);
46}
47
48inline bool operator>(Owner const& lhs, Owner const& rhs) {
49 return std::rel_ops::operator>(lhs, rhs);
50}
51
52inline bool operator<=(Owner const& lhs, Owner const& rhs) {
53 return std::rel_ops::operator<=(lhs, rhs);
54}
55
56inline bool operator>=(Owner const& lhs, Owner const& rhs) {
57 return std::rel_ops::operator>=(lhs, rhs);
58}
59
60GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
61} // namespace storage
62} // namespace cloud
63} // namespace google
64
65#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OWNER_H
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
bool operator==(Owner const &lhs, Owner const &rhs)
Definition: owner.h:34
bool operator>=(Owner const &lhs, Owner const &rhs)
Definition: owner.h:56
bool operator!=(Owner const &lhs, Owner const &rhs)
Definition: owner.h:44
bool operator<=(Owner const &lhs, Owner const &rhs)
Definition: owner.h:52
bool operator<(Owner const &lhs, Owner const &rhs)
Definition: owner.h:39
bool operator>(Owner const &lhs, Owner const &rhs)
Definition: owner.h:48
A simple wrapper for the owner field in object and bucket metadata.
Definition: owner.h:29
std::string entity_id
Definition: owner.h:31
std::string entity
Definition: owner.h:30