Loading...
Searching...
No Matches
concatenate.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <bsoncxx/builder/concatenate-fwd.hpp> // IWYU pragma: export
#include <bsoncxx/array/view_or_value.hpp>
#include <bsoncxx/document/view_or_value.hpp>
#include <bsoncxx/config/prelude.hpp>
namespace bsoncxx {
namespace v_noabi {
namespace builder {
struct concatenate_doc {
document::view_or_value doc;
operator document::view() const {
return doc;
}
document::view view() const {
return doc;
}
};
struct concatenate_array {
array::view_or_value array;
operator array::view() const {
return array;
}
array::view view() const {
return array;
}
};
inline concatenate_doc concatenate(document::view_or_value doc) {
return {std::move(doc)};
}
inline concatenate_array concatenate(array::view_or_value array) {
return {std::move(array)};
}
} // namespace builder
} // namespace v_noabi
} // namespace bsoncxx
namespace bsoncxx {
namespace builder {
using v_noabi::builder::concatenate;
} // namespace builder
} // namespace bsoncxx
#include <bsoncxx/config/postlude.hpp>
view_or_value.hpp
Provides bsoncxx::v_noabi::array::view_or_value.
postlude.hpp
The bsoncxx v_noabi macro guard postlude header.
prelude.hpp
The bsoncxx v_noabi macro guard prelude header.
bsoncxx::v_noabi::builder::array
A JSON-like builder for creating arrays.
Definition list.hpp:174
bsoncxx::v_noabi::builder::list::view
operator types::bson_value::view()
Provides a view of the underlying BSON value.
Definition list.hpp:87
concatenate-fwd.hpp
Provides concatenators for use with "streaming" BSON builder syntax.
view_or_value.hpp
Provides bsoncxx::v_noabi::document::view_or_value.
bsoncxx::builder
Declares entities used to build BSON documents.
bsoncxx::v_noabi::array::view_or_value
v_noabi::view_or_value< view, value > view_or_value
Equivalent to v_noabi::view_or_value<v_noabi::array::view, v_noabi::array::value>.
Definition view_or_value.hpp:31
bsoncxx::v_noabi::builder::concatenate
concatenate_doc concatenate(document::view_or_value doc)
Helper method to concatenate a document.
Definition concatenate.hpp:101
bsoncxx::v_noabi::document::view_or_value
v_noabi::view_or_value< v_noabi::document::view, v_noabi::document::value > view_or_value
Equivalent to v_noabi::view_or_value<v_noabi::document::view, v_noabi::document::value>.
Definition view_or_value.hpp:30
bsoncxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
bsoncxx::v_noabi::builder::concatenate_array
Container to concatenate an array.
Definition concatenate.hpp:64
bsoncxx::v_noabi::builder::concatenate_array::view
array::view view() const
Accessor that provides a view of the wrapped concatenate array.
Definition concatenate.hpp:83
bsoncxx::v_noabi::builder::concatenate_doc
Container to concatenate a document.
Definition concatenate.hpp:34
bsoncxx::v_noabi::builder::concatenate_doc::view
document::view view() const
Accessor that provides a view of the wrapped concatenate document.
Definition concatenate.hpp:53