Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
auto_finalize.h
1// Copyright 2021 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_AUTO_FINALIZE_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_AUTO_FINALIZE_H
17
18#include "google/cloud/storage/internal/complex_option.h"
19#include "google/cloud/storage/version.h"
20#include <iosfwd>
21
22namespace google {
23namespace cloud {
24namespace storage {
25GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
26
27enum class AutoFinalizeConfig {
30};
31
32/**
33 * Control whether upload streams auto-finalize on destruction.
34 *
35 * Some applications need to disable auto-finalization of resumable uploads.
36 * This option (or rather the `AutoFinalizeDisabled()` helper) configures
37 * whether ObjectWriteStream objects finalize an upload when the object is
38 * destructed.
39 */
40struct AutoFinalize
41 : public internal::ComplexOption<AutoFinalize, AutoFinalizeConfig> {
42 explicit AutoFinalize(AutoFinalizeConfig value) : ComplexOption(value) {}
43 AutoFinalize() : ComplexOption(AutoFinalizeConfig::kEnabled) {}
44
45 static char const* name() { return "auto-finalize"; }
46};
47
48/// Configure a stream to automatically finalize an upload on destruction.
51}
52
53/// Configure a stream to leave uploads pending (not finalized) on destruction.
56}
57
58std::ostream& operator<<(std::ostream& os, AutoFinalize const& rhs);
59
60GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
61} // namespace storage
62} // namespace cloud
63} // namespace google
64
65#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_AUTO_FINALIZE_H
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
AutoFinalize AutoFinalizeEnabled()
Configure a stream to automatically finalize an upload on destruction.
Definition: auto_finalize.h:49
AutoFinalizeConfig
Definition: auto_finalize.h:27
AutoFinalize AutoFinalizeDisabled()
Configure a stream to leave uploads pending (not finalized) on destruction.
Definition: auto_finalize.h:54
Control whether upload streams auto-finalize on destruction.
Definition: auto_finalize.h:41
static char const * name()
Definition: auto_finalize.h:45
AutoFinalize(AutoFinalizeConfig value)
Definition: auto_finalize.h:42
AutoFinalize()
Definition: auto_finalize.h:43