Google Cloud Storage C++ Client  1.42.0
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 // 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_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 #if defined(_MSC_VER) && _MSC_VER < 1929
24 #define GOOGLE_CLOUD_CPP_STORAGE_RESTORE_UPLOAD_DEPRECATED() /**/
25 #else
26 #define GOOGLE_CLOUD_CPP_STORAGE_RESTORE_UPLOAD_DEPRECATED()
27  GOOGLE_CLOUD_CPP_DEPRECATED(
28  "this function is not used within the library. There was never a need"
29  " to mock this function, but it is preserved to avoid breaking existing"
30  " applications. The function may be removed after 2022-10-01, more"
31  " details on GitHub issue #7282.")
32 #endif // _MSC_VER
33 
34 // This preprocessor symbol is deprecated and should never be used anywhere. It
35 // exists solely for backward compatibility to avoid breaking anyone who may
36 // have been using it.
37 #define STORAGE_CLIENT_NS GOOGLE_CLOUD_CPP_NS
38 
39 namespace google {
40 namespace cloud {
41 /**
42  * Contains all the Google Cloud Storage C++ client APIs.
43  */
44 namespace storage {
46 /**
47  * Returns the Google Cloud Storage C++ Client major version.
48  *
49  * @see https://semver.org/spec/v2.0.0.html for details.
50  */
51 int constexpr version_major() { return google::cloud::version_major(); }
52 
53 /**
54  * Returns the Google Cloud Storage C++ Client minor version.
55  *
56  * @see https://semver.org/spec/v2.0.0.html for details.
57  */
58 int constexpr version_minor() { return google::cloud::version_minor(); }
59 
60 /**
61  * Returns the Google Cloud Storage C++ Client patch version.
62  *
63  * @see https://semver.org/spec/v2.0.0.html for details.
64  */
65 int constexpr version_patch() { return google::cloud::version_patch(); }
66 
67 /// Returns a single integer representing the Major/Minor/Patch version.
68 int constexpr version() { return google::cloud::version(); }
69 
70 /// Returns the version as a string, in MAJOR.MINOR.PATCH+gitrev format.
71 std::string version_string();
72 
73 /// Returns the value for `x-goog-api-client` header.
74 std::string x_goog_api_client();
75 
77 // TODO(#7463) - remove backwards compatibility namespaces
78 namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
79 } // namespace storage
80 } // namespace cloud
81 } // namespace google
82 
83 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_VERSION_H