Code Monkey home page Code Monkey logo

google-cloud-cpp's Introduction

Google Cloud Platform C++ Client Libraries

Kokoro CI status Kokoro CI status Kokoro CI status Codecov Coverage status
Kokoro CI status Kokoro CI status Kokoro CI status

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

See each library's README.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 in a library's README.md, these libraries are all GA and supported by Google.

NOTE: This repo and these libraries do not follow Semantic Versioning.

Supported Platforms

  • Windows, macOS, Linux
  • C++11 (and higher) compilers (we test with GCC >= 5.4, Clang >= 3.8, and MSVC >= 2019)
  • Environments with or without exceptions
  • Bazel and CMake builds

Quickstart

Each library (linked above) contains a directory named quickstart/ that's intended to help you get up and running in a matter of minutes. This quickstart/ directory contains a minimal "Hello World" program demonstrating how 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 from Google Cloud Storage, should give you a taste of what it's like to use one of these C++ libraries.

#include "google/cloud/storage/client.h"
#include <iostream>

int main(int argc, char* argv[]) {
  if (argc != 2) {
    std::cerr << "Missing bucket name.\n";
    std::cerr << "Usage: quickstart <bucket-name>\n";
    return 1;
  }
  std::string const bucket_name = argv[1];

  // Create aliases to make the code easier to read.
  namespace gcs = google::cloud::storage;

  // Create a client to communicate with Google Cloud Storage. This client
  // uses the default configuration for authentication and project id.
  google::cloud::StatusOr<gcs::Client> client =
      gcs::Client::CreateDefaultClient();
  if (!client) {
    std::cerr << "Failed to create Storage Client, status=" << client.status()
              << "\n";
    return 1;
  }

  auto writer = client->WriteObject(bucket_name, "quickstart.txt");
  writer << "Hello World!";
  writer.Close();
  if (writer.metadata()) {
    std::cout << "Successfully created object: " << *writer.metadata() << "\n";
  } else {
    std::cerr << "Error creating object: " << writer.metadata().status()
              << "\n";
    return 1;
  }

  auto reader = client->ReadObject(bucket_name, "quickstart.txt");
  std::string contents{std::istreambuf_iterator<char>{reader}, {}};
  std::cout << contents << "\n";

  return 0;
}

Contact us

If you have questions or comments, or want to file bugs or request feature, please do so using GitHub's normal Issues mechanism: Contact Us

Contributing changes

See CONTRIBUTING.md for details on how to contribute to this project, including how to build and test your changes as well as how to properly format your code.

Licensing

Apache 2.0; see LICENSE for details.

google-cloud-cpp's People

Contributors

aryann avatar billyjacobson avatar bzztbomb avatar cclauss avatar chemelnucfin avatar clementperon avatar coryan avatar danielmahu avatar ddovod avatar devbww avatar devjgm avatar dopiera avatar edvardd avatar frankyn avatar hemant-qlogic avatar houglum avatar jseph avatar manish-qlogic avatar mbrukman avatar mr-salty avatar nettyh avatar paprat avatar peteypii avatar roopak-qlogic avatar rsimion avatar saeta avatar scotthart avatar snnn avatar timford avatar vnghia avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.