Google Cloud Spanner C++ Client  1.34.0
A C++ Client Library for Google Cloud Spanner
version.h
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 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_VERSION_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_VERSION_H
17 
18 #include "google/cloud/spanner/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_SPANNER_ADMIN_API_DEPRECATED(name)
24  GOOGLE_CLOUD_CPP_DEPRECATED(
25  "google::cloud::spanner::" name
26  " is deprecated, and will be removed on or shortly after 2022-10-01."
27  " Please use google::cloud::spanner_admin::" name
28  " instead. See GitHub issue #7356 for more information.")
29 
30 // This preprocessor symbol is deprecated and should never be used anywhere. It
31 // exists solely for backward compatibility to avoid breaking anyone who may
32 // have been using it.
33 #define SPANNER_CLIENT_NS GOOGLE_CLOUD_CPP_NS
34 
35 namespace google {
36 /**
37  * The namespace Google Cloud Platform C++ client libraries.
38  */
39 namespace cloud {
40 /**
41  * Contains all the Cloud Spanner C++ client types and functions.
42  */
43 namespace spanner {
45 /**
46  * The Cloud spanner C++ Client major version.
47  */
48 int constexpr VersionMajor() { return google::cloud::version_major(); }
49 
50 /**
51  * The Cloud spanner C++ Client minor version.
52  */
53 int constexpr VersionMinor() { return google::cloud::version_minor(); }
54 
55 /**
56  * The Cloud spanner C++ Client patch version.
57  */
58 int constexpr VersionPatch() { return google::cloud::version_patch(); }
59 
60 /// A single integer representing the Major/Minor/Patch version.
61 int constexpr Version() { return google::cloud::version(); }
62 
63 /// The version as a string, in MAJOR.MINOR.PATCH+gitrev format.
64 std::string VersionString();
65 
67 // TODO(#7463) - remove backwards compatibility namespaces
68 namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
69 } // namespace spanner
70 } // namespace cloud
71 } // namespace google
72 
73 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_VERSION_H