Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C++ Client Libraries for Google Cloud Services

License

NotificationsYou must be signed in to change notification settings

googleapis/google-cloud-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GCB CI statusGCB CI statusGHACodecov Coverage status

This repository contains idiomatic C++ client libraries for the followingGoogle Cloud Platform services.

Please check theCHANGELOG for important announcements and upcoming changes.

Quickstart

Each library (see below) contains a directory namedquickstart/ that'sintended to help you get up and running in a matter of minutes. Thisquickstart/ directory contains a minimal "Hello World" program demonstratinghow to use the library, along with minimal build files for common build systems,such as CMake and Bazel.

As an example, the following code snippet, taken fromGoogle Cloud Storage, should give you a senseof what it's like to use one of these C++ libraries.

#include"google/cloud/storage/client.h"#include"google/cloud/common_options.h"#include<cstdlib>#include<iostream>#include<string>intmain(int argc,char* argv[]) {if (argc !=2) {    std::cerr <<"Missing bucket name.\n";    std::cerr <<"Usage: quickstart <bucket-name>\n";return1;  }  std::stringconst bucket_name = argv[1];// Create a client to communicate with Google Cloud Storage. This client// uses the default configuration for authentication and project id.auto options = google::cloud::Options{};// If the CURL_CA_BUNDLE environment variable is set, configure the client// to use it. This is required for the Windows CI environment where standard// system roots may not be sufficient or accessible by the hermetic build.autoconst* ca_bundle =std::getenv("CURL_CA_BUNDLE");if (ca_bundle !=nullptr) {    options.set<google::cloud::CARootsFilePathOption>(ca_bundle);  }auto client =google::cloud::storage::Client(options);auto writer = client.WriteObject(bucket_name,"quickstart.txt");  writer <<"Hello World!";  writer.Close();if (!writer.metadata()) {    std::cerr <<"Error creating object:" << writer.metadata().status()              <<"\n";return1;  }  std::cout <<"Successfully created object:" << *writer.metadata() <<"\n";auto reader = client.ReadObject(bucket_name,"quickstart.txt");if (!reader) {    std::cerr <<"Error reading object:" << reader.status() <<"\n";return1;  }  std::string contents{std::istreambuf_iterator<char>{reader}, {}};  std::cout << contents <<"\n";return0;}

GA Libraries

See each library'sREADME.md file for more information about:

  • Where to find the documentation for the library and the service.
  • How to get started using the library.
  • How to incorporate the library into your build system.
  • The library's support status if not Generally Available (GA); unless noted ina library'sREADME.md, these libraries are all GA and supported by Google.
Expand to see the full list of GA libraries

Building and Installing

This is a quickstart guide for developers wanting to compile the libraries andrun the examples included with the libraries.

  • Packaging maintainers or developers who prefer to install the library in afixed directory (such as/usr/local or/opt) should consult thepackaging guide.
  • Developers who prefer using a package manager such asvcpkg, orConda, should follow theinstructions for their package manager.
  • Developers wanting to use the libraries as part of a larger CMake or Bazelproject should consult thequickstart guides for the library orlibraries they want to use.
  • Developers wanting to compile the library just to run some examples or testsshould read the current document.
  • Contributors and developers togoogle-cloud-cpp should consult the guide toset up a development workstation.

Building with Bazel

This library requires Bazel >= 6.0. From the top-level directory, run the usualcommands.

bazel build //...

Building with CMake

This library requires CMake >= 3.10. If you are planning to install thelibraries please consult thepackaging guide, theseinstructions willNOT produce artifacts that you can put in/usr/local, orshare with your colleagues.

From the top-level directory ofgoogle-cloud-cpp run these commands:

git -C$HOME clone https://github.com/microsoft/vcpkg.gitenv VCPKG_ROOT=$HOME/vcpkg$HOME/vcpkg/bootstrap-vcpkg.shcmake -S. -B cmake-out/ -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmakecmake --build cmake-out -- -j$(nproc)

The binary artifacts, such as examples, will be placed incmake-out/.

Support

  • This project follows Google'sFoundational C++ Support Policy, which is summarized in theFoundational C++ Support Matrix.
    • Language Version (>= C++14).
    • Operating Systems: Windows, macOS, and Linux.
    • Build Systems: Bazel (>= 6.0), CMake (>= 3.10).
    • Compilers: GCC (>= 7.5), Clang (>= 6.0), MSVC (>= 2022), Apple Clang (>=12).
  • This project uses dependencies described indoc/packaging.md.
  • This project works with or without exceptions enabled.
  • This project cutsmonthly releaseswith detailed release notes.

Public API and API Breaking Changes

This project follows Google'sOSS Library Breaking Change Policy.

In general, we avoid making backwards incompatible changes to ourpublic API. Sometimes such changes yield benefits to ourcustomers, in the form of better performance, easier-to-understand APIs, and/ormore consistent APIs across services. When these benefits warrant it, we will:

  • Announce these changes prominently in ourCHANGELOG.md file and in theaffected release's notes.
  • Increase the major version forgoogle-cloud-cpp.

Nevertheless, though we take commercially reasonable efforts to prevent this, itis possible that backwards incompatible changes go undetected and, therefore,undocumented. We apologize if this is the case and welcome feedback or bugreports to rectify the problem.

Contact us

Contributing changes

SeeCONTRIBUTING.md for details on how to contribute tothis project, including how to build and test your changes as well as how toproperly format your code.

Licensing

Apache 2.0; seeLICENSE for details.

Contributors128


[8]ページ先頭

©2009-2025 Movatter.jp