Google Cloud Storage C++ Client  1.32.1
A C++ Client Library for Google Cloud Storage
version.h
Go to the documentation of this file.
1 // Copyright 2018 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 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_VERSION_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_VERSION_H
17 
18 #include "google/cloud/storage/version_info.h"
19 #include "google/cloud/internal/attributes.h"
20 #include "google/cloud/version.h"
21 #include <string>
22 
23 #define GOOGLE_CLOUD_CPP_STORAGE_IAM_DEPRECATED(alternative)
24  GOOGLE_CLOUD_CPP_DEPRECATED(
25  "this function predates IAM conditions and does not work with policies "
26  "that include IAM conditions. Please use " alternative
27  " instead. The function will be removed on 2022-04-01 or shortly "
28  "after. See GitHub issue #5929 for more information.")
29 
30 #if defined(_MSC_VER) && _MSC_VER < 1929
31 #define GOOGLE_CLOUD_CPP_STORAGE_RESTORE_UPLOAD_DEPRECATED() /**/
32 #else
33 #define GOOGLE_CLOUD_CPP_STORAGE_RESTORE_UPLOAD_DEPRECATED()
34  GOOGLE_CLOUD_CPP_DEPRECATED(
35  "this function is not used within the library. There was never a need"
36  " to mock this function, but it is preserved to avoid breaking existing"
37  " applications. The function may be removed after 2022-10-01, more"
38  " details on GitHub issue #7282.")
39 #endif // _MSC_VER
40 
41 #define STORAGE_CLIENT_NS GOOGLE_CLOUD_CPP_NS
42 
43 namespace google {
44 namespace cloud {
45 /**
46  * Contains all the Google Cloud Storage C++ client APIs.
47  */
48 namespace storage {
49 /**
50  * The Google Cloud Storage C++ client APIs inlined, versioned namespace.
51  *
52  * Applications may need to link multiple versions of the Google Cloud Storage
53  * C++ client, for example, if they link a library that uses an older version of
54  * the client than they do. This namespace is inlined, so applications can use
55  * `storage::Foo` in their source, but the symbols are versioned, i.e., the
56  * symbol becomes `storage::v1::Foo`.
57  *
58  * Note that, consistent with the semver.org guidelines, the v0 version makes
59  * no guarantees with respect to backwards compatibility.
60  */
61 inline namespace STORAGE_CLIENT_NS {
62 /**
63  * Returns the Google Cloud Storage C++ Client major version.
64  *
65  * @see https://semver.org/spec/v2.0.0.html for details.
66  */
67 int constexpr version_major() { return google::cloud::version_major(); }
68 
69 /**
70  * Returns the Google Cloud Storage C++ Client minor version.
71  *
72  * @see https://semver.org/spec/v2.0.0.html for details.
73  */
74 int constexpr version_minor() { return google::cloud::version_minor(); }
75 
76 /**
77  * Returns the Google Cloud Storage C++ Client patch version.
78  *
79  * @see https://semver.org/spec/v2.0.0.html for details.
80  */
81 int constexpr version_patch() { return google::cloud::version_patch(); }
82 
83 /// Returns a single integer representing the Major/Minor/Patch version.
84 int constexpr version() { return google::cloud::version(); }
85 
86 /// Returns the version as a string, in MAJOR.MINOR.PATCH+gitrev format.
87 std::string version_string();
88 
89 /// Returns the value for `x-goog-api-client` header.
90 std::string x_goog_api_client();
91 
92 } // namespace STORAGE_CLIENT_NS
93 } // namespace storage
94 } // namespace cloud
95 } // namespace google
96 
97 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_VERSION_H