diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b99162f3..b59aba5047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,11 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu ## 4.0.0 [Unreleased] - +## Removed + +- Redeclarations of `bsoncxx::stdx` interfaces in the `mongocxx::stdx` namespace. + - Use `bsoncxx::stdx::optional` instead of `mongocxx::stdx::optional`. + - Use `bsoncxx::stdx::string_view` instead of `mongocxx::stdx::string_view`. ## 3.11.0 diff --git a/examples/mongocxx/tutorial.cpp b/examples/mongocxx/tutorial.cpp index 86964cec71..d68eeac264 100644 --- a/examples/mongocxx/tutorial.cpp +++ b/examples/mongocxx/tutorial.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/examples/mongocxx/view_or_value_variant.cpp b/examples/mongocxx/view_or_value_variant.cpp index 342cc47e73..800574eb9b 100644 --- a/examples/mongocxx/view_or_value_variant.cpp +++ b/examples/mongocxx/view_or_value_variant.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/src/mongocxx/include/mongocxx/doc.hpp b/src/mongocxx/include/mongocxx/doc.hpp index 669ad0f0d1..50afa4cf27 100644 --- a/src/mongocxx/include/mongocxx/doc.hpp +++ b/src/mongocxx/include/mongocxx/doc.hpp @@ -74,17 +74,6 @@ /// Declares entities representing the result of GridFS commands. /// -/// -/// @namespace mongocxx::stdx -/// Redeclares @ref bsoncxx C++17 standard library polyfills in the @ref mongocxx library namespace -/// for internal use. -/// -/// @deprecated Use @ref bsoncxx::stdx instead. -/// -/// @warning These redeclarations are for internal use only! Users should reference entities -/// declared in @ref bsoncxx directly, not through @ref mongocxx. -/// - /// /// @page topic-mongocxx The mongocxx Library /// @brief Topics relating to the mongocxx library. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp index 18ae4716c1..5f8e8ae5b7 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp @@ -100,7 +100,7 @@ class bulk_write { /// @see /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) execute() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) execute() const; private: friend ::mongocxx::v_noabi::collection; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp index ef67f76cfd..d2dc2b6b26 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption.hpp index 9dd1492d04..3b2028ce68 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption.hpp @@ -30,7 +30,6 @@ #include #include #include -#include #include @@ -112,7 +111,8 @@ class client_encryption { const bsoncxx::v_noabi::document::view& options, bsoncxx::v_noabi::document::value& out_options, const std::string& kms_provider, - const stdx::optional& masterkey = stdx::nullopt); + const bsoncxx::v_noabi::stdx::optional& masterkey = + bsoncxx::v_noabi::stdx::nullopt); /// /// Encrypts a BSON value with a given key and algorithm. @@ -217,7 +217,7 @@ class client_encryption { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/KeyVault.getKey/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) get_key(bsoncxx::v_noabi::types::bson_value::view_or_value id); /// @@ -247,7 +247,7 @@ class client_encryption { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/KeyVault.addKeyAlternateName/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) add_key_alt_name(bsoncxx::v_noabi::types::bson_value::view_or_value id, bsoncxx::v_noabi::string::view_or_value key_alt_name); @@ -266,7 +266,7 @@ class client_encryption { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/KeyVault.removeKeyAlternateName/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) remove_key_alt_name(bsoncxx::v_noabi::types::bson_value::view_or_value id, bsoncxx::v_noabi::string::view_or_value key_alt_name); @@ -282,7 +282,7 @@ class client_encryption { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/KeyVault.getKeyByAltName/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) get_key_by_alt_name(bsoncxx::v_noabi::string::view_or_value key_alt_name); private: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp index 6dd7130dc1..e97e4cece2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp @@ -153,7 +153,8 @@ class client_session { /// a transaction already in progress. /// MONGOCXX_ABI_EXPORT_CDECL(void) - start_transaction(const stdx::optional& transaction_opts = {}); + start_transaction( + const bsoncxx::v_noabi::stdx::optional& transaction_opts = {}); /// /// Commits a transaction on the current client session. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp index bcaffbe020..c3f4698503 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp @@ -238,7 +238,7 @@ class collection { /// - @ref mongocxx::v_noabi::bulk_write /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) write(const model::write& write, const options::bulk_write& options = options::bulk_write()) { return create_bulk_write(options).append(write).execute(); } @@ -266,7 +266,7 @@ class collection { /// - @ref mongocxx::v_noabi::bulk_write /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) write(const client_session& session, const model::write& write, const options::bulk_write& options = options::bulk_write()) { @@ -296,7 +296,7 @@ class collection { /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template - stdx::optional bulk_write( + bsoncxx::v_noabi::stdx::optional bulk_write( const container_type& writes, const options::bulk_write& options = options::bulk_write()) { return bulk_write(writes.begin(), writes.end(), options); } @@ -326,7 +326,7 @@ class collection { /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template - stdx::optional bulk_write( + bsoncxx::v_noabi::stdx::optional bulk_write( const client_session& session, const container_type& writes, const options::bulk_write& options = options::bulk_write()) { @@ -357,7 +357,7 @@ class collection { /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template - stdx::optional bulk_write( + bsoncxx::v_noabi::stdx::optional bulk_write( write_model_iterator_type begin, write_model_iterator_type end, const options::bulk_write& options = options::bulk_write()) { @@ -392,7 +392,7 @@ class collection { /// - https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template - stdx::optional bulk_write( + bsoncxx::v_noabi::stdx::optional bulk_write( const client_session& session, write_model_iterator_type begin, write_model_iterator_type end, @@ -544,7 +544,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/delete/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) delete_many(bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); @@ -567,7 +567,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/delete/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) delete_many(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); @@ -589,7 +589,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/delete/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) delete_one(bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); @@ -612,7 +612,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/delete/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) delete_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); @@ -776,7 +776,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/core/read-operations-introduction/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one(bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); @@ -797,7 +797,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/core/read-operations-introduction/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); @@ -819,7 +819,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_delete( bsoncxx::v_noabi::document::view_or_value filter, const options::find_one_and_delete& options = options::find_one_and_delete()); @@ -843,7 +843,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_delete( const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, @@ -869,7 +869,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_replace( bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, @@ -897,7 +897,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_replace( const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, @@ -924,7 +924,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_update( bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, @@ -950,7 +950,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_update( bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, @@ -976,7 +976,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_update( bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, @@ -1004,7 +1004,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_update( const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, @@ -1033,7 +1033,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_update( const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, @@ -1062,7 +1062,7 @@ class collection { /// @exception /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) find_one_and_update( const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, @@ -1084,7 +1084,7 @@ class collection { /// /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) insert_one(bsoncxx::v_noabi::document::view_or_value document, const options::insert& options = {}); @@ -1106,7 +1106,7 @@ class collection { /// /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) insert_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value document, const options::insert& options = {}); @@ -1135,7 +1135,7 @@ class collection { /// @throws mongocxx::v_noabi::bulk_write_exception when the operation fails. /// template - stdx::optional insert_many( + bsoncxx::v_noabi::stdx::optional insert_many( const container_type& container, const options::insert& options = options::insert()) { return insert_many(container.begin(), container.end(), options); } @@ -1162,7 +1162,7 @@ class collection { /// @throws mongocxx::v_noabi::bulk_write_exception when the operation fails. /// template - stdx::optional insert_many( + bsoncxx::v_noabi::stdx::optional insert_many( const client_session& session, const container_type& container, const options::insert& options = options::insert()) { @@ -1193,7 +1193,7 @@ class collection { /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. /// template - stdx::optional insert_many( + bsoncxx::v_noabi::stdx::optional insert_many( document_view_iterator_type begin, document_view_iterator_type end, const options::insert& options = options::insert()) { @@ -1222,7 +1222,7 @@ class collection { /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. /// template - stdx::optional insert_many( + bsoncxx::v_noabi::stdx::optional insert_many( const client_session& session, document_view_iterator_type begin, document_view_iterator_type end, @@ -1264,7 +1264,7 @@ class collection { /// @return The name of the collection. The return value of this method is invalidated by any /// subsequent call to collection::rename() on this collection object. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::string_view) name() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::string_view) name() const; /// /// Rename this collection. @@ -1382,7 +1382,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) replace_one(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, const options::replace& options = options::replace{}); @@ -1410,7 +1410,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) replace_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, @@ -1437,7 +1437,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_many(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, const options::update& options = options::update()); @@ -1463,7 +1463,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_many(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::update& options = options::update()); @@ -1489,7 +1489,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_many(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, const options::update& options = options::update()); @@ -1517,7 +1517,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_many(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, @@ -1546,7 +1546,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_many(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, @@ -1575,7 +1575,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_many(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, @@ -1602,7 +1602,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_one(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, const options::update& options = options::update()); @@ -1628,7 +1628,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_one(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::update& options = options::update()); @@ -1654,7 +1654,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_one(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, const options::update& options = options::update()); @@ -1682,7 +1682,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, @@ -1711,7 +1711,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, @@ -1740,7 +1740,7 @@ class collection { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) update_one(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, @@ -1871,12 +1871,12 @@ class collection { bsoncxx::v_noabi::document::view_or_value index_options, options::index_view operation_options); - stdx::optional _delete_many( + bsoncxx::v_noabi::stdx::optional _delete_many( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options); - stdx::optional _delete_one( + bsoncxx::v_noabi::stdx::optional _delete_one( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options); @@ -1895,29 +1895,29 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::find& options); - stdx::optional _find_one( + bsoncxx::v_noabi::stdx::optional _find_one( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, const options::find& options); - stdx::optional _find_one_and_delete( + bsoncxx::v_noabi::stdx::optional _find_one_and_delete( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, const options::find_one_and_delete& options); - stdx::optional _find_one_and_replace( + bsoncxx::v_noabi::stdx::optional _find_one_and_replace( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, const options::find_one_and_replace& options); - stdx::optional _find_one_and_update( + bsoncxx::v_noabi::stdx::optional _find_one_and_update( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, const options::find_one_and_update& options); - stdx::optional _insert_one( + bsoncxx::v_noabi::stdx::optional _insert_one( const client_session* session, bsoncxx::v_noabi::document::view_or_value document, const options::insert& options); @@ -1928,25 +1928,28 @@ class collection { bool drop_target_before_rename, const bsoncxx::v_noabi::stdx::optional& write_concern); - stdx::optional _replace_one(const client_session* session, - const options::bulk_write& bulk_opts, - const model::replace_one& replace_op); + bsoncxx::v_noabi::stdx::optional _replace_one( + const client_session* session, + const options::bulk_write& bulk_opts, + const model::replace_one& replace_op); - stdx::optional _replace_one( + bsoncxx::v_noabi::stdx::optional _replace_one( const client_session* session, bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, const options::replace& options); - stdx::optional _update_one(const client_session* session, - bsoncxx::v_noabi::document::view_or_value filter, - bsoncxx::v_noabi::document::view_or_value update, - const options::update& options); + bsoncxx::v_noabi::stdx::optional _update_one( + const client_session* session, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, + const options::update& options); - stdx::optional _update_many(const client_session* session, - bsoncxx::v_noabi::document::view_or_value filter, - bsoncxx::v_noabi::document::view_or_value update, - const options::update& options); + bsoncxx::v_noabi::stdx::optional _update_many( + const client_session* session, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, + const options::update& options); change_stream _watch(const client_session* session, const pipeline& pipe, @@ -1961,15 +1964,16 @@ class collection { bsoncxx::v_noabi::builder::basic::array& inserted_ids, bsoncxx::v_noabi::document::view doc) const; - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) _exec_insert_many(mongocxx::v_noabi::bulk_write& writes, bsoncxx::v_noabi::builder::basic::array& inserted_ids); template - stdx::optional _insert_many(const client_session* session, - document_view_iterator_type begin, - document_view_iterator_type end, - const options::insert& options) { + bsoncxx::v_noabi::stdx::optional _insert_many( + const client_session* session, + document_view_iterator_type begin, + document_view_iterator_type end, + const options::insert& options) { bsoncxx::v_noabi::builder::basic::array inserted_ids; auto writes = _init_insert_many(options, session); std::for_each( diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp index ec2b0e635e..c82d8ce9ac 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp @@ -203,9 +203,9 @@ class database { /// mongocxx::v_noabi::operation_exception if the operation fails. /// MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) - create_collection(stdx::string_view name, + create_collection(bsoncxx::v_noabi::stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options = {}, - const stdx::optional& write_concern = {}); + const bsoncxx::v_noabi::stdx::optional& write_concern = {}); /// /// Explicitly creates a collection in this database with the specified options. @@ -231,9 +231,9 @@ class database { /// MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) create_collection(const client_session& session, - stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options = {}, - const stdx::optional& write_concern = {}); + const bsoncxx::v_noabi::stdx::optional& write_concern = {}); /// /// Explicitly creates a collection in this database with the specified options. @@ -256,17 +256,18 @@ class database { /// @exception /// mongocxx::v_noabi::operation_exception if the operation fails. /// - MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) - create_collection(bsoncxx::v_noabi::string::view_or_value name, - const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern = {}) { + MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) create_collection( + bsoncxx::v_noabi::string::view_or_value name, + const options::create_collection_deprecated& collection_options, + const bsoncxx::v_noabi::stdx::optional& write_concern = {}) { return create_collection_deprecated(name, collection_options, write_concern); } MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) - create_collection_deprecated(bsoncxx::v_noabi::string::view_or_value name, - const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern = {}); + create_collection_deprecated( + bsoncxx::v_noabi::string::view_or_value name, + const options::create_collection_deprecated& collection_options, + const bsoncxx::v_noabi::stdx::optional& write_concern = {}); /// /// Explicitly creates a collection in this database with the specified options. @@ -291,11 +292,11 @@ class database { /// @exception /// mongocxx::v_noabi::operation_exception if the operation fails. /// - MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) - create_collection(const client_session& session, - bsoncxx::v_noabi::string::view_or_value name, - const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern = {}) { + MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) create_collection( + const client_session& session, + bsoncxx::v_noabi::string::view_or_value name, + const options::create_collection_deprecated& collection_options, + const bsoncxx::v_noabi::stdx::optional& write_concern = {}) { return create_collection_deprecated(session, name, collection_options, write_concern); } @@ -323,10 +324,11 @@ class database { /// mongocxx::v_noabi::operation_exception if the operation fails. /// MONGOCXX_ABI_EXPORT_CDECL(mongocxx::v_noabi::collection) - create_collection_deprecated(const client_session& session, - bsoncxx::v_noabi::string::view_or_value name, - const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern = {}); + create_collection_deprecated( + const client_session& session, + bsoncxx::v_noabi::string::view_or_value name, + const options::create_collection_deprecated& collection_options, + const bsoncxx::v_noabi::stdx::optional& write_concern = {}); /// /// Drops the database and all its collections. @@ -451,7 +453,7 @@ class database { /// /// @return the name of this database. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::string_view) name() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::string_view) name() const; /// /// Sets the read_concern for this database. @@ -644,15 +646,15 @@ class database { mongocxx::v_noabi::collection _create_collection( const client_session* session, - stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options, - const stdx::optional& write_concern); + const bsoncxx::v_noabi::stdx::optional& write_concern); mongocxx::v_noabi::collection _create_collection_deprecated( const client_session* session, bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern); + const bsoncxx::v_noabi::stdx::optional& write_concern); cursor _list_collections(const client_session* session, bsoncxx::v_noabi::document::view_or_value filter); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp index 7cec324b74..b1f76fde51 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp @@ -22,7 +22,6 @@ #include #include -#include #include @@ -73,8 +72,9 @@ class operation_exception : public exception { /// @returns The raw server error, if it is available. /// /// @{ - const stdx::optional& raw_server_error() const; - stdx::optional& raw_server_error(); + const bsoncxx::v_noabi::stdx::optional& raw_server_error() + const; + bsoncxx::v_noabi::stdx::optional& raw_server_error(); /// @} /// @@ -86,10 +86,10 @@ class operation_exception : public exception { /// /// @returns True if the label is found in the operation exception, and false otherwise. /// - bool has_error_label(stdx::string_view label) const; + bool has_error_label(bsoncxx::v_noabi::stdx::string_view label) const; private: - stdx::optional _raw_server_error; + bsoncxx::v_noabi::stdx::optional _raw_server_error; }; BSONCXX_POP_WARNINGS(); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp index f2b5fa0e3c..8302cfde72 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp @@ -422,9 +422,3 @@ /// @namespace mongocxx::v_noabi::result::gridfs /// @copydoc mongocxx::result::gridfs /// - -/// -/// @namespace mongocxx::v_noabi::stdx -/// @copydoc mongocxx::stdx -/// @deprecated Use @ref bsoncxx::v_noabi::stdx instead. -/// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp index 16c3dc079e..4c88a59a74 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp @@ -33,7 +33,6 @@ #include #include #include -#include #include @@ -130,7 +129,8 @@ class bucket { /// indexes. /// MONGOCXX_ABI_EXPORT_CDECL(uploader) - open_upload_stream(stdx::string_view filename, const options::gridfs::upload& options = {}); + open_upload_stream(bsoncxx::v_noabi::stdx::string_view filename, + const options::gridfs::upload& options = {}); /// /// Opens a gridfs::uploader to create a new GridFS file. The id of the file will be @@ -164,7 +164,7 @@ class bucket { /// MONGOCXX_ABI_EXPORT_CDECL(uploader) open_upload_stream(const client_session& session, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options = {}); /// @@ -197,7 +197,7 @@ class bucket { /// MONGOCXX_ABI_EXPORT_CDECL(uploader) open_upload_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options = {}); /// @@ -235,7 +235,7 @@ class bucket { MONGOCXX_ABI_EXPORT_CDECL(uploader) open_upload_stream_with_id(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options = {}); /// @@ -280,7 +280,7 @@ class bucket { /// indexes. /// MONGOCXX_ABI_EXPORT_CDECL(result::gridfs::upload) - upload_from_stream(stdx::string_view filename, + upload_from_stream(bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); @@ -330,7 +330,7 @@ class bucket { /// MONGOCXX_ABI_EXPORT_CDECL(result::gridfs::upload) upload_from_stream(const client_session& session, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); @@ -377,7 +377,7 @@ class bucket { /// MONGOCXX_ABI_EXPORT_CDECL(void) upload_from_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); @@ -428,7 +428,7 @@ class bucket { MONGOCXX_ABI_EXPORT_CDECL(void) upload_from_stream_with_id(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); @@ -635,7 +635,7 @@ class bucket { /// @return /// The name of the GridFS bucket. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::string_view) bucket_name() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::string_view) bucket_name() const; private: friend ::mongocxx::v_noabi::database; @@ -647,25 +647,25 @@ class bucket { uploader _open_upload_stream_with_id(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options); void _upload_from_stream_with_id(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options); downloader _open_download_stream(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::optional start, - stdx::optional end); + bsoncxx::v_noabi::stdx::optional start, + bsoncxx::v_noabi::stdx::optional end); void _download_to_stream(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, - stdx::optional start, - stdx::optional end); + bsoncxx::v_noabi::stdx::optional start, + bsoncxx::v_noabi::stdx::optional end); void _delete_file(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp index 50fac1ec66..3c957a2823 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp @@ -27,7 +27,6 @@ #include #include -#include #include @@ -155,7 +154,7 @@ class downloader { // @param files_doc // The files collection document of the file being downloaded. // - downloader(stdx::optional chunks, + downloader(bsoncxx::v_noabi::stdx::optional chunks, chunks_and_bytes_offset start, std::int32_t chunk_size, std::int64_t file_len, diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp index b4289b64b4..c0d42d727a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp @@ -30,7 +30,6 @@ #include #include #include -#include #include @@ -150,13 +149,14 @@ class uploader { // @param metadata // Optional metadata field of the files collection document. // - uploader(const client_session* session, - bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, - collection files, - collection chunks, - std::int32_t chunk_size, - stdx::optional metadata = {}); + uploader( + const client_session* session, + bsoncxx::v_noabi::types::bson_value::view id, + bsoncxx::v_noabi::stdx::string_view filename, + collection files, + collection chunks, + std::int32_t chunk_size, + bsoncxx::v_noabi::stdx::optional metadata = {}); void finish_chunk(); void flush_chunks(); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp index 8a046d08a4..77cfa2ac33 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp @@ -24,8 +24,6 @@ #include #include -#include - #include namespace mongocxx { @@ -95,8 +93,8 @@ class hint { } private: - stdx::optional _index_doc; - stdx::optional _index_string; + bsoncxx::v_noabi::stdx::optional _index_doc; + bsoncxx::v_noabi::stdx::optional _index_string; }; /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp index 30a994e18a..c5bf34a05f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp @@ -81,7 +81,7 @@ class index_view { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) create_one(const bsoncxx::v_noabi::document::view_or_value& keys, const bsoncxx::v_noabi::document::view_or_value& index_options = {}, const options::index_view& options = options::index_view{}); @@ -110,7 +110,7 @@ class index_view { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) create_one(const client_session& session, const bsoncxx::v_noabi::document::view_or_value& keys, const bsoncxx::v_noabi::document::view_or_value& index_options = {}, @@ -135,7 +135,7 @@ class index_view { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) create_one(const index_model& index, const options::index_view& options = options::index_view{}); @@ -160,7 +160,7 @@ class index_view { /// @see /// - https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) create_one(const client_session& session, const index_model& index, const options::index_view& options = options::index_view{}); @@ -232,7 +232,8 @@ class index_view { /// - https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// MONGOCXX_ABI_EXPORT_CDECL(void) - drop_one(stdx::string_view name, const options::index_view& options = options::index_view{}); + drop_one(bsoncxx::v_noabi::stdx::string_view name, + const options::index_view& options = options::index_view{}); /// /// Drops a single index by name. @@ -255,7 +256,7 @@ class index_view { /// MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(const client_session& session, - stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, const options::index_view& options = options::index_view{}); /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp index 9d6b78fd2b..bb959b1858 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp @@ -20,8 +20,6 @@ #include -#include - #include namespace mongocxx { @@ -48,7 +46,7 @@ enum class log_level { /// /// @return a std::string representation of the type. /// -MONGOCXX_ABI_EXPORT_CDECL(stdx::string_view) to_string(log_level level); +MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::string_view) to_string(log_level level); /// /// The interface that all user-defined loggers must implement. @@ -73,8 +71,8 @@ class logger { /// @param message /// The text of the current log message. virtual void operator()(log_level level, - stdx::string_view domain, - stdx::string_view message) noexcept = 0; + bsoncxx::v_noabi::stdx::string_view domain, + bsoncxx::v_noabi::stdx::string_view message) noexcept = 0; protected: /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many.hpp index a75bf170bf..5aa8617fc4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many.hpp @@ -20,7 +20,6 @@ #include #include -#include #include @@ -74,7 +73,8 @@ class delete_many { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// Sets the index to use for this operation. @@ -96,13 +96,14 @@ class delete_many { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; private: bsoncxx::v_noabi::document::view_or_value _filter; - stdx::optional _collation; - stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one.hpp index b82021d877..d72c0b56c3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one.hpp @@ -20,7 +20,6 @@ #include #include -#include #include @@ -69,7 +68,8 @@ class delete_one { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -92,13 +92,14 @@ class delete_one { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; private: bsoncxx::v_noabi::document::view_or_value _filter; - stdx::optional _collation; - stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one.hpp index ac73a993f7..d980f0e61e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one.hpp @@ -20,7 +20,6 @@ #include #include -#include #include @@ -80,7 +79,8 @@ class replace_one { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -103,7 +103,7 @@ class replace_one { /// /// @return The optional value of the upsert option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Sets the index to use for this operation. @@ -125,15 +125,16 @@ class replace_one { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; private: bsoncxx::v_noabi::document::view_or_value _filter; bsoncxx::v_noabi::document::view_or_value _replacement; - stdx::optional _collation; - stdx::optional _upsert; - stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp index 38329ef800..b3d40b31e7 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp @@ -22,7 +22,6 @@ #include #include -#include #include @@ -119,7 +118,8 @@ class update_many { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// Sets the index to use for this operation. @@ -141,7 +141,8 @@ class update_many { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Sets the upsert option. @@ -163,7 +164,7 @@ class update_many { /// /// @return The optional value of the upsert option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Set array filters for this update operation. @@ -186,17 +187,18 @@ class update_many { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) array_filters() const; private: bsoncxx::v_noabi::document::view_or_value _filter; bsoncxx::v_noabi::document::view_or_value _update; - stdx::optional _collation; - stdx::optional _array_filters; - stdx::optional _upsert; - stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _array_filters; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp index 76a8222420..c337d65414 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp @@ -22,7 +22,6 @@ #include #include -#include #include @@ -119,7 +118,8 @@ class update_one { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -142,7 +142,8 @@ class update_one { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Sets the upsert option. @@ -164,7 +165,7 @@ class update_one { /// /// @return The optional value of the upsert option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Set array filters for this update operation. @@ -187,17 +188,18 @@ class update_one { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) array_filters() const; private: bsoncxx::v_noabi::document::view_or_value _filter; bsoncxx::v_noabi::document::view_or_value _update; - stdx::optional _collation; - stdx::optional _array_filters; - stdx::optional _upsert; - stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _array_filters; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp index ed8264cecd..cb593a8f90 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -67,7 +66,7 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) allow_disk_use() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) allow_disk_use() const; /// /// Sets the number of documents to return per batch. @@ -92,7 +91,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) batch_size() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + batch_size() const; /// /// Sets the collation for this operation. @@ -119,7 +119,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -146,7 +147,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) let() const; /// @@ -173,7 +175,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Sets the read_preference for this operation. @@ -197,7 +200,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_preference() const; /// @@ -220,7 +224,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bypass_document_validation() const; /// /// Sets the index to use for this operation. @@ -248,7 +253,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Sets the write concern to use for this operation. Only has an effect if $out is a part of @@ -276,7 +282,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -303,7 +310,8 @@ class aggregate { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_concern() const; /// @@ -331,7 +339,7 @@ class aggregate { /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) comment() const; private: @@ -340,17 +348,17 @@ class aggregate { void append(bsoncxx::v_noabi::builder::basic::document& builder) const; - stdx::optional _allow_disk_use; - stdx::optional _batch_size; - stdx::optional _collation; - stdx::optional _let; - stdx::optional _max_time; - stdx::optional _read_preference; - stdx::optional _bypass_document_validation; - stdx::optional _hint; - stdx::optional _write_concern; - stdx::optional _read_concern; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _allow_disk_use; + bsoncxx::v_noabi::stdx::optional _batch_size; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _read_preference; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _read_concern; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption.hpp index 4f1d82f800..7788ead92b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption.hpp @@ -23,8 +23,6 @@ #include #include -#include - #include namespace mongocxx { @@ -66,7 +64,7 @@ class auto_encryption { /// @return /// An optional pointer to the key vault client. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) key_vault_client() const; /// @@ -98,7 +96,7 @@ class auto_encryption { /// @return /// An optional pointer to the key vault pool. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) key_vault_pool() const; /// @@ -132,7 +130,8 @@ class auto_encryption { /// An optional pair of strings representing the namespace of the /// key vault collection. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) key_vault_namespace() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + key_vault_namespace() const; /// /// Sets the KMS providers to use for client side encryption. @@ -187,7 +186,8 @@ class auto_encryption { /// @return /// An optional document containing the KMS providers. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) kms_providers() const; /// @@ -222,7 +222,8 @@ class auto_encryption { /// @return /// An optional document containing the TLS options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) tls_opts() const; /// @@ -257,7 +258,8 @@ class auto_encryption { /// @return /// An optional document containing the schema map. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) schema_map() const; /// @@ -288,7 +290,8 @@ class auto_encryption { /// @return /// An optional document containing the encrypted fields map /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) encrypted_fields_map() const; /// @@ -396,7 +399,8 @@ class auto_encryption { /// @return /// An optional document containing the extra options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) extra_options() const; private: @@ -407,14 +411,15 @@ class auto_encryption { bool _bypass; bool _bypass_query_analysis; - stdx::optional _key_vault_client; - stdx::optional _key_vault_pool; - stdx::optional _key_vault_namespace; - stdx::optional _kms_providers; - stdx::optional _tls_opts; - stdx::optional _schema_map; - stdx::optional _encrypted_fields_map; - stdx::optional _extra_options; + bsoncxx::v_noabi::stdx::optional _key_vault_client; + bsoncxx::v_noabi::stdx::optional _key_vault_pool; + bsoncxx::v_noabi::stdx::optional _key_vault_namespace; + bsoncxx::v_noabi::stdx::optional _kms_providers; + bsoncxx::v_noabi::stdx::optional _tls_opts; + bsoncxx::v_noabi::stdx::optional _schema_map; + bsoncxx::v_noabi::stdx::optional + _encrypted_fields_map; + bsoncxx::v_noabi::stdx::optional _extra_options; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write.hpp index c7280ea441..3bc6a7cc94 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write.hpp @@ -88,7 +88,8 @@ class bulk_write { /// @see /// - https://www.mongodb.com/docs/manual/core/write-concern/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -110,7 +111,8 @@ class bulk_write { /// @return /// The current document validation bypass setting. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional) + bypass_document_validation() const; /// /// Set the value of the let option. @@ -130,7 +132,8 @@ class bulk_write { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -153,15 +156,15 @@ class bulk_write { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; private: bool _ordered; - stdx::optional _write_concern; - stdx::optional _bypass_document_validation; - stdx::optional _let; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream.hpp index 4fe256682e..e7d14c447d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream.hpp @@ -26,8 +26,6 @@ #include #include -#include - #include namespace mongocxx { @@ -131,7 +129,8 @@ class change_stream { /// @return /// The current batch size. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) batch_size() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + batch_size() const; /// /// Sets the current value of the comment option. @@ -153,7 +152,7 @@ class change_stream { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) comment() const; /// @@ -180,7 +179,8 @@ class change_stream { /// @return /// The current resumeToken. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) resume_after() const; /// @@ -209,7 +209,8 @@ class change_stream { /// @return /// The current startAfter token. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) start_after() const; /// @@ -231,7 +232,8 @@ class change_stream { /// @return /// The current collation. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -253,7 +255,7 @@ class change_stream { /// @return /// The current max time (in milliseconds). /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) max_await_time() const; /// @@ -280,17 +282,18 @@ class change_stream { bsoncxx::v_noabi::document::value as_bson() const; - stdx::optional _full_document; - stdx::optional _full_document_before_change; - stdx::optional _batch_size; - stdx::optional _comment; - stdx::optional _collation; - stdx::optional _resume_after; - stdx::optional _start_after; - stdx::optional _max_await_time; - // _start_at_operation_time is not wrapped in a stdx::optional because of a longstanding bug in - // the MNMLSTC polyfill that has been fixed on master, but not in the latest release: - // https://github.com/mnmlstc/core/pull/23 + bsoncxx::v_noabi::stdx::optional _full_document; + bsoncxx::v_noabi::stdx::optional + _full_document_before_change; + bsoncxx::v_noabi::stdx::optional _batch_size; + bsoncxx::v_noabi::stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _resume_after; + bsoncxx::v_noabi::stdx::optional _start_after; + bsoncxx::v_noabi::stdx::optional _max_await_time; + // _start_at_operation_time is not wrapped in a bsoncxx::v_noabi::stdx::optional because of a + // longstanding bug in the MNMLSTC polyfill that has been fixed on master, but not in the latest + // release: https://github.com/mnmlstc/core/pull/23 bsoncxx::v_noabi::types::b_timestamp _start_at_operation_time = {}; bool _start_at_operation_time_set = false; }; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client.hpp index f441c4ba81..0a75920a90 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client.hpp @@ -72,14 +72,15 @@ class client { /// /// @deprecated Please use tls_opts instead. /// - MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) ssl_opts() const; + MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + ssl_opts() const; /// /// The current TLS-related options. /// /// @return The TLS-related options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) tls_opts() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) tls_opts() const; /// /// Sets the automatic encryption options. @@ -99,7 +100,8 @@ class client { /// @return /// The automatic encryption opts. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) auto_encryption_opts() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + auto_encryption_opts() const; /// /// Sets the APM-related options. @@ -118,7 +120,7 @@ class client { /// /// @return The APM-related options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) apm_opts() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) apm_opts() const; /// /// Sets the server API options. @@ -139,13 +141,14 @@ class client { /// @return /// The server API options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) server_api_opts() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + server_api_opts() const; private: - stdx::optional _tls_opts; - stdx::optional _apm_opts; - stdx::optional _auto_encrypt_opts; - stdx::optional _server_api_opts; + bsoncxx::v_noabi::stdx::optional _tls_opts; + bsoncxx::v_noabi::stdx::optional _apm_opts; + bsoncxx::v_noabi::stdx::optional _auto_encrypt_opts; + bsoncxx::v_noabi::stdx::optional _server_api_opts; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption.hpp index e024ff3440..c8f04c9e63 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption.hpp @@ -23,8 +23,6 @@ #include #include -#include - #include namespace mongocxx { @@ -59,7 +57,7 @@ class client_encryption { /// @return /// An optional pointer to the key vault client. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) key_vault_client() const; /// @@ -93,7 +91,8 @@ class client_encryption { /// An optional pair of strings representing the namespace of the /// key vault collection. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) key_vault_namespace() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + key_vault_namespace() const; /// /// Sets the KMS providers to use for client side encryption. @@ -148,7 +147,8 @@ class client_encryption { /// @return /// An optional document containing the KMS providers. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) kms_providers() const; /// @@ -183,7 +183,8 @@ class client_encryption { /// @return /// An optional document containing the TLS options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) tls_opts() const; private: @@ -191,10 +192,10 @@ class client_encryption { void* convert() const; - stdx::optional _key_vault_client; - stdx::optional _key_vault_namespace; - stdx::optional _kms_providers; - stdx::optional _tls_opts; + bsoncxx::v_noabi::stdx::optional _key_vault_client; + bsoncxx::v_noabi::stdx::optional _key_vault_namespace; + bsoncxx::v_noabi::stdx::optional _kms_providers; + bsoncxx::v_noabi::stdx::optional _tls_opts; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session.hpp index 4d044a42f9..b064b1a329 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session.hpp @@ -20,7 +20,6 @@ #include #include -#include #include @@ -98,15 +97,16 @@ class client_session { /// /// @return The default transaction options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) default_transaction_opts() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + default_transaction_opts() const; private: friend ::mongocxx::v_noabi::client_session; - stdx::optional _causal_consistency; - stdx::optional _enable_snapshot_reads; + bsoncxx::v_noabi::stdx::optional _causal_consistency; + bsoncxx::v_noabi::stdx::optional _enable_snapshot_reads; - stdx::optional _default_transaction_opts; + bsoncxx::v_noabi::stdx::optional _default_transaction_opts; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count.hpp index 05f859c822..426424b8ae 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count.hpp @@ -63,7 +63,8 @@ class count { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -89,7 +90,8 @@ class count { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the comment option. @@ -116,7 +118,7 @@ class count { /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) comment() const; /// @@ -142,7 +144,7 @@ class count { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) limit() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) limit() const; /// /// Sets the maximum amount of time for this operation to run (server-side) in milliseconds. @@ -167,7 +169,8 @@ class count { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Sets the number of documents to skip before counting documents. @@ -192,7 +195,7 @@ class count { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) skip() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) skip() const; /// /// Sets the read_preference for this operation. @@ -217,17 +220,18 @@ class count { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_preference() const; private: - stdx::optional _collation; - stdx::optional _hint; - stdx::optional _comment; - stdx::optional _limit; - stdx::optional _max_time; - stdx::optional _skip; - stdx::optional _read_preference; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _limit; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _skip; + bsoncxx::v_noabi::stdx::optional _read_preference; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/create_collection.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/create_collection.hpp index 77a73bd30a..ba2fb18a66 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/create_collection.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/create_collection.hpp @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -60,7 +59,7 @@ class create_collection_deprecated { /// @see /// - https://www.mongodb.com/docs/manual/reference/glossary/#term-capped-collection /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) capped() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) capped() const; /// /// Sets the default collation for this collection. @@ -87,7 +86,8 @@ class create_collection_deprecated { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -113,7 +113,7 @@ class create_collection_deprecated { /// @return /// Maximum number of documents allowed in the collection (if capped). /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) max() const; /// /// When true, disables the power of 2 sizes allocation for the collection. @@ -139,7 +139,7 @@ class create_collection_deprecated { /// @return /// When true, power of 2 sizing is disabled for this collection. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) no_padding() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) no_padding() const; /// /// A maximum size, in bytes, for a capped collection. @@ -164,7 +164,7 @@ class create_collection_deprecated { /// @return /// Maximum size, in bytes, of this collection (if capped). /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) size() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) size() const; /// /// Specify configuration to the storage on a per-collection basis. @@ -187,7 +187,8 @@ class create_collection_deprecated { /// @return /// Configuration options specific to the storage engine. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) storage_engine() const; /// @@ -215,7 +216,8 @@ class create_collection_deprecated { /// @see /// - https://www.mongodb.com/docs/manual/core/document-validation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) validation_criteria() const; /// @@ -242,13 +244,14 @@ class create_collection_deprecated { } private: - stdx::optional _capped; - stdx::optional _collation; - stdx::optional _max_documents; - stdx::optional _max_size; - stdx::optional _no_padding; - stdx::optional _storage_engine_opts; - stdx::optional _validation; + bsoncxx::v_noabi::stdx::optional _capped; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _max_documents; + bsoncxx::v_noabi::stdx::optional _max_size; + bsoncxx::v_noabi::stdx::optional _no_padding; + bsoncxx::v_noabi::stdx::optional + _storage_engine_opts; + bsoncxx::v_noabi::stdx::optional _validation; }; /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key.hpp index c00be322c7..d63138e0ea 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key.hpp @@ -23,8 +23,6 @@ #include #include -#include - #include namespace mongocxx { @@ -99,7 +97,8 @@ class data_key { /// @return /// An optional document containing the master key. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) master_key() const; /// @@ -161,16 +160,17 @@ class data_key { /// @see /// - https://www.mongodb.com/docs/v6.0/reference/method/KeyVault.createKey/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) key_material(); + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + key_material(); private: friend ::mongocxx::v_noabi::client_encryption; void* convert() const; - stdx::optional _master_key; + bsoncxx::v_noabi::stdx::optional _master_key; std::vector _key_alt_names; - stdx::optional _key_material; + bsoncxx::v_noabi::stdx::optional _key_material; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete.hpp index ddea5191e0..308f3dcdbb 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete.hpp @@ -59,7 +59,8 @@ class delete_options { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -86,7 +87,8 @@ class delete_options { /// @see /// - https://www.mongodb.com/docs/manual/core/write-concern/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -109,7 +111,8 @@ class delete_options { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -129,7 +132,8 @@ class delete_options { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -152,15 +156,15 @@ class delete_options { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; private: - stdx::optional _collation; - stdx::optional _write_concern; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp index 1467d2f854..faee350aa0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp @@ -62,7 +62,8 @@ class distinct { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -88,7 +89,8 @@ class distinct { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Sets the comment for this operation. @@ -115,7 +117,7 @@ class distinct { /// - https://www.mongodb.com/docs/manual/reference/command/distinct/ /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) comment() const; /// @@ -141,14 +143,15 @@ class distinct { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_preference() const; private: - stdx::optional _collation; - stdx::optional _max_time; - stdx::optional _comment; - stdx::optional _read_preference; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _read_preference; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt.hpp index 29cfee5e36..f13dda993f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt.hpp @@ -24,7 +24,6 @@ #include #include -#include #include @@ -64,7 +63,7 @@ class encrypt { /// An optional owning bson_value containing the key_id. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) key_id() const; /// @@ -88,7 +87,8 @@ class encrypt { /// @return /// An optional key name. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) key_alt_name() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + key_alt_name() const; /// /// Determines which AEAD_AES_256_CBC algorithm to use with HMAC_SHA_512 when @@ -159,7 +159,8 @@ class encrypt { /// @return /// An optional algorithm. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) algorithm() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + algorithm() const; /// /// Sets the contention factor to use for encryption. @@ -177,7 +178,8 @@ class encrypt { /// @return /// An optional contention factor. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) contention_factor() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + contention_factor() const; /// /// Sets the query type to use for encryption. @@ -195,7 +197,8 @@ class encrypt { /// @return /// A query type. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) query_type() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + query_type() const; /// /// Sets the range options to use for encryption. @@ -208,19 +211,20 @@ class encrypt { /// @return /// An optional range options. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) range_opts() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + range_opts() const; private: friend ::mongocxx::v_noabi::client_encryption; void* convert() const; - stdx::optional _key_id; - stdx::optional _key_alt_name; - stdx::optional _algorithm; - stdx::optional _contention_factor; - stdx::optional _query_type; - stdx::optional _range_opts; + bsoncxx::v_noabi::stdx::optional _key_id; + bsoncxx::v_noabi::stdx::optional _key_alt_name; + bsoncxx::v_noabi::stdx::optional _algorithm; + bsoncxx::v_noabi::stdx::optional _contention_factor; + bsoncxx::v_noabi::stdx::optional _query_type; + bsoncxx::v_noabi::stdx::optional _range_opts; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find.hpp index b5ff7d1ffa..31372c84a9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find.hpp @@ -66,7 +66,7 @@ class find { /// /// @return Whether disk use on the server is allowed. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) allow_disk_use() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) allow_disk_use() const; /// /// Sets whether to allow partial results from a mongos if some shards are down (instead of @@ -92,7 +92,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) allow_partial_results() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + allow_partial_results() const; /// /// Sets the number of documents to return per batch. @@ -117,7 +118,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) batch_size() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + batch_size() const; /// /// Sets the collation for this operation. @@ -143,7 +145,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -174,7 +177,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) comment() const; /// @@ -200,7 +204,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) cursor_type() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + cursor_type() const; /// /// Sets the index to use for this operation. @@ -228,7 +233,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -254,7 +260,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -287,7 +294,7 @@ class find { /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) comment_option() const; /// @@ -312,7 +319,7 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) limit() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) limit() const; /// /// Gets the current exclusive upper bound for a specific index. @@ -337,7 +344,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) max() const; /// @@ -369,7 +377,7 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) max_await_time() const; /// @@ -395,7 +403,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Gets the current inclusive lower bound for a specific index. @@ -420,7 +429,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) min() const; /// @@ -447,7 +457,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) no_cursor_timeout() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + no_cursor_timeout() const; /// /// Sets a projection which limits the returned fields for all matching documents. @@ -473,7 +484,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) projection() const; /// @@ -500,7 +512,8 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_preference() const; /// @@ -531,7 +544,7 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) return_key() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) return_key() const; /// /// Sets whether to include the record identifier for each document in the query results. @@ -558,7 +571,7 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) show_record_id() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) show_record_id() const; /// /// Sets the number of documents to skip before returning results. @@ -583,7 +596,7 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) skip() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) skip() const; /// /// The order in which to return matching documents. If $orderby also exists in the modifiers @@ -609,31 +622,33 @@ class find { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/find/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) sort() const; private: - stdx::optional _allow_disk_use; - stdx::optional _allow_partial_results; - stdx::optional _batch_size; - stdx::optional _collation; - stdx::optional _comment; - stdx::optional _cursor_type; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment_option; - stdx::optional _limit; - stdx::optional _max; - stdx::optional _max_await_time; - stdx::optional _max_time; - stdx::optional _min; - stdx::optional _no_cursor_timeout; - stdx::optional _projection; - stdx::optional _read_preference; - stdx::optional _return_key; - stdx::optional _show_record_id; - stdx::optional _skip; - stdx::optional _ordering; + bsoncxx::v_noabi::stdx::optional _allow_disk_use; + bsoncxx::v_noabi::stdx::optional _allow_partial_results; + bsoncxx::v_noabi::stdx::optional _batch_size; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _cursor_type; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional + _comment_option; + bsoncxx::v_noabi::stdx::optional _limit; + bsoncxx::v_noabi::stdx::optional _max; + bsoncxx::v_noabi::stdx::optional _max_await_time; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _min; + bsoncxx::v_noabi::stdx::optional _no_cursor_timeout; + bsoncxx::v_noabi::stdx::optional _projection; + bsoncxx::v_noabi::stdx::optional _read_preference; + bsoncxx::v_noabi::stdx::optional _return_key; + bsoncxx::v_noabi::stdx::optional _show_record_id; + bsoncxx::v_noabi::stdx::optional _skip; + bsoncxx::v_noabi::stdx::optional _ordering; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.hpp index 27765ab677..6bbd989eb6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.hpp @@ -61,7 +61,8 @@ class find_one_and_delete { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -87,7 +88,8 @@ class find_one_and_delete { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Sets a projection that limits the fields to return. @@ -113,7 +115,8 @@ class find_one_and_delete { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) projection() const; /// @@ -143,7 +146,8 @@ class find_one_and_delete { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) sort() const; /// @@ -171,7 +175,8 @@ class find_one_and_delete { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -194,7 +199,8 @@ class find_one_and_delete { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -215,7 +221,8 @@ class find_one_and_delete { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -238,18 +245,18 @@ class find_one_and_delete { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; private: - stdx::optional _collation; - stdx::optional _max_time; - stdx::optional _projection; - stdx::optional _ordering; - stdx::optional _write_concern; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _projection; + bsoncxx::v_noabi::stdx::optional _ordering; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.hpp index 227f295d4f..4b52601d88 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.hpp @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -63,7 +62,8 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -94,7 +94,8 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bypass_document_validation() const; /// /// Sets the index to use for this operation. @@ -116,7 +117,8 @@ class find_one_and_replace { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -137,7 +139,8 @@ class find_one_and_replace { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -160,7 +163,7 @@ class find_one_and_replace { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; /// @@ -186,7 +189,8 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Sets a projection, which limits the fields to return. @@ -212,7 +216,8 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) projection() const; /// @@ -242,7 +247,8 @@ class find_one_and_replace { /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - @ref mongocxx::v_noabi::options::return_document /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) return_document() const; /// @@ -272,7 +278,8 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) sort() const; /// @@ -300,7 +307,7 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Sets the write concern for this operation. @@ -327,21 +334,22 @@ class find_one_and_replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; private: - stdx::optional _bypass_document_validation; - stdx::optional _collation; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; - stdx::optional _max_time; - stdx::optional _projection; - stdx::optional _return_document; - stdx::optional _ordering; - stdx::optional _upsert; - stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _projection; + bsoncxx::v_noabi::stdx::optional _return_document; + bsoncxx::v_noabi::stdx::optional _ordering; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _write_concern; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update.hpp index 0b367e67cc..c67ddc13eb 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update.hpp @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -64,7 +63,8 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -95,7 +95,8 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bypass_document_validation() const; /// /// Sets the index to use for this operation. @@ -118,7 +119,8 @@ class find_one_and_update { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -139,7 +141,8 @@ class find_one_and_update { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -162,7 +165,7 @@ class find_one_and_update { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; /// @@ -188,7 +191,8 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) max_time() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + max_time() const; /// /// Sets a projection, which limits the fields to return. @@ -214,7 +218,8 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) projection() const; /// @@ -244,7 +249,8 @@ class find_one_and_update { /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - @ref mongocxx::v_noabi::options::return_document /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) return_document() const; /// @@ -274,7 +280,8 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) sort() const; /// @@ -302,7 +309,7 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Sets the write concern for this operation. @@ -329,7 +336,8 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -357,22 +365,23 @@ class find_one_and_update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) array_filters() const; private: - stdx::optional _bypass_document_validation; - stdx::optional _collation; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; - stdx::optional _max_time; - stdx::optional _projection; - stdx::optional _return_document; - stdx::optional _ordering; - stdx::optional _upsert; - stdx::optional _write_concern; - stdx::optional _array_filters; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _projection; + bsoncxx::v_noabi::stdx::optional _return_document; + bsoncxx::v_noabi::stdx::optional _ordering; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _array_filters; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.hpp index f419d5b4e3..f60607fb6d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -55,7 +54,8 @@ class bucket { /// @return /// The name of the bucket. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bucket_name() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bucket_name() const; /// /// Sets the size of the chunks in the bucket. This will be used as the chunk size for files @@ -76,7 +76,8 @@ class bucket { /// @return /// The size of the chunks in the bucket in bytes. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) chunk_size_bytes() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + chunk_size_bytes() const; /// /// Sets the read concern to be used when reading from the bucket. Defaults to the read @@ -97,7 +98,8 @@ class bucket { /// @return /// The read concern of the bucket. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_concern() const; /// @@ -126,7 +128,8 @@ class bucket { /// @return /// The read preference of the bucket. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) read_preference() const; /// @@ -149,15 +152,16 @@ class bucket { /// @return /// The write concern of the bucket. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; private: - stdx::optional _bucket_name; - stdx::optional _chunk_size_bytes; - stdx::optional _read_concern; - stdx::optional _read_preference; - stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _bucket_name; + bsoncxx::v_noabi::stdx::optional _chunk_size_bytes; + bsoncxx::v_noabi::stdx::optional _read_concern; + bsoncxx::v_noabi::stdx::optional _read_preference; + bsoncxx::v_noabi::stdx::optional _write_concern; }; } // namespace gridfs diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload.hpp index 884f91ec03..001aca2cf5 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload.hpp @@ -19,8 +19,6 @@ #include #include -#include - #include namespace mongocxx { @@ -52,7 +50,8 @@ class upload { /// @return /// The chunk size of the GridFS file being uploaded in bytes. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) chunk_size_bytes() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + chunk_size_bytes() const; /// /// Sets the metadata field of the GridFS file being uploaded. A GridFS file can store arbitrary @@ -73,12 +72,13 @@ class upload { /// @return /// The metadata document of the GridFS file. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) metadata() const; private: - stdx::optional _chunk_size_bytes; - stdx::optional _metadata; + bsoncxx::v_noabi::stdx::optional _chunk_size_bytes; + bsoncxx::v_noabi::stdx::optional _metadata; }; } // namespace gridfs diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index.hpp index 7c6ac5a241..1a37191c12 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index.hpp @@ -26,8 +26,6 @@ #include #include -#include - #include #include @@ -95,14 +93,15 @@ class index { /// /// @return The current config_string. /// - const stdx::optional& config_string() const; + const bsoncxx::v_noabi::stdx::optional& + config_string() const; private: friend ::mongocxx::v_noabi::collection; MONGOCXX_ABI_NO_EXPORT int type() const override; - stdx::optional _config_string; + bsoncxx::v_noabi::stdx::optional _config_string; }; BSONCXX_POP_WARNINGS(); @@ -130,7 +129,7 @@ class index { /// /// @return The current background. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) background() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) background() const; /// /// Whether or not to create a unique index so that the collection will not accept insertion of @@ -153,7 +152,7 @@ class index { /// /// @return The current unique. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) unique() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) unique() const; /// /// Whether or not the index is hidden from the query planner. A hidden index is not evaluated @@ -176,7 +175,7 @@ class index { /// /// @return The current hidden. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hidden() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) hidden() const; /// /// The name of the index. @@ -195,7 +194,8 @@ class index { /// /// @return The current name. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) name() const; /// @@ -222,7 +222,8 @@ class index { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -246,7 +247,7 @@ class index { /// /// @return The current sparse setting. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) sparse() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) sparse() const; /// /// Optionally used only in MongoDB 3.0.0 and higher. Specifies the storage engine options for @@ -293,7 +294,8 @@ class index { /// /// @return The current expire_after value. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) expire_after() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + expire_after() const; /// /// Sets the index version. @@ -312,7 +314,8 @@ class index { /// /// @return The current index version. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) version() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + version() const; /// /// For text indexes, sets the weight document. The weight document contains field and weight @@ -332,7 +335,8 @@ class index { /// /// @return The current weights. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) weights() const; /// @@ -354,7 +358,8 @@ class index { /// /// @return The current default_language. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) default_language() const; /// @@ -376,7 +381,8 @@ class index { /// /// @return The name of the field that contains the override language for text indexes. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) language_override() const; /// @@ -397,7 +403,8 @@ class index { /// /// @return The current partial_filter_expression. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) partial_filter_expression() const; /// @@ -417,7 +424,8 @@ class index { /// /// @return The current twod_sphere_version. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) twod_sphere_version() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + twod_sphere_version() const; /// /// For 2d indexes, the precision of the stored geohash value of the location data. @@ -436,7 +444,8 @@ class index { /// /// @return The precision of the stored geohash value of the location data. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) twod_bits_precision() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + twod_bits_precision() const; /// /// For 2d indexes, the lower inclusive boundary for the longitude and latitude values. @@ -455,7 +464,8 @@ class index { /// /// @return The lower inclusive boundary for the longitude and latitude values. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) twod_location_min() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + twod_location_min() const; /// /// For 2d indexes, the upper inclusive boundary for the longitude and latitude values. @@ -474,7 +484,8 @@ class index { /// /// @return The upper inclusive boundary for the longitude and latitude values. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) twod_location_max() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + twod_location_max() const; /// /// For geoHaystack indexes, specify the number of units within which to group the location @@ -506,9 +517,9 @@ class index { /// @deprecated /// This method is deprecated. /// - MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) haystack_bucket_size() const; - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) haystack_bucket_size_deprecated() const; /// @@ -524,24 +535,24 @@ class index { private: friend ::mongocxx::v_noabi::collection; - stdx::optional _background; - stdx::optional _unique; - stdx::optional _hidden; - stdx::optional _name; - stdx::optional _collation; - stdx::optional _sparse; + bsoncxx::v_noabi::stdx::optional _background; + bsoncxx::v_noabi::stdx::optional _unique; + bsoncxx::v_noabi::stdx::optional _hidden; + bsoncxx::v_noabi::stdx::optional _name; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _sparse; std::unique_ptr _storage_options; - stdx::optional _expire_after; - stdx::optional _version; - stdx::optional _weights; - stdx::optional _default_language; - stdx::optional _language_override; - stdx::optional _partial_filter_expression; - stdx::optional _twod_sphere_version; - stdx::optional _twod_bits_precision; - stdx::optional _twod_location_min; - stdx::optional _twod_location_max; - stdx::optional _haystack_bucket_size; + bsoncxx::v_noabi::stdx::optional _expire_after; + bsoncxx::v_noabi::stdx::optional _version; + bsoncxx::v_noabi::stdx::optional _weights; + bsoncxx::v_noabi::stdx::optional _default_language; + bsoncxx::v_noabi::stdx::optional _language_override; + bsoncxx::v_noabi::stdx::optional _partial_filter_expression; + bsoncxx::v_noabi::stdx::optional _twod_sphere_version; + bsoncxx::v_noabi::stdx::optional _twod_bits_precision; + bsoncxx::v_noabi::stdx::optional _twod_location_min; + bsoncxx::v_noabi::stdx::optional _twod_location_max; + bsoncxx::v_noabi::stdx::optional _haystack_bucket_size; // // Return the current storage_options setting. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view.hpp index c355433a3b..118d6bb4d0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view.hpp @@ -141,7 +141,8 @@ class index_view { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/createIndexes /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) commit_quorum() const; private: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert.hpp index 4603ee4841..f11e88a7d4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -56,7 +55,8 @@ class insert { /// /// @return The optional value of the bypass_document_validation option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bypass_document_validation() const; /// /// Sets the write_concern for this operation. @@ -81,7 +81,8 @@ class insert { /// @see /// - https://www.mongodb.com/docs/manual/core/write-concern/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -112,7 +113,7 @@ class insert { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/insert/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) ordered() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) ordered() const; /// /// Sets the comment for this operation. @@ -139,14 +140,14 @@ class insert { /// - https://www.mongodb.com/docs/manual/reference/command/insert/ /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) comment() const; private: - stdx::optional _write_concern; - stdx::optional _ordered; - stdx::optional _bypass_document_validation; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _ordered; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range.hpp index 60d7e4dfae..3022a5f209 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range.hpp @@ -21,8 +21,6 @@ #include #include -#include - #include namespace mongocxx { @@ -48,7 +46,7 @@ class range { /// @brief Gets `RangeOpts.min`. /// @note Required if @ref precision is set. MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) min() const; /// @brief Sets `RangeOpts.max`. @@ -58,20 +56,22 @@ class range { /// @brief Gets `RangeOpts.max`. /// @note Required if @ref precision is set. MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional&) + const bsoncxx::v_noabi::stdx::optional&) max() const; /// @brief Sets `RangeOpts.sparsity`. MONGOCXX_ABI_EXPORT_CDECL(range&) sparsity(std::int64_t value); /// @brief Gets `RangeOpts.sparsity`. - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) sparsity() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + sparsity() const; /// @brief Sets `RangeOpts.trimFactor`. MONGOCXX_ABI_EXPORT_CDECL(range&) trim_factor(std::int32_t value); /// @brief Gets `RangeOpts.trimFactor`. - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) trim_factor() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + trim_factor() const; /// @brief Sets `RangeOpts.precision`. /// @note May only be set for `double` or `decimal128`. @@ -79,14 +79,15 @@ class range { /// @brief Gets `RangeOpts.precision`. /// @note May only be set for `double` or `decimal128`. - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) precision() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + precision() const; private: - stdx::optional _min; - stdx::optional _max; - stdx::optional _sparsity; - stdx::optional _trim_factor; - stdx::optional _precision; + bsoncxx::v_noabi::stdx::optional _min; + bsoncxx::v_noabi::stdx::optional _max; + bsoncxx::v_noabi::stdx::optional _sparsity; + bsoncxx::v_noabi::stdx::optional _trim_factor; + bsoncxx::v_noabi::stdx::optional _precision; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace.hpp index 2bc0eeb880..22399decb8 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -58,7 +57,8 @@ class replace { /// /// @return The optional value of the bypass_document_validation option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bypass_document_validation() const; /// /// Sets the collation for this operation. @@ -85,7 +85,8 @@ class replace { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -111,7 +112,7 @@ class replace { /// /// @return The optional value of the upsert option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Sets the write_concern for this operation. @@ -137,7 +138,8 @@ class replace { /// @see /// - https://www.mongodb.com/docs/manual/core/write-concern/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -160,7 +162,8 @@ class replace { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -180,7 +183,8 @@ class replace { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -203,17 +207,17 @@ class replace { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; private: - stdx::optional _bypass_document_validation; - stdx::optional _collation; - stdx::optional _upsert; - stdx::optional _write_concern; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.hpp index 99d9d42f8b..03ae288aa9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.hpp @@ -22,8 +22,6 @@ #include #include -#include - #include namespace mongocxx { @@ -100,14 +98,15 @@ class rewrap_many_datakey { /// @see /// - https://www.mongodb.com/docs/manual/core/csfle/reference/kms-providers/#std-label-csfle-reference-kms-providers-create-and-store /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) master_key() const; private: friend ::mongocxx::v_noabi::client_encryption; bsoncxx::v_noabi::string::view_or_value _provider; - stdx::optional _master_key; + bsoncxx::v_noabi::stdx::optional _master_key; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api.hpp index f560c38afc..6be73994c6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api.hpp @@ -23,8 +23,6 @@ #include #include -#include - #include namespace mongocxx { @@ -83,7 +81,8 @@ class server_api { /// @return /// The enum value of the given string. /// - static MONGOCXX_ABI_EXPORT_CDECL(version) version_from_string(stdx::string_view version); + static MONGOCXX_ABI_EXPORT_CDECL(version) + version_from_string(bsoncxx::v_noabi::stdx::string_view version); /// /// Sets the strict option, specifying whether the server should return @@ -103,7 +102,7 @@ class server_api { /// @return /// The optional value of the strict option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) strict() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) strict() const; /// /// Sets the deprecation errors option, specifying whether the server should @@ -123,7 +122,8 @@ class server_api { /// @return /// The optional value of the deprecation errors option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) deprecation_errors() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + deprecation_errors() const; /// /// Gets the declared server api version. @@ -138,8 +138,8 @@ class server_api { friend ::mongocxx::v_noabi::pool; version _version; - stdx::optional _strict; - stdx::optional _deprecation_errors; + bsoncxx::v_noabi::stdx::optional _strict; + bsoncxx::v_noabi::stdx::optional _deprecation_errors; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls.hpp index dcb0b64cb6..d3d15b1f8f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls.hpp @@ -21,8 +21,6 @@ #include #include -#include - #include namespace mongocxx { @@ -52,7 +50,8 @@ class tls { /// /// @return The path to the .pem file. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) pem_file() const; /// @@ -73,7 +72,8 @@ class tls { /// /// @return The pass phrase. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) pem_password() const; /// @@ -94,7 +94,8 @@ class tls { /// /// @return The path to the CA file. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) ca_file() const; /// @@ -114,7 +115,8 @@ class tls { /// /// @return The path to the CA directory. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) ca_dir() const; /// @@ -134,7 +136,8 @@ class tls { /// /// @return The path to the revoked certificates file. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) crl_file() const; /// @@ -154,15 +157,16 @@ class tls { /// /// @return Whether or not the driver will check the server's CA file. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) allow_invalid_certificates() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + allow_invalid_certificates() const; private: - stdx::optional _pem_file; - stdx::optional _pem_password; - stdx::optional _ca_file; - stdx::optional _ca_dir; - stdx::optional _crl_file; - stdx::optional _allow_invalid_certificates; + bsoncxx::v_noabi::stdx::optional _pem_file; + bsoncxx::v_noabi::stdx::optional _pem_password; + bsoncxx::v_noabi::stdx::optional _ca_file; + bsoncxx::v_noabi::stdx::optional _ca_dir; + bsoncxx::v_noabi::stdx::optional _crl_file; + bsoncxx::v_noabi::stdx::optional _allow_invalid_certificates; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction.hpp index 4f20656fc7..7599e5e6f4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction.hpp @@ -25,8 +25,6 @@ #include -#include - #include namespace mongocxx { @@ -83,7 +81,8 @@ class transaction { /// @return /// An optional containing the read concern. If the read concern has not been set, a /// disengaged optional is returned. - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) read_concern() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + read_concern() const; /// /// Sets the transaction write concern. @@ -106,7 +105,7 @@ class transaction { /// @return /// An optional containing the write concern. If the write concern has not been set, a /// disengaged optional is returned. - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) write_concern() const; /// @@ -128,7 +127,7 @@ class transaction { /// @return /// An optional containing the read preference. If the read preference has not been set, a /// disengaged optional is returned. - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) read_preference() const; /// @@ -149,7 +148,8 @@ class transaction { /// An optional containing the timeout. If the max commit time has not been set, /// a disengaged optional is returned. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) max_commit_time_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + max_commit_time_ms() const; private: friend ::mongocxx::v_noabi::client_session; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update.hpp index 267eb7b14a..6b5d22f95a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -58,7 +57,8 @@ class update { /// /// @return The optional value of the bypass_document_validation option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) bypass_document_validation() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + bypass_document_validation() const; /// /// Sets the collation for this operation. @@ -85,7 +85,8 @@ class update { /// @see /// - https://www.mongodb.com/docs/manual/reference/collation/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) collation() const; /// @@ -108,7 +109,8 @@ class update { /// /// @return The current hint, if one is set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) hint() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + hint() const; /// /// Set the value of the let option. @@ -128,7 +130,8 @@ class update { /// @return /// The current let option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) let() const; /// @@ -151,7 +154,7 @@ class update { /// The current comment option. /// MONGOCXX_ABI_EXPORT_CDECL( - const stdx::optional) + const bsoncxx::v_noabi::stdx::optional) comment() const; /// @@ -177,7 +180,7 @@ class update { /// /// @return The optional value of the upsert option. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) upsert() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) upsert() const; /// /// Sets the write_concern for this operation. @@ -203,7 +206,8 @@ class update { /// @see /// - https://www.mongodb.com/docs/manual/core/write-concern/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) write_concern() const; /// @@ -231,18 +235,19 @@ class update { /// @see /// - https://www.mongodb.com/docs/manual/reference/command/update/ /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) array_filters() const; private: - stdx::optional _bypass_document_validation; - stdx::optional _collation; - stdx::optional _upsert; - stdx::optional _write_concern; - stdx::optional _array_filters; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + bsoncxx::v_noabi::stdx::optional _bypass_document_validation; + bsoncxx::v_noabi::stdx::optional _collation; + bsoncxx::v_noabi::stdx::optional _upsert; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _array_filters; + bsoncxx::v_noabi::stdx::optional _hint; + bsoncxx::v_noabi::stdx::optional _let; + bsoncxx::v_noabi::stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp index 2ecd902822..e451e01941 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -130,7 +129,7 @@ class pool { /// Acquires a client from the pool. This method will return immediately, but may return a /// disengaged optional if a client is not available. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) try_acquire(); + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) try_acquire(); private: friend ::mongocxx::v_noabi::options::auto_encryption; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp index dfa04b7d1b..af4edf1ec0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp @@ -28,7 +28,6 @@ #include #include -#include #include @@ -139,7 +138,8 @@ class read_concern { /// @param rc_string /// The read concern string. /// - MONGOCXX_ABI_EXPORT_CDECL(void) acknowledge_string(stdx::string_view rc_string); + MONGOCXX_ABI_EXPORT_CDECL(void) + acknowledge_string(bsoncxx::v_noabi::stdx::string_view rc_string); /// /// Gets the current read concern string. @@ -149,7 +149,7 @@ class read_concern { /// /// @return The read concern string. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::string_view) acknowledge_string() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::string_view) acknowledge_string() const; /// /// Gets the document form of this read_concern. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp index d74045f189..70bc706c15 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp @@ -33,7 +33,6 @@ #include #include -#include #include @@ -225,7 +224,8 @@ class read_preference { /// @see /// - https://www.mongodb.com/docs/manual/core/read-preference-tags/ /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tags() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + tags() const; /// /// Sets the max staleness setting for this read_preference. Secondary @@ -264,7 +264,8 @@ class read_preference { /// /// @return The optionally current max staleness setting. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) max_staleness() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + max_staleness() const; /// /// Sets the hedge document to be used for the read preference. Sharded clusters running MongoDB @@ -292,7 +293,9 @@ class read_preference { /// /// @return A hedge document if one was set. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional) hedge() const; + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional) + hedge() const; /// /// @relates mongocxx::v_noabi::read_preference diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one.hpp index 75d934a905..ce5a60c4a1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one.hpp @@ -22,7 +22,6 @@ #include #include -#include #include @@ -62,7 +61,7 @@ class replace_one { /// /// @return The value of the _id field for upserted document. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) upserted_id() const; friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator==(const replace_one&, const replace_one&); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update.hpp index 9b5afc5488..bf3316dcc3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update.hpp @@ -22,7 +22,6 @@ #include #include -#include #include @@ -67,7 +66,7 @@ class update { /// /// @return The value of the _id field for upserted document. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) upserted_id() const; friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator==(const update&, const update&); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp deleted file mode 100644 index 9b3e2dbde5..0000000000 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// 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 - -// "Forward-declare" the `bsoncxx::v_noabi::stdx` namespace to permit the using-declaration below. -namespace bsoncxx { -namespace v_noabi { -namespace stdx {} -} // namespace v_noabi -} // namespace bsoncxx - -namespace mongocxx { -namespace v_noabi { -namespace stdx { - -using namespace bsoncxx::v_noabi::stdx; - -} // namespace stdx -} // namespace v_noabi -} // namespace mongocxx - -namespace mongocxx { -namespace stdx { - -using namespace mongocxx::v_noabi::stdx; - -} // namespace stdx -} // namespace mongocxx - -#include - -/// -/// @file -/// Redeclares @ref bsoncxx::v_noabi::stdx in @ref mongocxx::v_noabi::stdx for internal use. -/// -/// @warning These redeclarations are for internal use only! Users should reference entities -/// declared in @ref bsoncxx::v_noabi::stdx directly, not through @ref mongocxx::v_noabi::stdx. -/// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp index 3870e2cae0..194410e126 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp @@ -192,16 +192,17 @@ class uri { /// /// Returns the value of the option "appname" if present in the uri. /// - /// @return An optional stdx::string_view + /// @return An optional bsoncxx::v_noabi::stdx::string_view /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) appname() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + appname() const; /// /// Returns the value of the option "authMechanismProperties" if present in the uri. /// /// @return An optional bsoncxx::v_noabi::document::view /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) auth_mechanism_properties() const; /// @@ -209,127 +210,138 @@ class uri { /// /// @return An optional bsoncxx::v_noabi::document::view /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) credentials(); + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + credentials(); /// /// Returns the value of the option "srvMaxHosts" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) srv_max_hosts() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) srv_max_hosts() const; /// /// Returns the list of compressors present in the uri or an empty list if "compressors" was not /// present or contained no valid compressors. /// - /// @return A std::vector of stdx::string_view. + /// @return A std::vector of bsoncxx::v_noabi::stdx::string_view. /// - MONGOCXX_ABI_EXPORT_CDECL(std::vector) compressors() const; + MONGOCXX_ABI_EXPORT_CDECL(std::vector) compressors() const; /// /// Returns the value of the option "connectTimeoutMS" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) connect_timeout_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + connect_timeout_ms() const; /// /// Returns the value of the option "directConnection" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) direct_connection() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) direct_connection() const; /// /// Returns the value of the option "heartbeatFrequencyMS" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) heartbeat_frequency_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + heartbeat_frequency_ms() const; /// /// Returns the value of the option "localThresholdMS" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) local_threshold_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + local_threshold_ms() const; /// /// Returns the value of the option "maxPoolSize" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) max_pool_size() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) max_pool_size() const; /// /// Returns the value of the option "retryReads" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) retry_reads() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) retry_reads() const; /// /// Returns the value of the option "retryWrites" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) retry_writes() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) retry_writes() const; /// /// Returns the value of the option "serverSelectionTimeoutMS" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) server_selection_timeout_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + server_selection_timeout_ms() const; /// /// Returns the value of the option "serverSelectionTryOnce" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) server_selection_try_once() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + server_selection_try_once() const; /// /// Returns the value of the option "socketTimeoutMS" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) socket_timeout_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + socket_timeout_ms() const; /// /// Returns the value of the option "tlsAllowInvalidCertificates" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tls_allow_invalid_certificates() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + tls_allow_invalid_certificates() const; /// /// Returns the value of the option "tlsAllowInvalidHostnames" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tls_allow_invalid_hostnames() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + tls_allow_invalid_hostnames() const; /// /// Returns the value of the option "tlsCAFile" if present in the uri. /// - /// @return An optional stdx::string_view + /// @return An optional bsoncxx::v_noabi::stdx::string_view /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tls_ca_file() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + tls_ca_file() const; /// /// Returns the value of the option "tlsCertificateKeyFile" if present in the uri. /// - /// @return An optional stdx::string_view + /// @return An optional bsoncxx::v_noabi::stdx::string_view /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tls_certificate_key_file() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + tls_certificate_key_file() const; /// /// Returns the value of the option "tlsCertificateKeyFilePassword" if present in the uri. /// - /// @return An optional stdx::string_view + /// @return An optional bsoncxx::v_noabi::stdx::string_view /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) tls_certificate_key_file_password() const; /// @@ -338,7 +350,7 @@ class uri { /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) tls_disable_certificate_revocation_check() const; /// @@ -346,28 +358,31 @@ class uri { /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tls_disable_ocsp_endpoint_check() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + tls_disable_ocsp_endpoint_check() const; /// /// Returns the value of the option "tlsInsecure" if present in the uri. /// /// @return An optional bool /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tls_insecure() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) tls_insecure() const; /// /// Returns the value of the option "waitQueueTimeoutMS" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) wait_queue_timeout_ms() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + wait_queue_timeout_ms() const; /// /// Returns the value of the option "zlibCompressionLevel" if present in the uri. /// /// @return An optional std::int32_t /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) zlib_compression_level() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) + zlib_compression_level() const; private: friend ::mongocxx::v_noabi::client; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp index 12b07ffe10..cf6ef86e3b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp @@ -19,8 +19,6 @@ #include #include -#include - #include namespace mongocxx { @@ -53,7 +51,8 @@ class validation_criteria { /// @return /// Document representing a validation rule. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) + MONGOCXX_ABI_EXPORT_CDECL( + const bsoncxx::v_noabi::stdx::optional&) rule() const; /// @@ -89,7 +88,8 @@ class validation_criteria { /// @return /// The enumerated validation level. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) level() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + level() const; /// /// A class to represent the different validation action options. @@ -122,7 +122,8 @@ class validation_criteria { /// @return /// The enumerated validation action. /// - MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional&) action() const; + MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional&) + action() const; /// /// Returns a bson document representing this set of validation criteria. @@ -148,9 +149,9 @@ class validation_criteria { } private: - stdx::optional _rule; - stdx::optional _level; - stdx::optional _action; + bsoncxx::v_noabi::stdx::optional _rule; + bsoncxx::v_noabi::stdx::optional _level; + bsoncxx::v_noabi::stdx::optional _action; }; /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp index 0efd01c64d..6982dc45a0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp @@ -33,7 +33,6 @@ #include #include -#include #include @@ -179,7 +178,7 @@ class write_concern { /// @param tag /// The string representing on of the "getLastErrorModes" in the replica set configuration. /// - MONGOCXX_ABI_EXPORT_CDECL(void) tag(stdx::string_view tag); + MONGOCXX_ABI_EXPORT_CDECL(void) tag(bsoncxx::v_noabi::stdx::string_view tag); /// /// Sets an upper bound on the time a write concern can take to be satisfied. If the write @@ -211,7 +210,7 @@ class write_concern { /// /// @return The number of required nodes. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) nodes() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) nodes() const; /// /// Gets the current acknowledgment level. @@ -228,7 +227,7 @@ class write_concern { /// /// @return The current getLastErrorMode. /// - MONGOCXX_ABI_EXPORT_CDECL(stdx::optional) tag() const; + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional) tag() const; /// /// Gets whether the majority of nodes is currently required by this write_concern. diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp index 3ff3802f3c..98a672abe7 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp @@ -182,7 +182,7 @@ bulk_write& bulk_write::append(const model::write& operation) { return *this; } -stdx::optional bulk_write::execute() const { +bsoncxx::v_noabi::stdx::optional bulk_write::execute() const { mongoc_bulk_operation_t* b = _impl->operation_t; scoped_bson_t reply; bson_error_t error; @@ -193,12 +193,12 @@ stdx::optional bulk_write::execute() const { // Reply is empty for unacknowledged writes, so return disengaged optional. if (reply.view().empty()) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } result::bulk_write result(reply.steal()); - return stdx::optional(std::move(result)); + return bsoncxx::v_noabi::stdx::optional(std::move(result)); } bulk_write::bulk_write(const collection& coll, @@ -225,9 +225,9 @@ bulk_write::bulk_write(const collection& coll, } scoped_bson_t bson_options(options_builder.extract()); - _impl = - stdx::make_unique(libmongoc::collection_create_bulk_operation_with_opts( - coll._get_impl().collection_t, bson_options.bson())); + _impl = bsoncxx::v_noabi::stdx::make_unique( + libmongoc::collection_create_bulk_operation_with_opts(coll._get_impl().collection_t, + bson_options.bson())); if (auto validation = options.bypass_document_validation()) { libmongoc::bulk_operation_set_bypass_document_validation(_impl->operation_t, *validation); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp index edee0967d0..0444112e32 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp @@ -55,13 +55,15 @@ change_stream::iterator change_stream::end() const { return iterator{change_stream::iterator::iter_type::k_end, this}; } -stdx::optional change_stream::get_resume_token() const { +bsoncxx::v_noabi::stdx::optional change_stream::get_resume_token() + const { return _impl->get_resume_token(); } // void* since we don't leak C driver defs into C++ driver change_stream::change_stream(void* change_stream_ptr) - : _impl(stdx::make_unique(static_cast(change_stream_ptr))) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique( + static_cast(change_stream_ptr))) {} change_stream::iterator::iterator() : change_stream::iterator::iterator{iter_type::k_default_constructed, nullptr} {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp index e91efccc4b..f0b26f24a0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp @@ -90,7 +90,7 @@ client::client(const mongocxx::v_noabi::uri& uri, const options::client& options throw exception{error_code::k_invalid_parameter, "could not construct client from URI"}; } - _impl = stdx::make_unique(std::move(new_client)); + _impl = bsoncxx::v_noabi::stdx::make_unique(std::move(new_client)); if (options.apm_opts()) { _impl->listeners = *options.apm_opts(); @@ -140,7 +140,8 @@ client::client(const mongocxx::v_noabi::uri& uri, const options::client& options } client::client(void* implementation) - : _impl{stdx::make_unique(static_cast<::mongoc_client_t*>(implementation))} {} + : _impl{bsoncxx::v_noabi::stdx::make_unique( + static_cast<::mongoc_client_t*>(implementation))} {} client::client(client&&) noexcept = default; client& client::operator=(client&&) noexcept = default; @@ -162,7 +163,8 @@ void client::read_concern(mongocxx::v_noabi::read_concern rc) { mongocxx::v_noabi::read_concern client::read_concern() const { auto rc = libmongoc::client_get_read_concern(_get_impl().client_t); - return {stdx::make_unique(libmongoc::read_concern_copy(rc))}; + return { + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))}; } void client::read_preference_deprecated(mongocxx::v_noabi::read_preference rp) { @@ -174,13 +176,14 @@ void client::read_preference(mongocxx::v_noabi::read_preference rp) { } mongocxx::v_noabi::read_preference client::read_preference() const { - mongocxx::v_noabi::read_preference rp(stdx::make_unique( - libmongoc::read_prefs_copy(libmongoc::client_get_read_prefs(_get_impl().client_t)))); + mongocxx::v_noabi::read_preference rp( + bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_prefs_copy(libmongoc::client_get_read_prefs(_get_impl().client_t)))); return rp; } mongocxx::v_noabi::uri client::uri() const { - mongocxx::v_noabi::uri connection_string(stdx::make_unique( + mongocxx::v_noabi::uri connection_string(bsoncxx::v_noabi::stdx::make_unique( libmongoc::uri_copy(libmongoc::client_get_uri(_get_impl().client_t)))); return connection_string; } @@ -194,7 +197,7 @@ void client::write_concern(mongocxx::v_noabi::write_concern wc) { } mongocxx::v_noabi::write_concern client::write_concern() const { - mongocxx::v_noabi::write_concern wc(stdx::make_unique( + mongocxx::v_noabi::write_concern wc(bsoncxx::v_noabi::stdx::make_unique( libmongoc::write_concern_copy(libmongoc::client_get_write_concern(_get_impl().client_t)))); return wc; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp index b280d6ca89..792c140269 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp @@ -26,7 +26,7 @@ namespace v_noabi { using mongocxx::libbson::scoped_bson_t; client_encryption::client_encryption(options::client_encryption opts) - : _impl(stdx::make_unique(std::move(opts))) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique(std::move(opts))) {} client_encryption::~client_encryption() = default; client_encryption::client_encryption(client_encryption&&) noexcept = default; @@ -58,7 +58,7 @@ collection client_encryption::create_encrypted_collection( const bsoncxx::v_noabi::document::view& options, bsoncxx::v_noabi::document::value& out_options, const std::string& kms_provider, - const stdx::optional& masterkey) { + const bsoncxx::v_noabi::stdx::optional& masterkey) { auto& db_impl = db._get_impl(); return _impl->create_encrypted_collection( db, db_impl.database_t, coll_name, options, out_options, kms_provider, masterkey); @@ -74,7 +74,7 @@ result::delete_result client_encryption::delete_key( return _impl->delete_key(id); } -stdx::optional client_encryption::get_key( +bsoncxx::v_noabi::stdx::optional client_encryption::get_key( bsoncxx::v_noabi::types::bson_value::view_or_value id) { return _impl->get_key(id); } @@ -83,20 +83,20 @@ mongocxx::v_noabi::cursor client_encryption::get_keys() { return _impl->get_keys(); } -stdx::optional client_encryption::add_key_alt_name( - bsoncxx::v_noabi::types::bson_value::view_or_value id, - bsoncxx::v_noabi::string::view_or_value key_alt_name) { +bsoncxx::v_noabi::stdx::optional +client_encryption::add_key_alt_name(bsoncxx::v_noabi::types::bson_value::view_or_value id, + bsoncxx::v_noabi::string::view_or_value key_alt_name) { return _impl->add_key_alt_name(id, key_alt_name); } -stdx::optional client_encryption::get_key_by_alt_name( - bsoncxx::v_noabi::string::view_or_value key_alt_name) { +bsoncxx::v_noabi::stdx::optional +client_encryption::get_key_by_alt_name(bsoncxx::v_noabi::string::view_or_value key_alt_name) { return _impl->get_key_by_alt_name(key_alt_name); } -stdx::optional client_encryption::remove_key_alt_name( - bsoncxx::v_noabi::types::bson_value::view_or_value id, - bsoncxx::v_noabi::string::view_or_value key_alt_name) { +bsoncxx::v_noabi::stdx::optional +client_encryption::remove_key_alt_name(bsoncxx::v_noabi::types::bson_value::view_or_value id, + bsoncxx::v_noabi::string::view_or_value key_alt_name) { return _impl->remove_key_alt_name(id, key_alt_name); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp index 8c9a657324..e972b632c0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp @@ -27,7 +27,7 @@ namespace v_noabi { // Private constructors. client_session::client_session(const mongocxx::v_noabi::client* client, const mongocxx::v_noabi::options::client_session& options) - : _impl(stdx::make_unique(client, options)) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique(client, options)) {} client_session::client_session(client_session&&) noexcept = default; @@ -69,7 +69,7 @@ void client_session::advance_operation_time( } void client_session::start_transaction( - const stdx::optional& transaction_opts) { + const bsoncxx::v_noabi::stdx::optional& transaction_opts) { _impl->start_transaction(transaction_opts); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp index 0a9ce1876c..0d48b1e9f1 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp @@ -82,14 +82,14 @@ void destroy_fam_opts(mongoc_find_and_modify_opts_t* opts) { } template -mongocxx::v_noabi::stdx::optional find_and_modify( +bsoncxx::v_noabi::stdx::optional find_and_modify( mongoc_collection_t* collection_t, const mongoc_client_session_t* session_t, view_or_value filter, view_or_value* update, mongoc_find_and_modify_flags_t flags, bool bypass, - mongocxx::v_noabi::stdx::optional array_filters, + bsoncxx::v_noabi::stdx::optional array_filters, const T& options) { using unique_opts = std::unique_ptr>; @@ -191,7 +191,7 @@ mongocxx::v_noabi::stdx::optional find_and_mo const auto value = reply_view["value"]; if (!value || value.type() == bsoncxx::v_noabi::type::k_null) { - return mongocxx::v_noabi::stdx::optional{}; + return bsoncxx::v_noabi::stdx::optional{}; } return bsoncxx::v_noabi::document::value{reply_view["value"].get_document().view()}; @@ -213,7 +213,7 @@ collection::operator bool() const noexcept { return static_cast(_impl); } -stdx::string_view collection::name() const { +bsoncxx::v_noabi::stdx::string_view collection::name() const { return {get_collection_name(_get_impl().collection_t)}; } @@ -265,20 +265,20 @@ void collection::rename( collection::collection(const database& database, bsoncxx::v_noabi::string::view_or_value collection_name) - : _impl(stdx::make_unique( + : _impl(bsoncxx::v_noabi::stdx::make_unique( libmongoc::database_get_collection(database._get_impl().database_t, collection_name.terminated().data()), database.name(), database._get_impl().client_impl)) {} collection::collection(const database& database, void* collection) - : _impl(stdx::make_unique(static_cast(collection), - database.name(), - database._get_impl().client_impl)) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique(static_cast(collection), + database.name(), + database._get_impl().client_impl)) {} collection::collection(const collection& c) { if (c) { - _impl = stdx::make_unique(c._get_impl()); + _impl = bsoncxx::v_noabi::stdx::make_unique(c._get_impl()); } } @@ -286,7 +286,7 @@ collection& collection::operator=(const collection& c) { if (!c) { _impl.reset(); } else if (!*this) { - _impl = stdx::make_unique(c._get_impl()); + _impl = bsoncxx::v_noabi::stdx::make_unique(c._get_impl()); } else { *_impl = c._get_impl(); } @@ -444,7 +444,7 @@ cursor collection::find(const client_session& session, return _find(&session, std::move(filter), options); } -stdx::optional collection::_find_one( +bsoncxx::v_noabi::stdx::optional collection::_find_one( const client_session* session, view_or_value filter, const options::find& options) { options::find copy(options); copy.limit(1); @@ -452,18 +452,18 @@ stdx::optional collection::_find_one( session ? find(*session, std::move(filter), copy) : find(std::move(filter), copy); cursor::iterator it = cursor.begin(); if (it == cursor.end()) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional( + return bsoncxx::v_noabi::stdx::optional( bsoncxx::v_noabi::document::value{*it}); } -stdx::optional collection::find_one( +bsoncxx::v_noabi::stdx::optional collection::find_one( view_or_value filter, const options::find& options) { return _find_one(nullptr, std::move(filter), options); } -stdx::optional collection::find_one( +bsoncxx::v_noabi::stdx::optional collection::find_one( const client_session& session, view_or_value filter, const options::find& options) { return _find_one(&session, std::move(filter), options); } @@ -506,9 +506,8 @@ cursor collection::aggregate(const client_session& session, return _aggregate(&session, pipeline, options); } -stdx::optional collection::_insert_one(const client_session* session, - view_or_value document, - const options::insert& options) { +bsoncxx::v_noabi::stdx::optional collection::_insert_one( + const client_session* session, view_or_value document, const options::insert& options) { // TODO: We should consider making it possible to convert from an options::insert into // an options::bulk_write at the type level, removing the need to re-iterate this code // many times here and below. @@ -545,42 +544,44 @@ stdx::optional collection::_insert_one(const client_session* auto result = bulk_op.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional( + return bsoncxx::v_noabi::stdx::optional( result::insert_one(std::move(result.value()), oid.get_value())); } -stdx::optional collection::insert_one(view_or_value document, - const options::insert& options) { +bsoncxx::v_noabi::stdx::optional collection::insert_one( + view_or_value document, const options::insert& options) { return _insert_one(nullptr, document, options); } -stdx::optional collection::insert_one(const client_session& session, - view_or_value document, - const options::insert& options) { +bsoncxx::v_noabi::stdx::optional collection::insert_one( + const client_session& session, view_or_value document, const options::insert& options) { return _insert_one(&session, document, options); } -stdx::optional collection::_replace_one(const client_session* session, - const options::bulk_write& bulk_opts, - const model::replace_one& replace_op) { +bsoncxx::v_noabi::stdx::optional collection::_replace_one( + const client_session* session, + const options::bulk_write& bulk_opts, + const model::replace_one& replace_op) { auto bulk_op = session ? create_bulk_write(*session, bulk_opts) : create_bulk_write(bulk_opts); bulk_op.append(replace_op); auto result = bulk_op.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional(result::replace_one(std::move(result.value()))); + return bsoncxx::v_noabi::stdx::optional( + result::replace_one(std::move(result.value()))); } -stdx::optional collection::_replace_one(const client_session* session, - view_or_value filter, - view_or_value replacement, - const options::replace& options) { +bsoncxx::v_noabi::stdx::optional collection::_replace_one( + const client_session* session, + view_or_value filter, + view_or_value replacement, + const options::replace& options) { options::bulk_write bulk_opts; if (const auto& bdv = options.bypass_document_validation()) { @@ -616,23 +617,24 @@ stdx::optional collection::_replace_one(const client_sessio return _replace_one(session, bulk_opts, replace_op); } -stdx::optional collection::replace_one(view_or_value filter, - view_or_value replacement, - const options::replace& options) { +bsoncxx::v_noabi::stdx::optional collection::replace_one( + view_or_value filter, view_or_value replacement, const options::replace& options) { return _replace_one(nullptr, std::move(filter), replacement, options); } -stdx::optional collection::replace_one(const client_session& session, - view_or_value filter, - view_or_value replacement, - const options::replace& options) { +bsoncxx::v_noabi::stdx::optional collection::replace_one( + const client_session& session, + view_or_value filter, + view_or_value replacement, + const options::replace& options) { return _replace_one(&session, std::move(filter), replacement, options); } -stdx::optional collection::_update_many(const client_session* session, - view_or_value filter, - view_or_value update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::_update_many( + const client_session* session, + view_or_value filter, + view_or_value update, + const options::update& options) { options::bulk_write bulk_opts; if (const auto& bdv = options.bypass_document_validation()) { @@ -675,59 +677,61 @@ stdx::optional collection::_update_many(const client_session* se auto result = bulk_op.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional(result::update(std::move(result.value()))); + return bsoncxx::v_noabi::stdx::optional( + result::update(std::move(result.value()))); } -stdx::optional collection::update_many(view_or_value filter, - view_or_value update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_many( + view_or_value filter, view_or_value update, const options::update& options) { return _update_many(nullptr, std::move(filter), update, options); } -stdx::optional collection::update_many(view_or_value filter, - const pipeline& update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_many( + view_or_value filter, const pipeline& update, const options::update& options) { return _update_many( nullptr, std::move(filter), bsoncxx::v_noabi::document::view(update.view_array()), options); } -stdx::optional collection::update_many(view_or_value filter, - std::initializer_list<_empty_doc_tag>, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_many( + view_or_value filter, std::initializer_list<_empty_doc_tag>, const options::update& options) { return _update_many(nullptr, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::update_many(const client_session& session, - view_or_value filter, - view_or_value update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_many( + const client_session& session, + view_or_value filter, + view_or_value update, + const options::update& options) { return _update_many(&session, std::move(filter), update, options); } -stdx::optional collection::update_many(const client_session& session, - view_or_value filter, - const pipeline& update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_many( + const client_session& session, + view_or_value filter, + const pipeline& update, + const options::update& options) { return _update_many(&session, std::move(filter), bsoncxx::v_noabi::document::view(update.view_array()), options); } -stdx::optional collection::update_many(const client_session& session, - view_or_value filter, - std::initializer_list<_empty_doc_tag>, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_many( + const client_session& session, + view_or_value filter, + std::initializer_list<_empty_doc_tag>, + const options::update& options) { return _update_many(&session, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::_update_one(const client_session* session, - view_or_value filter, - view_or_value update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::_update_one( + const client_session* session, + view_or_value filter, + view_or_value update, + const options::update& options) { options::bulk_write bulk_opts; if (const auto& bdv = options.bypass_document_validation()) { @@ -770,56 +774,57 @@ stdx::optional collection::_update_one(const client_session* ses auto result = bulk_op.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional(result::update(std::move(result.value()))); + return bsoncxx::v_noabi::stdx::optional( + result::update(std::move(result.value()))); } -stdx::optional collection::update_one(view_or_value filter, - view_or_value update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_one( + view_or_value filter, view_or_value update, const options::update& options) { return _update_one(nullptr, std::move(filter), update, options); } -stdx::optional collection::update_one(view_or_value filter, - const pipeline& update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_one( + view_or_value filter, const pipeline& update, const options::update& options) { return _update_one( nullptr, std::move(filter), bsoncxx::v_noabi::document::view(update.view_array()), options); } -stdx::optional collection::update_one(view_or_value filter, - std::initializer_list<_empty_doc_tag>, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_one( + view_or_value filter, std::initializer_list<_empty_doc_tag>, const options::update& options) { return _update_one(nullptr, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::update_one(const client_session& session, - view_or_value filter, - view_or_value update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_one( + const client_session& session, + view_or_value filter, + view_or_value update, + const options::update& options) { return _update_one(&session, std::move(filter), update, options); } -stdx::optional collection::update_one(const client_session& session, - view_or_value filter, - const pipeline& update, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_one( + const client_session& session, + view_or_value filter, + const pipeline& update, + const options::update& options) { return _update_one(&session, std::move(filter), bsoncxx::v_noabi::document::view(update.view_array()), options); } -stdx::optional collection::update_one(const client_session& session, - view_or_value filter, - std::initializer_list<_empty_doc_tag>, - const options::update& options) { +bsoncxx::v_noabi::stdx::optional collection::update_one( + const client_session& session, + view_or_value filter, + std::initializer_list<_empty_doc_tag>, + const options::update& options) { return _update_one(&session, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::_delete_many( +bsoncxx::v_noabi::stdx::optional collection::_delete_many( const client_session* session, view_or_value filter, const options::delete_options& options) { options::bulk_write bulk_opts; @@ -851,23 +856,24 @@ stdx::optional collection::_delete_many( auto result = bulk_op.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional(result::delete_result(std::move(result.value()))); + return bsoncxx::v_noabi::stdx::optional( + result::delete_result(std::move(result.value()))); } -stdx::optional collection::delete_many( +bsoncxx::v_noabi::stdx::optional collection::delete_many( view_or_value filter, const options::delete_options& options) { return _delete_many(nullptr, std::move(filter), options); } -stdx::optional collection::delete_many( +bsoncxx::v_noabi::stdx::optional collection::delete_many( const client_session& session, view_or_value filter, const options::delete_options& options) { return _delete_many(&session, std::move(filter), options); } -stdx::optional collection::_delete_one( +bsoncxx::v_noabi::stdx::optional collection::_delete_one( const client_session* session, view_or_value filter, const options::delete_options& options) { options::bulk_write bulk_opts; @@ -899,27 +905,28 @@ stdx::optional collection::_delete_one( auto result = bulk_op.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } - return stdx::optional(result::delete_result(std::move(result.value()))); + return bsoncxx::v_noabi::stdx::optional( + result::delete_result(std::move(result.value()))); } -stdx::optional collection::delete_one( +bsoncxx::v_noabi::stdx::optional collection::delete_one( view_or_value filter, const options::delete_options& options) { return _delete_one(nullptr, std::move(filter), options); } -stdx::optional collection::delete_one( +bsoncxx::v_noabi::stdx::optional collection::delete_one( const client_session& session, view_or_value filter, const options::delete_options& options) { return _delete_one(&session, std::move(filter), options); } -stdx::optional collection::_find_one_and_replace( - const client_session* session, - view_or_value filter, - view_or_value replacement, - const options::find_one_and_replace& options) { +bsoncxx::v_noabi::stdx::optional +collection::_find_one_and_replace(const client_session* session, + view_or_value filter, + view_or_value replacement, + const options::find_one_and_replace& options) { mongoc_find_and_modify_flags_t flags = MONGOC_FIND_AND_MODIFY_NONE; if (options.upsert().value_or(false)) { flags = static_cast(flags | MONGOC_FIND_AND_MODIFY_UPSERT); @@ -936,28 +943,30 @@ stdx::optional collection::_find_one_and_repl &replacement, flags, options.bypass_document_validation().value_or(false), - stdx::nullopt, + bsoncxx::v_noabi::stdx::nullopt, options); } -stdx::optional collection::find_one_and_replace( - view_or_value filter, view_or_value replacement, const options::find_one_and_replace& options) { +bsoncxx::v_noabi::stdx::optional +collection::find_one_and_replace(view_or_value filter, + view_or_value replacement, + const options::find_one_and_replace& options) { return _find_one_and_replace(nullptr, std::move(filter), replacement, options); } -stdx::optional collection::find_one_and_replace( - const client_session& session, - view_or_value filter, - view_or_value replacement, - const options::find_one_and_replace& options) { +bsoncxx::v_noabi::stdx::optional +collection::find_one_and_replace(const client_session& session, + view_or_value filter, + view_or_value replacement, + const options::find_one_and_replace& options) { return _find_one_and_replace(&session, std::move(filter), replacement, options); } -stdx::optional collection::_find_one_and_update( - const client_session* session, - view_or_value filter, - view_or_value update, - const options::find_one_and_update& options) { +bsoncxx::v_noabi::stdx::optional +collection::_find_one_and_update(const client_session* session, + view_or_value filter, + view_or_value update, + const options::find_one_and_update& options) { mongoc_find_and_modify_flags_t flags = MONGOC_FIND_AND_MODIFY_NONE; if (options.upsert().value_or(false)) { flags = static_cast(flags | MONGOC_FIND_AND_MODIFY_UPSERT); @@ -978,18 +987,18 @@ stdx::optional collection::_find_one_and_upda options); } -stdx::optional collection::find_one_and_update( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_update( view_or_value filter, view_or_value update, const options::find_one_and_update& options) { return _find_one_and_update(nullptr, std::move(filter), update, options); } -stdx::optional collection::find_one_and_update( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_update( view_or_value filter, const pipeline& update, const options::find_one_and_update& options) { return _find_one_and_update( nullptr, std::move(filter), bsoncxx::v_noabi::document::view(update.view_array()), options); } -stdx::optional collection::find_one_and_update( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_update( view_or_value filter, std::initializer_list<_empty_doc_tag>, const options::find_one_and_update& options) { @@ -997,7 +1006,7 @@ stdx::optional collection::find_one_and_updat nullptr, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::find_one_and_update( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_update( const client_session& session, view_or_value filter, view_or_value update, @@ -1005,7 +1014,7 @@ stdx::optional collection::find_one_and_updat return _find_one_and_update(&session, std::move(filter), update, options); } -stdx::optional collection::find_one_and_update( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_update( const client_session& session, view_or_value filter, const pipeline& update, @@ -1016,7 +1025,7 @@ stdx::optional collection::find_one_and_updat options); } -stdx::optional collection::find_one_and_update( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_update( const client_session& session, view_or_value filter, std::initializer_list<_empty_doc_tag>, @@ -1025,26 +1034,26 @@ stdx::optional collection::find_one_and_updat &session, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::_find_one_and_delete( - const client_session* session, - view_or_value filter, - const options::find_one_and_delete& options) { +bsoncxx::v_noabi::stdx::optional +collection::_find_one_and_delete(const client_session* session, + view_or_value filter, + const options::find_one_and_delete& options) { return find_and_modify(_get_impl().collection_t, session ? session->_get_impl().get_session_t() : nullptr, filter, nullptr, MONGOC_FIND_AND_MODIFY_REMOVE, false, - stdx::nullopt, + bsoncxx::v_noabi::stdx::nullopt, options); } -stdx::optional collection::find_one_and_delete( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_delete( view_or_value filter, const options::find_one_and_delete& options) { return _find_one_and_delete(nullptr, std::move(filter), options); } -stdx::optional collection::find_one_and_delete( +bsoncxx::v_noabi::stdx::optional collection::find_one_and_delete( const client_session& session, view_or_value filter, const options::find_one_and_delete& options) { @@ -1295,7 +1304,7 @@ cursor collection::list_indexes(const client_session& session) const { } void collection::_drop(const client_session* session, - const stdx::optional& wc, + const bsoncxx::v_noabi::stdx::optional& wc, bsoncxx::v_noabi::document::view_or_value collection_options) { bson_error_t error; @@ -1321,18 +1330,19 @@ void collection::_drop(const client_session* session, // collection. We check for this failure using 'code', but we fall back to checking 'message' // for old server versions (3.0 and earlier) that do not send a code with the command response. if (!result && !(error.code == ::MONGOC_ERROR_COLLECTION_DOES_NOT_EXIST || - stdx::string_view{error.message} == stdx::string_view{"ns not found"})) { + bsoncxx::v_noabi::stdx::string_view{error.message} == + bsoncxx::v_noabi::stdx::string_view{"ns not found"})) { throw_exception(error); } } -void collection::drop(const stdx::optional& wc, +void collection::drop(const bsoncxx::v_noabi::stdx::optional& wc, bsoncxx::v_noabi::document::view_or_value collection_options) { return _drop(nullptr, wc, collection_options); } void collection::drop(const client_session& session, - const stdx::optional& wc, + const bsoncxx::v_noabi::stdx::optional& wc, bsoncxx::v_noabi::document::view_or_value collection_options) { return _drop(&session, wc, collection_options); } @@ -1343,7 +1353,8 @@ void collection::read_concern(mongocxx::v_noabi::read_concern rc) { mongocxx::v_noabi::read_concern collection::read_concern() const { auto rc = libmongoc::collection_get_read_concern(_get_impl().collection_t); - return {stdx::make_unique(libmongoc::read_concern_copy(rc))}; + return { + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))}; } void collection::read_preference(mongocxx::v_noabi::read_preference rp) { @@ -1352,7 +1363,7 @@ void collection::read_preference(mongocxx::v_noabi::read_preference rp) { mongocxx::v_noabi::read_preference collection::read_preference() const { mongocxx::v_noabi::read_preference rp( - stdx::make_unique(libmongoc::read_prefs_copy( + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_copy( libmongoc::collection_get_read_prefs(_get_impl().collection_t)))); return rp; } @@ -1363,7 +1374,7 @@ void collection::write_concern(mongocxx::v_noabi::write_concern wc) { mongocxx::v_noabi::write_concern collection::write_concern() const { mongocxx::v_noabi::write_concern wc( - stdx::make_unique(libmongoc::write_concern_copy( + bsoncxx::v_noabi::stdx::make_unique(libmongoc::write_concern_copy( libmongoc::collection_get_write_concern(_get_impl().collection_t)))); return wc; } @@ -1458,11 +1469,11 @@ void collection::_insert_many_doc_handler(mongocxx::v_noabi::bulk_write& writes, inserted_ids.append(id_doc.view()); } -stdx::optional collection::_exec_insert_many( +bsoncxx::v_noabi::stdx::optional collection::_exec_insert_many( mongocxx::v_noabi::bulk_write& writes, bsoncxx::v_noabi::builder::basic::array& inserted_ids) { auto result = writes.execute(); if (!result) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } return result::insert_many{std::move(result.value()), inserted_ids.extract()}; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp index 5b509958ac..ee4195b563 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp @@ -27,7 +27,8 @@ namespace mongocxx { namespace v_noabi { cursor::cursor(void* cursor_ptr, bsoncxx::v_noabi::stdx::optional cursor_type) - : _impl(stdx::make_unique(static_cast(cursor_ptr), cursor_type)) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique(static_cast(cursor_ptr), + cursor_type)) {} cursor::cursor(cursor&&) noexcept = default; cursor& cursor::operator=(cursor&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp index 121cdfa087..ce603fbeb7 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp @@ -87,14 +87,14 @@ database::~database() = default; database::database(const mongocxx::v_noabi::client& client, bsoncxx::v_noabi::string::view_or_value name) - : _impl(stdx::make_unique( + : _impl(bsoncxx::v_noabi::stdx::make_unique( libmongoc::client_get_database(client._get_impl().client_t, name.terminated().data()), &client._get_impl(), name.terminated().data())) {} database::database(const database& d) { if (d) { - _impl = stdx::make_unique(d._get_impl()); + _impl = bsoncxx::v_noabi::stdx::make_unique(d._get_impl()); } } @@ -102,7 +102,7 @@ database& database::operator=(const database& d) { if (!d) { _impl.reset(); } else if (!*this) { - _impl = stdx::make_unique(d._get_impl()); + _impl = bsoncxx::v_noabi::stdx::make_unique(d._get_impl()); } else { *_impl = d._get_impl(); } @@ -212,7 +212,7 @@ std::vector database::list_collection_names( return _list_collection_names(&session, filter); } -stdx::string_view database::name() const { +bsoncxx::v_noabi::stdx::string_view database::name() const { return _get_impl().name; } @@ -277,9 +277,9 @@ bsoncxx::v_noabi::document::value database::run_command( collection database::_create_collection( const client_session* session, - stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options, - const stdx::optional& write_concern) { + const bsoncxx::v_noabi::stdx::optional& write_concern) { bsoncxx::v_noabi::builder::basic::document options_builder; bson_error_t error; @@ -312,7 +312,7 @@ collection database::_create_collection_deprecated( const client_session* session, bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern) { + const bsoncxx::v_noabi::stdx::optional& write_concern) { bsoncxx::v_noabi::builder::basic::document options_builder; if (collection_options.capped()) { @@ -383,24 +383,24 @@ collection database::_create_collection_deprecated( } mongocxx::v_noabi::collection database::create_collection( - stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options, - const stdx::optional& write_concern) { + const bsoncxx::v_noabi::stdx::optional& write_concern) { return _create_collection(nullptr, name, collection_options, write_concern); } mongocxx::v_noabi::collection database::create_collection( const client_session& session, - stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options, - const stdx::optional& write_concern) { + const bsoncxx::v_noabi::stdx::optional& write_concern) { return _create_collection(&session, name, collection_options, write_concern); } mongocxx::v_noabi::collection database::create_collection_deprecated( bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern) { + const bsoncxx::v_noabi::stdx::optional& write_concern) { return _create_collection_deprecated(nullptr, name, collection_options, write_concern); } @@ -408,7 +408,7 @@ mongocxx::v_noabi::collection database::create_collection_deprecated( const client_session& session, bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern) { + const bsoncxx::v_noabi::stdx::optional& write_concern) { return _create_collection_deprecated(&session, name, collection_options, write_concern); } @@ -451,7 +451,8 @@ void database::read_concern(mongocxx::v_noabi::read_concern rc) { mongocxx::v_noabi::read_concern database::read_concern() const { auto rc = libmongoc::database_get_read_concern(_get_impl().database_t); - return {stdx::make_unique(libmongoc::read_concern_copy(rc))}; + return { + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))}; } void database::read_preference(mongocxx::v_noabi::read_preference rp) { @@ -470,8 +471,9 @@ bool database::has_collection(bsoncxx::v_noabi::string::view_or_value name) cons } mongocxx::v_noabi::read_preference database::read_preference() const { - mongocxx::v_noabi::read_preference rp(stdx::make_unique( - libmongoc::read_prefs_copy(libmongoc::database_get_read_prefs(_get_impl().database_t)))); + mongocxx::v_noabi::read_preference rp( + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_copy( + libmongoc::database_get_read_prefs(_get_impl().database_t)))); return rp; } @@ -481,7 +483,7 @@ void database::write_concern(mongocxx::v_noabi::write_concern wc) { mongocxx::v_noabi::write_concern database::write_concern() const { mongocxx::v_noabi::write_concern wc( - stdx::make_unique(libmongoc::write_concern_copy( + bsoncxx::v_noabi::stdx::make_unique(libmongoc::write_concern_copy( libmongoc::database_get_write_concern(_get_impl().database_t)))); return wc; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/operation_exception.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/operation_exception.cpp index f248dbacde..e66490dbed 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/operation_exception.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/operation_exception.cpp @@ -33,16 +33,17 @@ operation_exception::operation_exception(std::error_code ec, std::string what_arg) : exception(ec, what_arg), _raw_server_error{std::move(raw_server_error)} {} -const stdx::optional& operation_exception::raw_server_error() - const { +const bsoncxx::v_noabi::stdx::optional& +operation_exception::raw_server_error() const { return _raw_server_error; } -stdx::optional& operation_exception::raw_server_error() { +bsoncxx::v_noabi::stdx::optional& +operation_exception::raw_server_error() { return _raw_server_error; } -bool operation_exception::has_error_label(stdx::string_view label) const { +bool operation_exception::has_error_label(bsoncxx::v_noabi::stdx::string_view label) const { if (!_raw_server_error) { return false; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp index 68f974124d..07e3bf53b4 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include @@ -133,7 +132,7 @@ bucket::bucket(const database& db, const options::gridfs::bucket& options) { collection chunks = db[bucket_name + ".chunks"]; collection files = db[bucket_name + ".files"]; - _impl = stdx::make_unique( + _impl = bsoncxx::v_noabi::stdx::make_unique( std::move(bucket_name), default_chunk_size_bytes, std::move(chunks), std::move(files)); if (auto read_concern = options.read_concern()) { @@ -163,7 +162,7 @@ bucket::operator bool() const noexcept { bucket::bucket(const bucket& b) { if (b) { - _impl = stdx::make_unique(b._get_impl()); + _impl = bsoncxx::v_noabi::stdx::make_unique(b._get_impl()); } } @@ -171,21 +170,21 @@ bucket& bucket::operator=(const bucket& b) { if (!b) { _impl.reset(); } else if (!*this) { - _impl = stdx::make_unique(b._get_impl()); + _impl = bsoncxx::v_noabi::stdx::make_unique(b._get_impl()); } else { *_impl = b._get_impl(); } return *this; } -uploader bucket::open_upload_stream(stdx::string_view filename, +uploader bucket::open_upload_stream(bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options) { auto id = bsoncxx::v_noabi::types::bson_value::view{bsoncxx::v_noabi::types::b_oid{}}; return open_upload_stream_with_id(id, filename, options); } uploader bucket::open_upload_stream(const client_session& session, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options) { auto id = bsoncxx::v_noabi::types::bson_value::view{bsoncxx::v_noabi::types::b_oid{}}; return open_upload_stream_with_id(session, id, filename, options); @@ -193,7 +192,7 @@ uploader bucket::open_upload_stream(const client_session& session, uploader bucket::_open_upload_stream_with_id(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options) { std::int32_t chunk_size_bytes = _get_impl().default_chunk_size_bytes; @@ -219,19 +218,19 @@ uploader bucket::_open_upload_stream_with_id(const client_session* session, } uploader bucket::open_upload_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options) { return _open_upload_stream_with_id(nullptr, id, filename, options); } uploader bucket::open_upload_stream_with_id(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, const options::gridfs::upload& options) { return _open_upload_stream_with_id(&session, id, filename, options); } -result::gridfs::upload bucket::upload_from_stream(stdx::string_view filename, +result::gridfs::upload bucket::upload_from_stream(bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { auto id = bsoncxx::v_noabi::types::bson_value::view{bsoncxx::v_noabi::types::b_oid{}}; @@ -240,7 +239,7 @@ result::gridfs::upload bucket::upload_from_stream(stdx::string_view filename, } result::gridfs::upload bucket::upload_from_stream(const client_session& session, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { auto id = bsoncxx::v_noabi::types::bson_value::view{bsoncxx::v_noabi::types::b_oid{}}; @@ -250,13 +249,13 @@ result::gridfs::upload bucket::upload_from_stream(const client_session& session, void bucket::_upload_from_stream_with_id(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { uploader upload_stream = _open_upload_stream_with_id(session, id, filename, options); std::int32_t chunk_size = upload_stream.chunk_size(); std::unique_ptr buffer = - stdx::make_unique(static_cast(chunk_size)); + bsoncxx::v_noabi::stdx::make_unique(static_cast(chunk_size)); do { source->read(reinterpret_cast(buffer.get()), @@ -275,7 +274,7 @@ void bucket::_upload_from_stream_with_id(const client_session* session, } void bucket::upload_from_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { return _upload_from_stream_with_id(nullptr, id, filename, source, options); @@ -283,7 +282,7 @@ void bucket::upload_from_stream_with_id(bsoncxx::v_noabi::types::bson_value::vie void bucket::upload_from_stream_with_id(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { return _upload_from_stream_with_id(&session, id, filename, source, options); @@ -291,8 +290,8 @@ void bucket::upload_from_stream_with_id(const client_session& session, downloader bucket::_open_download_stream(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, - stdx::optional start, - stdx::optional end) { + bsoncxx::v_noabi::stdx::optional start, + bsoncxx::v_noabi::stdx::optional end) { using namespace bsoncxx; builder::basic::document files_filter; @@ -321,7 +320,8 @@ downloader bucket::_open_download_stream(const client_session* session, if ((length.type() == type::k_int64 && !length.get_int64().value) || (length.type() == type::k_int32 && !length.get_int32().value)) { - return downloader{stdx::nullopt, start_offset, chunk_size, file_len, *files_doc}; + return downloader{ + bsoncxx::v_noabi::stdx::nullopt, start_offset, chunk_size, file_len, *files_doc}; } builder::basic::document chunks_filter; @@ -389,19 +389,21 @@ downloader bucket::_open_download_stream(const client_session* session, } downloader bucket::open_download_stream(bsoncxx::v_noabi::types::bson_value::view id) { - return _open_download_stream(nullptr, id, stdx::nullopt, stdx::nullopt); + return _open_download_stream( + nullptr, id, bsoncxx::v_noabi::stdx::nullopt, bsoncxx::v_noabi::stdx::nullopt); } downloader bucket::open_download_stream(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id) { - return _open_download_stream(&session, id, stdx::nullopt, stdx::nullopt); + return _open_download_stream( + &session, id, bsoncxx::v_noabi::stdx::nullopt, bsoncxx::v_noabi::stdx::nullopt); } void bucket::_download_to_stream(const client_session* session, bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, - stdx::optional start, - stdx::optional end) { + bsoncxx::v_noabi::stdx::optional start, + bsoncxx::v_noabi::stdx::optional end) { downloader download_stream = _open_download_stream(session, id, start, end); std::size_t chunk_size; @@ -422,7 +424,7 @@ void bucket::_download_to_stream(const client_session* session, } auto bytes_expected = *end - *start; std::unique_ptr buffer = - stdx::make_unique(static_cast(chunk_size)); + bsoncxx::v_noabi::stdx::make_unique(static_cast(chunk_size)); while (bytes_expected > 0) { const std::size_t bytes_read = download_stream.read( @@ -437,7 +439,8 @@ void bucket::_download_to_stream(const client_session* session, void bucket::download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination) { - _download_to_stream(nullptr, id, destination, stdx::nullopt, stdx::nullopt); + _download_to_stream( + nullptr, id, destination, bsoncxx::v_noabi::stdx::nullopt, bsoncxx::v_noabi::stdx::nullopt); } void bucket::download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, @@ -450,7 +453,11 @@ void bucket::download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, void bucket::download_to_stream(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination) { - _download_to_stream(&session, id, destination, stdx::nullopt, stdx::nullopt); + _download_to_stream(&session, + id, + destination, + bsoncxx::v_noabi::stdx::nullopt, + bsoncxx::v_noabi::stdx::nullopt); } void bucket::download_to_stream(const client_session& session, @@ -507,7 +514,7 @@ cursor bucket::find(const client_session& session, return _get_impl().files.find(session, filter, options); } -stdx::string_view bucket::bucket_name() const { +bsoncxx::v_noabi::stdx::string_view bucket::bucket_name() const { return _get_impl().bucket_name; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp index 8c7d97c8c5..f0bbc4c887 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp @@ -32,12 +32,12 @@ namespace mongocxx { namespace v_noabi { namespace gridfs { -downloader::downloader(stdx::optional chunks, +downloader::downloader(bsoncxx::v_noabi::stdx::optional chunks, chunks_and_bytes_offset start, std::int32_t chunk_size, std::int64_t file_len, bsoncxx::v_noabi::document::value files_doc) - : _impl{stdx::make_unique( + : _impl{bsoncxx::v_noabi::stdx::make_unique( std::move(chunks), start, chunk_size, file_len, std::move(files_doc))} {} downloader::downloader() noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/downloader.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/downloader.hh index b18cf0a3a4..f7fc79cd2f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/downloader.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/downloader.hh @@ -29,7 +29,7 @@ namespace gridfs { class downloader::impl { public: - impl(stdx::optional chunks_param, + impl(bsoncxx::v_noabi::stdx::optional chunks_param, chunks_and_bytes_offset start_param, std::int32_t chunk_size_param, std::int64_t file_len_param, @@ -39,10 +39,12 @@ class downloader::impl { chunk_buffer_offset{0}, chunk_buffer_ptr{nullptr}, start{start_param}, - chunks{chunks_param ? std::move(chunks_param) : stdx::nullopt}, - chunks_curr{chunks ? stdx::make_optional(chunks->begin()) - : stdx::nullopt}, - chunks_end{chunks ? stdx::make_optional(chunks->end()) : stdx::nullopt}, + chunks{chunks_param ? std::move(chunks_param) : bsoncxx::v_noabi::stdx::nullopt}, + chunks_curr{chunks + ? bsoncxx::v_noabi::stdx::make_optional(chunks->begin()) + : bsoncxx::v_noabi::stdx::nullopt}, + chunks_end{chunks ? bsoncxx::v_noabi::stdx::make_optional(chunks->end()) + : bsoncxx::v_noabi::stdx::nullopt}, chunks_seen{0}, chunk_size{chunk_size_param}, closed{false}, @@ -83,15 +85,15 @@ class downloader::impl { // A cursor iterating over the chunks documents being read. In the case of a zero-length file, // this member does not have a value. - stdx::optional chunks; + bsoncxx::v_noabi::stdx::optional chunks; // An iterator to the current chunk document. In the case of a zero-length file, this member // does not have a value. - stdx::optional chunks_curr; + bsoncxx::v_noabi::stdx::optional chunks_curr; // An iterator to the end of `chunks`. In the case of a zero-length file, this member does not // have a value. - stdx::optional chunks_end; + bsoncxx::v_noabi::stdx::optional chunks_end; // The number of chunks already downloaded from the server. std::int32_t chunks_seen; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh index 92d4c85c4a..f3b4d6f5b0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh @@ -32,13 +32,14 @@ class uploader::impl { public: impl(const client_session* session, result::gridfs::upload result, - stdx::string_view filename, + bsoncxx::v_noabi::stdx::string_view filename, collection files, collection chunks, std::int32_t chunk_size, - stdx::optional metadata) + bsoncxx::v_noabi::stdx::optional metadata) : session{session}, - buffer{stdx::make_unique(static_cast(chunk_size))}, + buffer{ + bsoncxx::v_noabi::stdx::make_unique(static_cast(chunk_size))}, buffer_off{0}, chunks{std::move(chunks)}, chunk_size{chunk_size}, @@ -80,7 +81,7 @@ class uploader::impl { collection files; // User-specified metadata for the file. - stdx::optional metadata; + bsoncxx::v_noabi::stdx::optional metadata; // Contains the id of the file being written. result::gridfs::upload result; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp index 5d09979b5e..0abdf5040a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp @@ -43,23 +43,24 @@ namespace mongocxx { namespace v_noabi { namespace gridfs { -uploader::uploader(const client_session* session, - bsoncxx::v_noabi::types::bson_value::view id, - stdx::string_view filename, - collection files, - collection chunks, - std::int32_t chunk_size, - stdx::optional metadata) - : _impl{stdx::make_unique(session, - id, - filename, - files, - chunks, - chunk_size, - metadata - ? stdx::make_optional( - bsoncxx::v_noabi::document::value{metadata->view()}) - : stdx::nullopt)} {} +uploader::uploader( + const client_session* session, + bsoncxx::v_noabi::types::bson_value::view id, + bsoncxx::v_noabi::stdx::string_view filename, + collection files, + collection chunks, + std::int32_t chunk_size, + bsoncxx::v_noabi::stdx::optional metadata) + : _impl{bsoncxx::v_noabi::stdx::make_unique( + session, + id, + filename, + files, + chunks, + chunk_size, + metadata ? bsoncxx::v_noabi::stdx::make_optional( + bsoncxx::v_noabi::document::value{metadata->view()}) + : bsoncxx::v_noabi::stdx::nullopt)} {} uploader::uploader() noexcept = default; uploader::uploader(uploader&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp index dccab80bc2..5566e873e3 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp @@ -27,8 +27,8 @@ namespace mongocxx { namespace v_noabi { index_view::index_view(void* coll, void* client) - : _impl{stdx::make_unique(static_cast(coll), - static_cast(client))} {} + : _impl{bsoncxx::v_noabi::stdx::make_unique(static_cast(coll), + static_cast(client))} {} index_view::index_view(index_view&&) noexcept = default; index_view& index_view::operator=(index_view&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp index 6591b2d203..ba4abb73a6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp @@ -64,8 +64,8 @@ void user_log_handler(::mongoc_log_level_t mongoc_log_level, const char* message, void* user_data) { (*static_cast(user_data))(convert_log_level(mongoc_log_level), - stdx::string_view{log_domain}, - stdx::string_view{message}); + bsoncxx::v_noabi::stdx::string_view{log_domain}, + bsoncxx::v_noabi::stdx::string_view{message}); } // A region of memory that acts as a sentintel value indicating that an instance object is being @@ -145,7 +145,7 @@ instance::instance(std::unique_ptr logger) { throw logic_error{error_code::k_cannot_recreate_instance}; } - _impl = stdx::make_unique(std::move(logger)); + _impl = bsoncxx::v_noabi::stdx::make_unique(std::move(logger)); } instance::instance(instance&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp index 762ad1a9c1..46257a8dcc 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp @@ -19,7 +19,7 @@ namespace mongocxx { namespace v_noabi { -stdx::string_view to_string(log_level level) { +bsoncxx::v_noabi::stdx::string_view to_string(log_level level) { switch (level) { case log_level::k_error: return "error"; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_many.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_many.cpp index 077c3252e7..88dcb41242 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_many.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_many.cpp @@ -37,11 +37,12 @@ delete_many& delete_many::hint(mongocxx::v_noabi::hint index_hint) { return *this; } -const stdx::optional& delete_many::hint() const { +const bsoncxx::v_noabi::stdx::optional& delete_many::hint() const { return _hint; } -const stdx::optional& delete_many::collation() const { +const bsoncxx::v_noabi::stdx::optional& +delete_many::collation() const { return _collation; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_one.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_one.cpp index 0bef624918..e7c2bcceeb 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_one.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/delete_one.cpp @@ -32,7 +32,8 @@ delete_one& delete_one::collation(bsoncxx::v_noabi::document::view_or_value coll return *this; } -const stdx::optional& delete_one::collation() const { +const bsoncxx::v_noabi::stdx::optional& +delete_one::collation() const { return _collation; } @@ -41,7 +42,7 @@ delete_one& delete_one::hint(mongocxx::v_noabi::hint index_hint) { return *this; } -const stdx::optional& delete_one::hint() const { +const bsoncxx::v_noabi::stdx::optional& delete_one::hint() const { return _hint; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/replace_one.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/replace_one.cpp index 8da78e1949..00651316d0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/replace_one.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/replace_one.cpp @@ -37,7 +37,8 @@ replace_one& replace_one::collation(bsoncxx::v_noabi::document::view_or_value co return *this; } -const stdx::optional& replace_one::collation() const { +const bsoncxx::v_noabi::stdx::optional& +replace_one::collation() const { return _collation; } @@ -47,7 +48,7 @@ replace_one& replace_one::upsert(bool upsert) { return *this; } -const stdx::optional& replace_one::upsert() const { +const bsoncxx::v_noabi::stdx::optional& replace_one::upsert() const { return _upsert; } @@ -56,7 +57,7 @@ replace_one& replace_one::hint(mongocxx::v_noabi::hint index_hint) { return *this; } -const stdx::optional& replace_one::hint() const { +const bsoncxx::v_noabi::stdx::optional& replace_one::hint() const { return _hint; } } // namespace model diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_many.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_many.cpp index 7792322ff7..87e990764f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_many.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_many.cpp @@ -46,7 +46,8 @@ update_many& update_many::collation(bsoncxx::v_noabi::document::view_or_value co return *this; } -const stdx::optional& update_many::collation() const { +const bsoncxx::v_noabi::stdx::optional& +update_many::collation() const { return _collation; } @@ -55,7 +56,7 @@ update_many& update_many::hint(mongocxx::v_noabi::hint index_hint) { return *this; } -const stdx::optional& update_many::hint() const { +const bsoncxx::v_noabi::stdx::optional& update_many::hint() const { return _hint; } @@ -64,7 +65,7 @@ update_many& update_many::upsert(bool upsert) { return *this; } -const stdx::optional& update_many::upsert() const { +const bsoncxx::v_noabi::stdx::optional& update_many::upsert() const { return _upsert; } @@ -73,7 +74,8 @@ update_many& update_many::array_filters(bsoncxx::v_noabi::array::view_or_value a return *this; } -const stdx::optional& update_many::array_filters() const { +const bsoncxx::v_noabi::stdx::optional& +update_many::array_filters() const { return _array_filters; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_one.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_one.cpp index 21b9096de0..ec94c72684 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_one.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/update_one.cpp @@ -46,7 +46,8 @@ update_one& update_one::collation(bsoncxx::v_noabi::document::view_or_value coll return *this; } -const stdx::optional& update_one::collation() const { +const bsoncxx::v_noabi::stdx::optional& +update_one::collation() const { return _collation; } @@ -55,7 +56,7 @@ update_one& update_one::hint(mongocxx::v_noabi::hint index_hint) { return *this; } -const stdx::optional& update_one::hint() const { +const bsoncxx::v_noabi::stdx::optional& update_one::hint() const { return _hint; } @@ -64,7 +65,7 @@ update_one& update_one::upsert(bool upsert) { return *this; } -const stdx::optional& update_one::upsert() const { +const bsoncxx::v_noabi::stdx::optional& update_one::upsert() const { return _upsert; } @@ -73,7 +74,8 @@ update_one& update_one::array_filters(bsoncxx::v_noabi::array::view_or_value arr return *this; } -const stdx::optional& update_one::array_filters() const { +const bsoncxx::v_noabi::stdx::optional& +update_one::array_filters() const { return _array_filters; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/aggregate.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/aggregate.cpp index e1f84b0f94..1ddfb8bac4 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/aggregate.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/aggregate.cpp @@ -85,48 +85,53 @@ aggregate& aggregate::comment(bsoncxx::v_noabi::types::bson_value::view_or_value return *this; } -const stdx::optional& aggregate::allow_disk_use() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::allow_disk_use() const { return _allow_disk_use; } -const stdx::optional& aggregate::batch_size() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::batch_size() const { return _batch_size; } -const stdx::optional& aggregate::collation() const { +const bsoncxx::v_noabi::stdx::optional& +aggregate::collation() const { return _collation; } -const stdx::optional& aggregate::let() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::let() + const { return _let; } -const stdx::optional& aggregate::max_time() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::max_time() const { return _max_time; } -const stdx::optional& aggregate::read_preference() const { +const bsoncxx::v_noabi::stdx::optional& +aggregate::read_preference() const { return _read_preference; } -const stdx::optional& aggregate::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& aggregate::hint() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::hint() const { return _hint; } -const stdx::optional& aggregate::read_concern() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::read_concern() + const { return _read_concern; } -const stdx::optional& aggregate::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& aggregate::write_concern() + const { return _write_concern; } -const stdx::optional& aggregate::comment() - const { +const bsoncxx::v_noabi::stdx::optional& +aggregate::comment() const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/auto_encryption.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/auto_encryption.cpp index 8d7cfdcdcd..27914548d5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/auto_encryption.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/auto_encryption.cpp @@ -35,7 +35,8 @@ auto_encryption& auto_encryption::key_vault_client(mongocxx::v_noabi::client* cl return *this; } -const stdx::optional& auto_encryption::key_vault_client() const { +const bsoncxx::v_noabi::stdx::optional& +auto_encryption::key_vault_client() const { return _key_vault_client; } @@ -44,7 +45,8 @@ auto_encryption& auto_encryption::key_vault_pool(mongocxx::v_noabi::pool* pool) return *this; } -const stdx::optional& auto_encryption::key_vault_pool() const { +const bsoncxx::v_noabi::stdx::optional& auto_encryption::key_vault_pool() + const { return _key_vault_pool; } @@ -53,7 +55,8 @@ auto_encryption& auto_encryption::key_vault_namespace(auto_encryption::ns_pair n return *this; } -const stdx::optional& auto_encryption::key_vault_namespace() const { +const bsoncxx::v_noabi::stdx::optional& +auto_encryption::key_vault_namespace() const { return _key_vault_namespace; } @@ -63,8 +66,8 @@ auto_encryption& auto_encryption::kms_providers( return *this; } -const stdx::optional& auto_encryption::kms_providers() - const { +const bsoncxx::v_noabi::stdx::optional& +auto_encryption::kms_providers() const { return _kms_providers; } @@ -73,7 +76,8 @@ auto_encryption& auto_encryption::tls_opts(bsoncxx::v_noabi::document::view_or_v return *this; } -const stdx::optional& auto_encryption::tls_opts() const { +const bsoncxx::v_noabi::stdx::optional& +auto_encryption::tls_opts() const { return _tls_opts; } @@ -82,8 +86,8 @@ auto_encryption& auto_encryption::schema_map(bsoncxx::v_noabi::document::view_or return *this; } -const stdx::optional& auto_encryption::schema_map() - const { +const bsoncxx::v_noabi::stdx::optional& +auto_encryption::schema_map() const { return _schema_map; } @@ -93,7 +97,7 @@ auto_encryption& auto_encryption::encrypted_fields_map( return *this; } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& auto_encryption::encrypted_fields_map() const { return _encrypted_fields_map; } @@ -121,8 +125,8 @@ auto_encryption& auto_encryption::extra_options(bsoncxx::v_noabi::document::view return *this; } -const stdx::optional& auto_encryption::extra_options() - const { +const bsoncxx::v_noabi::stdx::optional& +auto_encryption::extra_options() const { return _extra_options; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/bulk_write.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/bulk_write.cpp index f0f659e4aa..adeea47f75 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/bulk_write.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/bulk_write.cpp @@ -36,7 +36,8 @@ bulk_write& bulk_write::write_concern(mongocxx::v_noabi::write_concern wc) { return *this; } -const stdx::optional& bulk_write::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& +bulk_write::write_concern() const { return _write_concern; } @@ -45,7 +46,7 @@ bulk_write& bulk_write::bypass_document_validation(bool bypass_document_validati return *this; } -const stdx::optional bulk_write::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional bulk_write::bypass_document_validation() const { return _bypass_document_validation; } @@ -54,7 +55,8 @@ bulk_write& bulk_write::let(bsoncxx::v_noabi::document::view_or_value let) { return *this; } -const stdx::optional bulk_write::let() const { +const bsoncxx::v_noabi::stdx::optional bulk_write::let() + const { return _let; } @@ -63,8 +65,8 @@ bulk_write& bulk_write::comment(bsoncxx::v_noabi::types::bson_value::view_or_val return *this; } -const stdx::optional bulk_write::comment() - const { +const bsoncxx::v_noabi::stdx::optional +bulk_write::comment() const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/change_stream.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/change_stream.cpp index b12911787c..22eb7aa052 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/change_stream.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/change_stream.cpp @@ -56,7 +56,7 @@ change_stream& change_stream::batch_size(std::int32_t batch_size) { return *this; } -const stdx::optional& change_stream::batch_size() const { +const bsoncxx::v_noabi::stdx::optional& change_stream::batch_size() const { return _batch_size; } @@ -65,8 +65,8 @@ change_stream& change_stream::comment(bsoncxx::v_noabi::types::bson_value::view_ return *this; } -const stdx::optional& change_stream::comment() - const { +const bsoncxx::v_noabi::stdx::optional& +change_stream::comment() const { return _comment; } @@ -75,8 +75,8 @@ change_stream& change_stream::resume_after(bsoncxx::v_noabi::document::view_or_v return *this; } -const stdx::optional& change_stream::resume_after() - const { +const bsoncxx::v_noabi::stdx::optional& +change_stream::resume_after() const { return _resume_after; } @@ -85,8 +85,8 @@ change_stream& change_stream::start_after(bsoncxx::v_noabi::document::view_or_va return *this; } -const stdx::optional& change_stream::start_after() - const { +const bsoncxx::v_noabi::stdx::optional& +change_stream::start_after() const { return _start_after; } @@ -95,7 +95,8 @@ change_stream& change_stream::collation(bsoncxx::v_noabi::document::view_or_valu return *this; } -const stdx::optional& change_stream::collation() const { +const bsoncxx::v_noabi::stdx::optional& +change_stream::collation() const { return _collation; } @@ -104,7 +105,8 @@ change_stream& change_stream::max_await_time(std::chrono::milliseconds max_time) return *this; } -const stdx::optional& change_stream::max_await_time() const { +const bsoncxx::v_noabi::stdx::optional& change_stream::max_await_time() + const { return _max_await_time; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client.cpp index b2dd093f77..0efe538ae4 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client.cpp @@ -25,7 +25,7 @@ client& client::tls_opts(tls tls_opts) { return *this; } -const stdx::optional& client::tls_opts() const { +const bsoncxx::v_noabi::stdx::optional& client::tls_opts() const { return _tls_opts; } @@ -33,7 +33,7 @@ client& client::ssl_opts(tls ssl_opts) { return tls_opts(std::move(ssl_opts)); } -const stdx::optional& client::ssl_opts() const { +const bsoncxx::v_noabi::stdx::optional& client::ssl_opts() const { return tls_opts(); } @@ -42,7 +42,7 @@ client& client::apm_opts(apm apm_opts) { return *this; } -const stdx::optional& client::apm_opts() const { +const bsoncxx::v_noabi::stdx::optional& client::apm_opts() const { return _apm_opts; } @@ -51,7 +51,7 @@ client& client::auto_encryption_opts(auto_encryption auto_encryption_opts) { return *this; } -const stdx::optional& client::auto_encryption_opts() const { +const bsoncxx::v_noabi::stdx::optional& client::auto_encryption_opts() const { return _auto_encrypt_opts; } @@ -60,7 +60,7 @@ client& client::server_api_opts(server_api server_api_opts) { return *this; } -const stdx::optional& client::server_api_opts() const { +const bsoncxx::v_noabi::stdx::optional& client::server_api_opts() const { return _server_api_opts; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_encryption.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_encryption.cpp index 4e8035af44..74c48a7044 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_encryption.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_encryption.cpp @@ -29,7 +29,8 @@ client_encryption& client_encryption::key_vault_client(mongocxx::v_noabi::client return *this; } -const stdx::optional& client_encryption::key_vault_client() const { +const bsoncxx::v_noabi::stdx::optional& +client_encryption::key_vault_client() const { return _key_vault_client; } @@ -38,7 +39,8 @@ client_encryption& client_encryption::key_vault_namespace(client_encryption::ns_ return *this; } -const stdx::optional& client_encryption::key_vault_namespace() const { +const bsoncxx::v_noabi::stdx::optional& +client_encryption::key_vault_namespace() const { return _key_vault_namespace; } @@ -48,8 +50,8 @@ client_encryption& client_encryption::kms_providers( return *this; } -const stdx::optional& client_encryption::kms_providers() - const { +const bsoncxx::v_noabi::stdx::optional& +client_encryption::kms_providers() const { return _kms_providers; } @@ -58,8 +60,8 @@ client_encryption& client_encryption::tls_opts(bsoncxx::v_noabi::document::view_ return *this; } -const stdx::optional& client_encryption::tls_opts() - const { +const bsoncxx::v_noabi::stdx::optional& +client_encryption::tls_opts() const { return _tls_opts; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_session.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_session.cpp index c0b1bf1f74..e25388fd4c 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_session.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client_session.cpp @@ -47,7 +47,8 @@ client_session& client_session::default_transaction_opts(transaction default_tra return *this; } -const stdx::optional& client_session::default_transaction_opts() const { +const bsoncxx::v_noabi::stdx::optional& client_session::default_transaction_opts() + const { return _default_transaction_opts; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/count.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/count.cpp index 8cf833802f..1529335b37 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/count.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/count.cpp @@ -56,31 +56,33 @@ count& count::read_preference(mongocxx::v_noabi::read_preference rp) { return *this; } -const stdx::optional& count::collation() const { +const bsoncxx::v_noabi::stdx::optional& +count::collation() const { return _collation; } -const stdx::optional& count::hint() const { +const bsoncxx::v_noabi::stdx::optional& count::hint() const { return _hint; } -const stdx::optional& count::comment() const { +const bsoncxx::v_noabi::stdx::optional& +count::comment() const { return _comment; } -const stdx::optional& count::limit() const { +const bsoncxx::v_noabi::stdx::optional& count::limit() const { return _limit; } -const stdx::optional& count::max_time() const { +const bsoncxx::v_noabi::stdx::optional& count::max_time() const { return _max_time; } -const stdx::optional& count::skip() const { +const bsoncxx::v_noabi::stdx::optional& count::skip() const { return _skip; } -const stdx::optional& count::read_preference() const { +const bsoncxx::v_noabi::stdx::optional& count::read_preference() const { return _read_preference; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/create_collection.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/create_collection.cpp index c6ac012424..ce477438c7 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/create_collection.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/create_collection.cpp @@ -66,33 +66,33 @@ create_collection_deprecated& create_collection_deprecated::validation_criteria( return *this; } -const stdx::optional& create_collection_deprecated::capped() const { +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::capped() const { return _capped; } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::collation() const { return _collation; } -const stdx::optional& create_collection_deprecated::max() const { +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::max() const { return _max_documents; } -const stdx::optional& create_collection_deprecated::no_padding() const { +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::no_padding() const { return _no_padding; } -const stdx::optional& create_collection_deprecated::size() const { +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::size() const { return _max_size; } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::storage_engine() const { return _storage_engine_opts; } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& create_collection_deprecated::validation_criteria() const { return _validation; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/data_key.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/data_key.cpp index e3a32e6a3e..5b01cfb629 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/data_key.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/data_key.cpp @@ -27,7 +27,8 @@ data_key& data_key::master_key(bsoncxx::v_noabi::document::view_or_value master_ return *this; } -const stdx::optional& data_key::master_key() const { +const bsoncxx::v_noabi::stdx::optional& +data_key::master_key() const { return _master_key; } @@ -78,7 +79,7 @@ data_key& data_key::key_material(data_key::key_material_type key_material) { return *this; } -const stdx::optional& data_key::key_material() { +const bsoncxx::v_noabi::stdx::optional& data_key::key_material() { return _key_material; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/delete.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/delete.cpp index d443f65434..6055b4762d 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/delete.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/delete.cpp @@ -36,15 +36,17 @@ delete_options& delete_options::hint(mongocxx::v_noabi::hint index_hint) { return *this; } -const stdx::optional& delete_options::collation() const { +const bsoncxx::v_noabi::stdx::optional& +delete_options::collation() const { return _collation; } -const stdx::optional& delete_options::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& +delete_options::write_concern() const { return _write_concern; } -const stdx::optional& delete_options::hint() const { +const bsoncxx::v_noabi::stdx::optional& delete_options::hint() const { return _hint; } @@ -53,7 +55,8 @@ delete_options& delete_options::let(bsoncxx::v_noabi::document::view_or_value le return *this; } -const stdx::optional delete_options::let() const { +const bsoncxx::v_noabi::stdx::optional +delete_options::let() const { return _let; } @@ -63,8 +66,8 @@ delete_options& delete_options::comment( return *this; } -const stdx::optional delete_options::comment() - const { +const bsoncxx::v_noabi::stdx::optional +delete_options::comment() const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/distinct.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/distinct.cpp index c7c8ea86a0..54f0c22455 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/distinct.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/distinct.cpp @@ -41,20 +41,22 @@ distinct& distinct::read_preference(mongocxx::v_noabi::read_preference rp) { return *this; } -const stdx::optional& distinct::collation() const { +const bsoncxx::v_noabi::stdx::optional& +distinct::collation() const { return _collation; } -const stdx::optional& distinct::max_time() const { +const bsoncxx::v_noabi::stdx::optional& distinct::max_time() const { return _max_time; } -const stdx::optional& distinct::comment() - const { +const bsoncxx::v_noabi::stdx::optional& +distinct::comment() const { return _comment; } -const stdx::optional& distinct::read_preference() const { +const bsoncxx::v_noabi::stdx::optional& +distinct::read_preference() const { return _read_preference; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/encrypt.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/encrypt.cpp index 8502fe8372..103116ac58 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/encrypt.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/encrypt.cpp @@ -34,7 +34,8 @@ encrypt& encrypt::key_id(bsoncxx::v_noabi::types::bson_value::view_or_value key_ return *this; } -const stdx::optional& encrypt::key_id() const { +const bsoncxx::v_noabi::stdx::optional& +encrypt::key_id() const { return _key_id; } @@ -43,7 +44,7 @@ encrypt& encrypt::key_alt_name(std::string name) { return *this; } -const stdx::optional& encrypt::key_alt_name() const { +const bsoncxx::v_noabi::stdx::optional& encrypt::key_alt_name() const { return _key_alt_name; } @@ -52,7 +53,7 @@ encrypt& encrypt::algorithm(encrypt::encryption_algorithm algorithm) { return *this; } -const stdx::optional& encrypt::algorithm() const { +const bsoncxx::v_noabi::stdx::optional& encrypt::algorithm() const { return _algorithm; } @@ -61,7 +62,7 @@ encrypt& encrypt::contention_factor(int64_t contention_factor) { return *this; } -const stdx::optional& encrypt::contention_factor() const { +const bsoncxx::v_noabi::stdx::optional& encrypt::contention_factor() const { return _contention_factor; } @@ -70,7 +71,8 @@ encrypt& encrypt::query_type(encrypt::encryption_query_type query_type) { return *this; } -const stdx::optional& encrypt::query_type() const { +const bsoncxx::v_noabi::stdx::optional& encrypt::query_type() + const { return _query_type; } @@ -79,7 +81,7 @@ encrypt& encrypt::range_opts(options::range opts) { return *this; } -const stdx::optional& encrypt::range_opts() const { +const bsoncxx::v_noabi::stdx::optional& encrypt::range_opts() const { return _range_opts; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/estimated_document_count.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/estimated_document_count.cpp index 88e2826cb3..1a501f2fbc 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/estimated_document_count.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/estimated_document_count.cpp @@ -38,16 +38,18 @@ estimated_document_count& estimated_document_count::comment( return *this; } -const stdx::optional& estimated_document_count::max_time() const { +const bsoncxx::v_noabi::stdx::optional& +estimated_document_count::max_time() const { return _max_time; } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& estimated_document_count::comment() const { return _comment; } -const stdx::optional& estimated_document_count::read_preference() const { +const bsoncxx::v_noabi::stdx::optional& estimated_document_count::read_preference() + const { return _read_preference; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find.cpp index dcc6bb797d..2c2adf2a9a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find.cpp @@ -126,88 +126,96 @@ find& find::sort(bsoncxx::v_noabi::document::view_or_value ordering) { return *this; } -const stdx::optional& find::allow_disk_use() const { +const bsoncxx::v_noabi::stdx::optional& find::allow_disk_use() const { return _allow_disk_use; } -const stdx::optional& find::allow_partial_results() const { +const bsoncxx::v_noabi::stdx::optional& find::allow_partial_results() const { return _allow_partial_results; } -const stdx::optional& find::batch_size() const { +const bsoncxx::v_noabi::stdx::optional& find::batch_size() const { return _batch_size; } -const stdx::optional& find::collation() const { +const bsoncxx::v_noabi::stdx::optional& find::collation() + const { return _collation; } -const stdx::optional& find::comment() const { +const bsoncxx::v_noabi::stdx::optional& find::comment() + const { return _comment; } -const stdx::optional& find::cursor_type() const { +const bsoncxx::v_noabi::stdx::optional& find::cursor_type() const { return _cursor_type; } -const stdx::optional& find::hint() const { +const bsoncxx::v_noabi::stdx::optional& find::hint() const { return _hint; } -const stdx::optional& find::limit() const { +const bsoncxx::v_noabi::stdx::optional& find::limit() const { return _limit; } -const stdx::optional find::let() const { +const bsoncxx::v_noabi::stdx::optional find::let() + const { return _let; } -const stdx::optional& find::comment_option() - const { +const bsoncxx::v_noabi::stdx::optional& +find::comment_option() const { return _comment_option; } -const stdx::optional& find::max() const { +const bsoncxx::v_noabi::stdx::optional& find::max() + const { return _max; } -const stdx::optional& find::max_await_time() const { +const bsoncxx::v_noabi::stdx::optional& find::max_await_time() const { return _max_await_time; } -const stdx::optional& find::max_time() const { +const bsoncxx::v_noabi::stdx::optional& find::max_time() const { return _max_time; } -const stdx::optional& find::min() const { +const bsoncxx::v_noabi::stdx::optional& find::min() + const { return _min; } -const stdx::optional& find::no_cursor_timeout() const { +const bsoncxx::v_noabi::stdx::optional& find::no_cursor_timeout() const { return _no_cursor_timeout; } -const stdx::optional& find::projection() const { +const bsoncxx::v_noabi::stdx::optional& +find::projection() const { return _projection; } -const stdx::optional& find::return_key() const { +const bsoncxx::v_noabi::stdx::optional& find::return_key() const { return _return_key; } -const stdx::optional& find::show_record_id() const { +const bsoncxx::v_noabi::stdx::optional& find::show_record_id() const { return _show_record_id; } -const stdx::optional& find::skip() const { +const bsoncxx::v_noabi::stdx::optional& find::skip() const { return _skip; } -const stdx::optional& find::sort() const { +const bsoncxx::v_noabi::stdx::optional& find::sort() + const { return _ordering; } -const stdx::optional& find::read_preference() const { +const bsoncxx::v_noabi::stdx::optional& find::read_preference() + const { return _read_preference; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.cpp index cd48cb4dbf..9aa1428622 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.cpp @@ -64,37 +64,41 @@ find_one_and_delete& find_one_and_delete::comment( return *this; } -const stdx::optional& find_one_and_delete::hint() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_delete::hint() const { return _hint; } -const stdx::optional& find_one_and_delete::collation() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_delete::collation() const { return _collation; } -const stdx::optional& find_one_and_delete::projection() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_delete::projection() const { return _projection; } -const stdx::optional& find_one_and_delete::sort() const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_delete::sort() const { return _ordering; } -const stdx::optional& find_one_and_delete::max_time() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_delete::max_time() + const { return _max_time; } -const stdx::optional& find_one_and_delete::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_delete::write_concern() const { return _write_concern; } -const stdx::optional find_one_and_delete::let() const { +const bsoncxx::v_noabi::stdx::optional +find_one_and_delete::let() const { return _let; } -const stdx::optional +const bsoncxx::v_noabi::stdx::optional find_one_and_delete::comment() const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.cpp index 846ab89852..8de4e34b07 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.cpp @@ -82,53 +82,57 @@ find_one_and_replace& find_one_and_replace::write_concern( return *this; } -const stdx::optional& find_one_and_replace::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_replace::bypass_document_validation() + const { return _bypass_document_validation; } -const stdx::optional& find_one_and_replace::collation() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_replace::collation() const { return _collation; } -const stdx::optional& find_one_and_replace::hint() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_replace::hint() + const { return _hint; } -const stdx::optional find_one_and_replace::let() const { +const bsoncxx::v_noabi::stdx::optional +find_one_and_replace::let() const { return _let; } -const stdx::optional +const bsoncxx::v_noabi::stdx::optional find_one_and_replace::comment() const { return _comment; } -const stdx::optional& find_one_and_replace::max_time() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_replace::max_time() + const { return _max_time; } -const stdx::optional& find_one_and_replace::projection() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_replace::projection() const { return _projection; } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& find_one_and_replace::return_document() const { return _return_document; } -const stdx::optional& find_one_and_replace::sort() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_replace::sort() const { return _ordering; } -const stdx::optional& find_one_and_replace::upsert() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_replace::upsert() const { return _upsert; } -const stdx::optional& find_one_and_replace::write_concern() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_replace::write_concern() const { return _write_concern; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_update.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_update.cpp index ad7280ef8c..c7c8423baa 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_update.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find_one_and_update.cpp @@ -83,50 +83,56 @@ find_one_and_update& find_one_and_update::write_concern( return *this; } -const stdx::optional& find_one_and_update::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_update::bypass_document_validation() + const { return _bypass_document_validation; } -const stdx::optional& find_one_and_update::collation() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_update::collation() const { return _collation; } -const stdx::optional& find_one_and_update::hint() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_update::hint() const { return _hint; } -const stdx::optional find_one_and_update::let() const { +const bsoncxx::v_noabi::stdx::optional +find_one_and_update::let() const { return _let; } -const stdx::optional +const bsoncxx::v_noabi::stdx::optional find_one_and_update::comment() const { return _comment; } -const stdx::optional& find_one_and_update::max_time() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_update::max_time() + const { return _max_time; } -const stdx::optional& find_one_and_update::projection() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_update::projection() const { return _projection; } -const stdx::optional& find_one_and_update::return_document() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_update::return_document() + const { return _return_document; } -const stdx::optional& find_one_and_update::sort() const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_update::sort() const { return _ordering; } -const stdx::optional& find_one_and_update::upsert() const { +const bsoncxx::v_noabi::stdx::optional& find_one_and_update::upsert() const { return _upsert; } -const stdx::optional& find_one_and_update::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_update::write_concern() const { return _write_concern; } @@ -136,8 +142,8 @@ find_one_and_update& find_one_and_update::array_filters( return *this; } -const stdx::optional& find_one_and_update::array_filters() - const { +const bsoncxx::v_noabi::stdx::optional& +find_one_and_update::array_filters() const { return _array_filters; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.cpp index 11f68e15e8..a819f9f424 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/bucket.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -32,7 +31,7 @@ bucket& bucket::bucket_name(std::string bucket_name) { return *this; } -const stdx::optional& bucket::bucket_name() const { +const bsoncxx::v_noabi::stdx::optional& bucket::bucket_name() const { return _bucket_name; } @@ -41,7 +40,7 @@ bucket& bucket::chunk_size_bytes(std::int32_t chunk_size_bytes) { return *this; } -const stdx::optional& bucket::chunk_size_bytes() const { +const bsoncxx::v_noabi::stdx::optional& bucket::chunk_size_bytes() const { return _chunk_size_bytes; } @@ -50,7 +49,8 @@ bucket& bucket::read_concern(mongocxx::v_noabi::read_concern read_concern) { return *this; } -const stdx::optional& bucket::read_concern() const { +const bsoncxx::v_noabi::stdx::optional& bucket::read_concern() + const { return _read_concern; } @@ -59,7 +59,8 @@ bucket& bucket::read_preference(mongocxx::v_noabi::read_preference read_preferen return *this; } -const stdx::optional& bucket::read_preference() const { +const bsoncxx::v_noabi::stdx::optional& +bucket::read_preference() const { return _read_preference; } @@ -68,7 +69,8 @@ bucket& bucket::write_concern(mongocxx::v_noabi::write_concern write_concern) { return *this; } -const stdx::optional& bucket::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& bucket::write_concern() + const { return _write_concern; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/upload.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/upload.cpp index 45855c14b2..f95b0e2f07 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/upload.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/gridfs/upload.cpp @@ -28,7 +28,7 @@ upload& upload::chunk_size_bytes(std::int32_t chunk_size_bytes) { return *this; } -const stdx::optional& upload::chunk_size_bytes() const { +const bsoncxx::v_noabi::stdx::optional& upload::chunk_size_bytes() const { return _chunk_size_bytes; } @@ -37,7 +37,8 @@ upload& upload::metadata(bsoncxx::v_noabi::document::view_or_value metadata) { return *this; } -const stdx::optional& upload::metadata() const { +const bsoncxx::v_noabi::stdx::optional& +upload::metadata() const { return _metadata; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp index b1dd053709..a8e93e78dd 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp @@ -129,27 +129,28 @@ index& index::haystack_bucket_size(double haystack_bucket_size) { return haystack_bucket_size_deprecated(haystack_bucket_size); } -const stdx::optional& index::background() const { +const bsoncxx::v_noabi::stdx::optional& index::background() const { return _background; } -const stdx::optional& index::unique() const { +const bsoncxx::v_noabi::stdx::optional& index::unique() const { return _unique; } -const stdx::optional& index::hidden() const { +const bsoncxx::v_noabi::stdx::optional& index::hidden() const { return _hidden; } -const stdx::optional& index::name() const { +const bsoncxx::v_noabi::stdx::optional& index::name() + const { return _name; } -const stdx::optional& index::collation() const { +const bsoncxx::v_noabi::stdx::optional& index::collation() const { return _collation; } -const stdx::optional& index::sparse() const { +const bsoncxx::v_noabi::stdx::optional& index::sparse() const { return _sparse; } @@ -157,51 +158,54 @@ const std::unique_ptr& index::storage_options() con return _storage_options; } -const stdx::optional& index::expire_after() const { +const bsoncxx::v_noabi::stdx::optional& index::expire_after() const { return _expire_after; } -const stdx::optional& index::version() const { +const bsoncxx::v_noabi::stdx::optional& index::version() const { return _version; } -const stdx::optional& index::weights() const { +const bsoncxx::v_noabi::stdx::optional& index::weights() const { return _weights; } -const stdx::optional& index::default_language() const { +const bsoncxx::v_noabi::stdx::optional& +index::default_language() const { return _default_language; } -const stdx::optional& index::language_override() const { +const bsoncxx::v_noabi::stdx::optional& +index::language_override() const { return _language_override; } -const stdx::optional& index::partial_filter_expression() const { +const bsoncxx::v_noabi::stdx::optional& +index::partial_filter_expression() const { return _partial_filter_expression; } -const stdx::optional& index::twod_sphere_version() const { +const bsoncxx::v_noabi::stdx::optional& index::twod_sphere_version() const { return _twod_sphere_version; } -const stdx::optional& index::twod_bits_precision() const { +const bsoncxx::v_noabi::stdx::optional& index::twod_bits_precision() const { return _twod_bits_precision; } -const stdx::optional& index::twod_location_min() const { +const bsoncxx::v_noabi::stdx::optional& index::twod_location_min() const { return _twod_location_min; } -const stdx::optional& index::twod_location_max() const { +const bsoncxx::v_noabi::stdx::optional& index::twod_location_max() const { return _twod_location_max; } -const stdx::optional& index::haystack_bucket_size_deprecated() const { +const bsoncxx::v_noabi::stdx::optional& index::haystack_bucket_size_deprecated() const { return _haystack_bucket_size; } -const stdx::optional& index::haystack_bucket_size() const { +const bsoncxx::v_noabi::stdx::optional& index::haystack_bucket_size() const { return haystack_bucket_size_deprecated(); } @@ -312,7 +316,7 @@ void index::wiredtiger_storage_options::config_string( _config_string = std::move(config_string); } -const stdx::optional& +const bsoncxx::v_noabi::stdx::optional& index::wiredtiger_storage_options::config_string() const { return _config_string; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index_view.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index_view.cpp index 5c248b1670..fd501860a6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index_view.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index_view.cpp @@ -38,7 +38,8 @@ const bsoncxx::v_noabi::stdx::optional& index_view::m return _max_time; } -const stdx::optional index_view::commit_quorum() const { +const bsoncxx::v_noabi::stdx::optional +index_view::commit_quorum() const { return _commit_quorum; } @@ -53,13 +54,13 @@ index_view& index_view::write_concern(mongocxx::v_noabi::write_concern write_con } index_view& index_view::commit_quorum(int commit_quorum) { - _commit_quorum = stdx::make_optional( + _commit_quorum = bsoncxx::v_noabi::stdx::make_optional( make_document(kvp("commitQuorum", bsoncxx::v_noabi::types::b_int32{commit_quorum}))); return *this; } index_view& index_view::commit_quorum(std::string commit_quorum) { - _commit_quorum = stdx::make_optional( + _commit_quorum = bsoncxx::v_noabi::stdx::make_optional( make_document(kvp("commitQuorum", commit_quorum))); return *this; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/insert.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/insert.cpp index 6f3ef1f8d6..8005f925b0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/insert.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/insert.cpp @@ -40,19 +40,21 @@ insert& insert::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comme return *this; } -const stdx::optional& insert::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional& insert::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& insert::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& insert::write_concern() + const { return _write_concern; } -const stdx::optional& insert::ordered() const { +const bsoncxx::v_noabi::stdx::optional& insert::ordered() const { return _ordered; } -const stdx::optional& insert::comment() const { +const bsoncxx::v_noabi::stdx::optional& +insert::comment() const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh index 32075cdd13..70dd9b6fd5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh @@ -22,7 +22,6 @@ #include #include #include -#include #include @@ -62,14 +61,14 @@ class transaction::impl { rc._impl->read_concern_t); } - stdx::optional read_concern() const { + bsoncxx::v_noabi::stdx::optional read_concern() const { auto rc = libmongoc::transaction_opts_get_read_concern(_transaction_opt_t.get()); if (!rc) { return {}; } - mongocxx::v_noabi::read_concern rci( - stdx::make_unique(libmongoc::read_concern_copy(rc))); - return stdx::optional(std::move(rci)); + mongocxx::v_noabi::read_concern rci(bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_concern_copy(rc))); + return bsoncxx::v_noabi::stdx::optional(std::move(rci)); } void write_concern(const mongocxx::v_noabi::write_concern& wc) { @@ -77,14 +76,15 @@ class transaction::impl { wc._impl->write_concern_t); } - stdx::optional write_concern() const { + bsoncxx::v_noabi::stdx::optional write_concern() const { auto wc = libmongoc::transaction_opts_get_write_concern(_transaction_opt_t.get()); if (!wc) { return {}; } mongocxx::v_noabi::write_concern wci( - stdx::make_unique(libmongoc::write_concern_copy(wc))); - return stdx::optional(std::move(wci)); + bsoncxx::v_noabi::stdx::make_unique( + libmongoc::write_concern_copy(wc))); + return bsoncxx::v_noabi::stdx::optional(std::move(wci)); } void read_preference(const mongocxx::v_noabi::read_preference& rp) { @@ -92,21 +92,22 @@ class transaction::impl { rp._impl->read_preference_t); } - stdx::optional read_preference() const { + bsoncxx::v_noabi::stdx::optional read_preference() const { auto rp = libmongoc::transaction_opts_get_read_prefs(_transaction_opt_t.get()); if (!rp) { return {}; } mongocxx::v_noabi::read_preference rpi( - stdx::make_unique(libmongoc::read_prefs_copy(rp))); - return stdx::optional(std::move(rpi)); + bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_prefs_copy(rp))); + return bsoncxx::v_noabi::stdx::optional(std::move(rpi)); } void max_commit_time_ms(std::chrono::milliseconds ms) { libmongoc::transaction_opts_set_max_commit_time_ms(_transaction_opt_t.get(), ms.count()); } - stdx::optional max_commit_time_ms() const { + bsoncxx::v_noabi::stdx::optional max_commit_time_ms() const { auto ms = libmongoc::transaction_opts_get_max_commit_time_ms(_transaction_opt_t.get()); if (!ms) { #if !defined(__clang__) && defined(__GNUC__) && (__cplusplus >= 201709L) diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/range.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/range.cpp index 910f401f79..a2acf6d802 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/range.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/range.cpp @@ -25,7 +25,8 @@ range& range::min(bsoncxx::v_noabi::types::bson_value::view_or_value value) { return *this; } -const stdx::optional& range::min() const { +const bsoncxx::v_noabi::stdx::optional& +range::min() const { return _min; } @@ -34,7 +35,8 @@ range& range::max(bsoncxx::v_noabi::types::bson_value::view_or_value value) { return *this; } -const stdx::optional& range::max() const { +const bsoncxx::v_noabi::stdx::optional& +range::max() const { return _max; } @@ -48,11 +50,11 @@ range& range::trim_factor(std::int32_t value) { return *this; } -const stdx::optional& range::sparsity() const { +const bsoncxx::v_noabi::stdx::optional& range::sparsity() const { return _sparsity; } -const stdx::optional& range::trim_factor() const { +const bsoncxx::v_noabi::stdx::optional& range::trim_factor() const { return _trim_factor; } @@ -61,7 +63,7 @@ range& range::precision(std::int32_t value) { return *this; } -const stdx::optional& range::precision() const { +const bsoncxx::v_noabi::stdx::optional& range::precision() const { return _precision; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/replace.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/replace.cpp index c0cb3cae8f..8c9a4a85e5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/replace.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/replace.cpp @@ -57,31 +57,35 @@ replace& replace::write_concern(mongocxx::v_noabi::write_concern wc) { return *this; } -const stdx::optional& replace::hint() const { +const bsoncxx::v_noabi::stdx::optional& replace::hint() const { return _hint; } -const stdx::optional replace::let() const { +const bsoncxx::v_noabi::stdx::optional replace::let() + const { return _let; } -const stdx::optional replace::comment() const { +const bsoncxx::v_noabi::stdx::optional +replace::comment() const { return _comment; } -const stdx::optional& replace::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional& replace::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& replace::collation() const { +const bsoncxx::v_noabi::stdx::optional& +replace::collation() const { return _collation; } -const stdx::optional& replace::upsert() const { +const bsoncxx::v_noabi::stdx::optional& replace::upsert() const { return _upsert; } -const stdx::optional& replace::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& replace::write_concern() + const { return _write_concern; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.cpp index 09e9d25734..96fd0c27de 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey.cpp @@ -42,8 +42,8 @@ rewrap_many_datakey& rewrap_many_datakey::master_key( return *this; } -const stdx::optional& rewrap_many_datakey::master_key() - const { +const bsoncxx::v_noabi::stdx::optional& +rewrap_many_datakey::master_key() const { return _master_key; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/server_api.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/server_api.cpp index 862b863901..f3755ee782 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/server_api.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/server_api.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include @@ -38,7 +37,7 @@ std::string server_api::version_to_string(server_api::version version) { } } -server_api::version server_api::version_from_string(stdx::string_view version) { +server_api::version server_api::version_from_string(bsoncxx::v_noabi::stdx::string_view version) { if (!version.compare("1")) { return server_api::version::k_version_1; } @@ -53,7 +52,7 @@ server_api& server_api::strict(bool strict) { return *this; } -const stdx::optional& server_api::strict() const { +const bsoncxx::v_noabi::stdx::optional& server_api::strict() const { return _strict; } @@ -62,7 +61,7 @@ server_api& server_api::deprecation_errors(bool deprecation_errors) { return *this; } -const stdx::optional& server_api::deprecation_errors() const { +const bsoncxx::v_noabi::stdx::optional& server_api::deprecation_errors() const { return _deprecation_errors; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/tls.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/tls.cpp index 7360d903dd..8a971dfb87 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/tls.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/tls.cpp @@ -25,7 +25,8 @@ tls& tls::pem_file(bsoncxx::v_noabi::string::view_or_value pem_file) { return *this; } -const stdx::optional& tls::pem_file() const { +const bsoncxx::v_noabi::stdx::optional& tls::pem_file() + const { return _pem_file; } @@ -34,7 +35,8 @@ tls& tls::pem_password(bsoncxx::v_noabi::string::view_or_value pem_password) { return *this; } -const stdx::optional& tls::pem_password() const { +const bsoncxx::v_noabi::stdx::optional& tls::pem_password() + const { return _pem_password; } @@ -43,7 +45,8 @@ tls& tls::ca_file(bsoncxx::v_noabi::string::view_or_value ca_file) { return *this; } -const stdx::optional& tls::ca_file() const { +const bsoncxx::v_noabi::stdx::optional& tls::ca_file() + const { return _ca_file; } @@ -52,7 +55,8 @@ tls& tls::ca_dir(bsoncxx::v_noabi::string::view_or_value ca_dir) { return *this; } -const stdx::optional& tls::ca_dir() const { +const bsoncxx::v_noabi::stdx::optional& tls::ca_dir() + const { return _ca_dir; } @@ -61,7 +65,8 @@ tls& tls::crl_file(bsoncxx::v_noabi::string::view_or_value crl_file) { return *this; } -const stdx::optional& tls::crl_file() const { +const bsoncxx::v_noabi::stdx::optional& tls::crl_file() + const { return _crl_file; } @@ -70,7 +75,7 @@ tls& tls::allow_invalid_certificates(bool allow_invalid_certificates) { return *this; } -const stdx::optional& tls::allow_invalid_certificates() const { +const bsoncxx::v_noabi::stdx::optional& tls::allow_invalid_certificates() const { return _allow_invalid_certificates; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp index f3f58b2cfd..8ea4866bdb 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp @@ -24,16 +24,16 @@ namespace mongocxx { namespace v_noabi { namespace options { -transaction::transaction() : _impl{stdx::make_unique()} {} +transaction::transaction() : _impl{bsoncxx::v_noabi::stdx::make_unique()} {} transaction::transaction(transaction&&) noexcept = default; transaction& transaction::operator=(transaction&&) noexcept = default; transaction::transaction(const transaction& other) - : _impl{stdx::make_unique(other._get_impl().get_transaction_opt_t())} {} + : _impl{bsoncxx::v_noabi::stdx::make_unique(other._get_impl().get_transaction_opt_t())} {} transaction& transaction::operator=(const transaction& other) { - _impl = stdx::make_unique(other._get_impl().get_transaction_opt_t()); + _impl = bsoncxx::v_noabi::stdx::make_unique(other._get_impl().get_transaction_opt_t()); return *this; } @@ -44,7 +44,8 @@ transaction& transaction::read_concern(const mongocxx::v_noabi::read_concern& rc return *this; } -stdx::optional transaction::read_concern() const { +bsoncxx::v_noabi::stdx::optional transaction::read_concern() + const { return _impl->read_concern(); } @@ -53,7 +54,8 @@ transaction& transaction::write_concern(const mongocxx::v_noabi::write_concern& return *this; } -stdx::optional transaction::write_concern() const { +bsoncxx::v_noabi::stdx::optional transaction::write_concern() + const { return _impl->write_concern(); } @@ -62,7 +64,8 @@ transaction& transaction::read_preference(const mongocxx::v_noabi::read_preferen return *this; } -stdx::optional transaction::read_preference() const { +bsoncxx::v_noabi::stdx::optional transaction::read_preference() + const { return _impl->read_preference(); } @@ -71,7 +74,8 @@ transaction& transaction::max_commit_time_ms(std::chrono::milliseconds ms) { return *this; } -stdx::optional transaction::max_commit_time_ms() const { +bsoncxx::v_noabi::stdx::optional transaction::max_commit_time_ms() + const { return _impl->max_commit_time_ms(); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/update.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/update.cpp index 8ba388e9bd..714c75b145 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/update.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/update.cpp @@ -58,31 +58,35 @@ update& update::write_concern(mongocxx::v_noabi::write_concern wc) { return *this; } -const stdx::optional& update::bypass_document_validation() const { +const bsoncxx::v_noabi::stdx::optional& update::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& update::collation() const { +const bsoncxx::v_noabi::stdx::optional& +update::collation() const { return _collation; } -const stdx::optional& update::hint() const { +const bsoncxx::v_noabi::stdx::optional& update::hint() const { return _hint; } -const stdx::optional update::let() const { +const bsoncxx::v_noabi::stdx::optional update::let() + const { return _let; } -const stdx::optional update::comment() const { +const bsoncxx::v_noabi::stdx::optional +update::comment() const { return _comment; } -const stdx::optional& update::upsert() const { +const bsoncxx::v_noabi::stdx::optional& update::upsert() const { return _upsert; } -const stdx::optional& update::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& update::write_concern() + const { return _write_concern; } @@ -91,7 +95,8 @@ update& update::array_filters(bsoncxx::v_noabi::array::view_or_value array_filte return *this; } -const stdx::optional& update::array_filters() const { +const bsoncxx::v_noabi::stdx::optional& +update::array_filters() const { return _array_filters; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp index a5240f962e..be855aab6d 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp @@ -18,7 +18,6 @@ #include #include -#include #include @@ -28,7 +27,7 @@ using bsoncxx::v_noabi::builder::basic::sub_document; namespace mongocxx { namespace v_noabi { -pipeline::pipeline() : _impl(stdx::make_unique()) {} +pipeline::pipeline() : _impl(bsoncxx::v_noabi::stdx::make_unique()) {} pipeline::pipeline(pipeline&&) noexcept = default; pipeline& pipeline::operator=(pipeline&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp index 350fc2ed99..99ddc8fbc4 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp @@ -56,7 +56,7 @@ void pool::_release(client* client) { pool::~pool() = default; pool::pool(const uri& uri, const options::pool& options) - : _impl{stdx::make_unique(construct_client_pool(uri._impl->uri_t))} { + : _impl{bsoncxx::v_noabi::stdx::make_unique(construct_client_pool(uri._impl->uri_t))} { #if defined(MONGOCXX_ENABLE_SSL) && defined(MONGOC_ENABLE_SSL) if (options.client_opts().tls_opts()) { if (!uri.tls()) @@ -142,10 +142,10 @@ pool::entry pool::acquire() { entry::unique_client(new client(cli), [this](client* client) { _release(client); })); } -stdx::optional pool::try_acquire() { +bsoncxx::v_noabi::stdx::optional pool::try_acquire() { auto cli = libmongoc::client_pool_try_pop(_impl->client_pool_t); if (!cli) - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; return entry( entry::unique_client(new client(cli), [this](client* client) { _release(client); })); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/change_stream.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/change_stream.hh index 35327a0f37..695a197315 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/change_stream.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/change_stream.hh @@ -104,7 +104,7 @@ class change_stream::impl { return this->doc_; } - stdx::optional get_resume_token() { + bsoncxx::v_noabi::stdx::optional get_resume_token() { auto token = libmongoc::change_stream_get_resume_token(this->change_stream_); if (!token) { return {}; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_encryption.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_encryption.hh index d950766392..335e491933 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_encryption.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_encryption.hh @@ -232,7 +232,7 @@ class client_encryption::impl { make_document(kvp("nRemoved", reply.view()["deletedCount"].get_int32())))); } - stdx::optional get_key( + bsoncxx::v_noabi::stdx::optional get_key( bsoncxx::v_noabi::types::bson_value::view_or_value id) { libbson::scoped_bson_t key_doc; bson_error_t error; @@ -245,8 +245,9 @@ class client_encryption::impl { } return key_doc.view().empty() - ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + ? bsoncxx::v_noabi::stdx::nullopt + : bsoncxx::v_noabi::stdx::optional{ + key_doc.steal()}; } mongocxx::v_noabi::cursor get_keys() { @@ -262,7 +263,7 @@ class client_encryption::impl { return mongocxx::v_noabi::cursor(cursor); } - stdx::optional add_key_alt_name( + bsoncxx::v_noabi::stdx::optional add_key_alt_name( bsoncxx::v_noabi::types::bson_value::view_or_value id, bsoncxx::v_noabi::string::view_or_value key_alt_name) { scoped_bson_t key_doc; @@ -278,11 +279,12 @@ class client_encryption::impl { } return key_doc.view().empty() - ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + ? bsoncxx::v_noabi::stdx::nullopt + : bsoncxx::v_noabi::stdx::optional{ + key_doc.steal()}; } - stdx::optional get_key_by_alt_name( + bsoncxx::v_noabi::stdx::optional get_key_by_alt_name( bsoncxx::v_noabi::string::view_or_value key_alt_name) { scoped_bson_t key_doc; bson_error_t error; @@ -295,11 +297,12 @@ class client_encryption::impl { } return key_doc.view().empty() - ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + ? bsoncxx::v_noabi::stdx::nullopt + : bsoncxx::v_noabi::stdx::optional{ + key_doc.steal()}; } - stdx::optional remove_key_alt_name( + bsoncxx::v_noabi::stdx::optional remove_key_alt_name( bsoncxx::v_noabi::types::bson_value::view_or_value id, bsoncxx::v_noabi::string::view_or_value key_alt_name) { scoped_bson_t key_doc; @@ -315,8 +318,9 @@ class client_encryption::impl { } return key_doc.view().empty() - ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + ? bsoncxx::v_noabi::stdx::nullopt + : bsoncxx::v_noabi::stdx::optional{ + key_doc.steal()}; } collection create_encrypted_collection( @@ -326,7 +330,7 @@ class client_encryption::impl { const bsoncxx::v_noabi::document::view opts, bsoncxx::v_noabi::document::value& out_options, const std::string& kms_provider, - const stdx::optional& masterkey) { + const bsoncxx::v_noabi::stdx::optional& masterkey) { bson_error_t error = {}; scoped_bson_t out_opts; out_opts.init(); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_session.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_session.hh index c24f4d5365..c52bc28261 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_session.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client_session.hh @@ -151,7 +151,8 @@ class client_session::impl { _session_t.get(), operation_time.timestamp, operation_time.increment); } - void start_transaction(const stdx::optional& transaction_opts) { + void start_transaction( + const bsoncxx::v_noabi::stdx::optional& transaction_opts) { bson_error_t error; mongoc_transaction_opt_t* transaction_opt_t = nullptr; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/collection.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/collection.hh index 0a3622223c..1a773bf86f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/collection.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/collection.hh @@ -33,7 +33,7 @@ namespace v_noabi { class collection::impl { public: impl(mongoc_collection_t* collection, - stdx::string_view database_name, + bsoncxx::v_noabi::stdx::string_view database_name, const mongocxx::v_noabi::client::impl* client) : collection_t(collection), database_name(std::move(database_name)), client_impl(client) {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.cpp index aeed68b43e..f5b69f0e6c 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.cpp @@ -56,7 +56,8 @@ void scoped_bson_t::init_from_static(bsoncxx::document::value doc) { this->init_from_static(bsoncxx::document::view_or_value(std::move(doc))); } -scoped_bson_t::scoped_bson_t(bsoncxx::stdx::optional doc) { +scoped_bson_t::scoped_bson_t( + bsoncxx::v_noabi::stdx::optional doc) { if (doc) { this->init_from_static(std::move(*doc)); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.hh index ad81edaccd..17d31f8b8e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.hh @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp index 6233ffdba2..900bc21d27 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp @@ -27,7 +27,8 @@ namespace mongocxx { namespace v_noabi { -read_concern::read_concern() : _impl{stdx::make_unique(libmongoc::read_concern_new())} {} +read_concern::read_concern() + : _impl{bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_new())} {} read_concern::read_concern(std::unique_ptr&& implementation) : _impl{std::move(implementation)} {} @@ -36,10 +37,12 @@ read_concern::read_concern(read_concern&&) noexcept = default; read_concern& read_concern::operator=(read_concern&&) noexcept = default; read_concern::read_concern(const read_concern& other) - : _impl(stdx::make_unique(libmongoc::read_concern_copy(other._impl->read_concern_t))) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_concern_copy(other._impl->read_concern_t))) {} read_concern& read_concern::operator=(const read_concern& other) { - _impl = stdx::make_unique(libmongoc::read_concern_copy(other._impl->read_concern_t)); + _impl = bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_concern_copy(other._impl->read_concern_t)); return *this; } @@ -78,7 +81,7 @@ void read_concern::acknowledge_level(read_concern::level rc_level) { } } -void read_concern::acknowledge_string(stdx::string_view rc_string) { +void read_concern::acknowledge_string(bsoncxx::v_noabi::stdx::string_view rc_string) { // libmongoc uses a NULL level to mean "use the server's default read_concern." libmongoc::read_concern_set_level( _impl->read_concern_t, @@ -105,12 +108,12 @@ read_concern::level read_concern::acknowledge_level() const { } } -stdx::string_view read_concern::acknowledge_string() const { +bsoncxx::v_noabi::stdx::string_view read_concern::acknowledge_string() const { auto level = libmongoc::read_concern_get_level(_impl->read_concern_t); if (!level) { return ""; } - return {stdx::string_view{level}}; + return {bsoncxx::v_noabi::stdx::string_view{level}}; } bsoncxx::v_noabi::document::value read_concern::to_document() const { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp index b713dea30a..f415b79229 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp @@ -32,10 +32,12 @@ read_preference::read_preference(read_preference&&) noexcept = default; read_preference& read_preference::operator=(read_preference&&) noexcept = default; read_preference::read_preference(const read_preference& other) - : _impl(stdx::make_unique(libmongoc::read_prefs_copy(other._impl->read_preference_t))) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_prefs_copy(other._impl->read_preference_t))) {} read_preference& read_preference::operator=(const read_preference& other) { - _impl.reset(stdx::make_unique(libmongoc::read_prefs_copy(other._impl->read_preference_t)) + _impl.reset(bsoncxx::v_noabi::stdx::make_unique( + libmongoc::read_prefs_copy(other._impl->read_preference_t)) .release()); return *this; } @@ -45,13 +47,13 @@ read_preference::read_preference(std::unique_ptr&& implementation) { } read_preference::read_preference() - : _impl(stdx::make_unique(libmongoc::read_prefs_new( + : _impl(bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_new( libmongoc::conversions::read_mode_t_from_read_mode(read_mode::k_primary)))) {} read_preference::read_preference(read_mode mode) : read_preference(mode, deprecated_tag{}) {} read_preference::read_preference(read_mode mode, deprecated_tag) - : _impl(stdx::make_unique( + : _impl(bsoncxx::v_noabi::stdx::make_unique( libmongoc::read_prefs_new(libmongoc::conversions::read_mode_t_from_read_mode(mode)))) {} read_preference::read_preference(read_mode mode, bsoncxx::v_noabi::document::view_or_value tags) @@ -92,13 +94,13 @@ read_preference::read_mode read_preference::mode() const { libmongoc::read_prefs_get_mode(_impl->read_preference_t)); } -stdx::optional read_preference::tags() const { +bsoncxx::v_noabi::stdx::optional read_preference::tags() const { const bson_t* bson_tags = libmongoc::read_prefs_get_tags(_impl->read_preference_t); if (bson_count_keys(bson_tags)) return bsoncxx::v_noabi::document::view(bson_get_data(bson_tags), bson_tags->len); - return stdx::optional{}; + return bsoncxx::v_noabi::stdx::optional{}; } read_preference& read_preference::max_staleness(std::chrono::seconds max_staleness) { @@ -111,12 +113,12 @@ read_preference& read_preference::max_staleness(std::chrono::seconds max_stalene return *this; } -stdx::optional read_preference::max_staleness() const { +bsoncxx::v_noabi::stdx::optional read_preference::max_staleness() const { auto staleness = libmongoc::read_prefs_get_max_staleness_seconds(_impl->read_preference_t); // libmongoc signals "disabled" with the value -1. if (staleness == -1) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } return std::chrono::seconds{staleness}; @@ -129,14 +131,15 @@ read_preference& read_preference::hedge(bsoncxx::v_noabi::document::view_or_valu return *this; } -const stdx::optional read_preference::hedge() const { +const bsoncxx::v_noabi::stdx::optional read_preference::hedge() + const { const bson_t* hedge_bson = libmongoc::read_prefs_get_hedge(_impl->read_preference_t); if (!bson_empty(hedge_bson)) { return bsoncxx::v_noabi::document::view(bson_get_data(hedge_bson), hedge_bson->len); } - return stdx::optional{}; + return bsoncxx::v_noabi::stdx::optional{}; } bool operator==(const read_preference& lhs, const read_preference& rhs) { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/replace_one.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/replace_one.cpp index 50ac0a7282..40d09ae72f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/replace_one.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/replace_one.cpp @@ -34,9 +34,10 @@ std::int32_t replace_one::modified_count() const { return _result.modified_count(); } -stdx::optional replace_one::upserted_id() const { +bsoncxx::v_noabi::stdx::optional replace_one::upserted_id() + const { if (_result.upserted_ids().size() == 0) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } return _result.upserted_ids()[0]; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/update.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/update.cpp index da69240099..0ed18c8dcb 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/update.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/update.cpp @@ -37,9 +37,9 @@ std::int32_t update::upserted_count() const { return _result.upserted_count(); } -stdx::optional update::upserted_id() const { +bsoncxx::v_noabi::stdx::optional update::upserted_id() const { if (_result.upserted_ids().size() == 0) { - return stdx::nullopt; + return bsoncxx::v_noabi::stdx::nullopt; } return _result.upserted_ids()[0]; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp index d884df0da9..ddcbf76b7a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp @@ -11,14 +11,14 @@ namespace mongocxx { namespace v_noabi { search_index_view::search_index_view(void* coll, void* client) - : _impl{stdx::make_unique(static_cast(coll), - static_cast(client))} {} + : _impl{bsoncxx::v_noabi::stdx::make_unique(static_cast(coll), + static_cast(client))} {} search_index_view::search_index_view(search_index_view&&) noexcept = default; search_index_view& search_index_view::operator=(search_index_view&&) noexcept = default; search_index_view::search_index_view(const search_index_view& other) - : _impl(stdx::make_unique(other._get_impl())) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique(other._get_impl())) {} search_index_view& search_index_view::operator=(const search_index_view& other) { _get_impl() = other._get_impl(); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp index 036b5787bd..7c52352fc9 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp @@ -51,7 +51,7 @@ uri::uri(std::unique_ptr&& implementation) { uri::uri(bsoncxx::v_noabi::string::view_or_value uri_string) { bson_error_t error; - _impl = stdx::make_unique( + _impl = bsoncxx::v_noabi::stdx::make_unique( libmongoc::uri_new_with_error(uri_string.terminated().data(), &error)); if (_impl->uri_t == nullptr) { @@ -99,13 +99,13 @@ std::string uri::password() const { mongocxx::v_noabi::read_concern uri::read_concern() const { auto rc = libmongoc::uri_get_read_concern(_impl->uri_t); return mongocxx::v_noabi::read_concern( - stdx::make_unique(libmongoc::read_concern_copy(rc))); + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))); } mongocxx::v_noabi::read_preference uri::read_preference() const { auto rp = libmongoc::uri_get_read_prefs_t(_impl->uri_t); return mongocxx::v_noabi::read_preference( - stdx::make_unique(libmongoc::read_prefs_copy(rp))); + bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_copy(rp))); } std::string uri::replica_set() const { @@ -131,10 +131,12 @@ std::string uri::username() const { mongocxx::v_noabi::write_concern uri::write_concern() const { auto wc = libmongoc::uri_get_write_concern(_impl->uri_t); return mongocxx::v_noabi::write_concern( - stdx::make_unique(libmongoc::write_concern_copy(wc))); + bsoncxx::v_noabi::stdx::make_unique( + libmongoc::write_concern_copy(wc))); } -static stdx::optional _string_option(mongoc_uri_t* uri, std::string opt_name) { +static bsoncxx::v_noabi::stdx::optional _string_option( + mongoc_uri_t* uri, std::string opt_name) { const char* value; value = libmongoc::uri_get_option_as_utf8(uri, opt_name.c_str(), nullptr); @@ -142,10 +144,11 @@ static stdx::optional _string_option(mongoc_uri_t* uri, std:: return {}; } - return stdx::string_view{value}; + return bsoncxx::v_noabi::stdx::string_view{value}; } -static stdx::optional _int32_option(mongoc_uri_t* uri, std::string opt_name) { +static bsoncxx::v_noabi::stdx::optional _int32_option(mongoc_uri_t* uri, + std::string opt_name) { bson_iter_t iter; const bson_t* options_bson = libmongoc::uri_get_options(uri); @@ -156,7 +159,8 @@ static stdx::optional _int32_option(mongoc_uri_t* uri, std::string return bson_iter_int32(&iter); } -static stdx::optional _bool_option(mongoc_uri_t* uri, std::string opt_name) { +static bsoncxx::v_noabi::stdx::optional _bool_option(mongoc_uri_t* uri, + std::string opt_name) { bson_iter_t iter; const bson_t* options_bson = libmongoc::uri_get_options(uri); @@ -167,19 +171,19 @@ static stdx::optional _bool_option(mongoc_uri_t* uri, std::string opt_name return bson_iter_bool(&iter); } -stdx::optional uri::credentials() { +bsoncxx::v_noabi::stdx::optional uri::credentials() { const bson_t* options_bson = libmongoc::uri_get_credentials(_impl->uri_t); const uint8_t* data = bson_get_data(options_bson); return bsoncxx::v_noabi::document::view(data, options_bson->len); } -stdx::optional uri::srv_max_hosts() const { +bsoncxx::v_noabi::stdx::optional uri::srv_max_hosts() const { return _int32_option(_impl->uri_t, MONGOC_URI_SRVMAXHOSTS); } -static stdx::optional _credential_document_option( - mongoc_uri_t* uri, std::string opt_name) { +static bsoncxx::v_noabi::stdx::optional +_credential_document_option(mongoc_uri_t* uri, std::string opt_name) { bson_iter_t iter; const uint8_t* data; uint32_t len; @@ -193,18 +197,19 @@ static stdx::optional _credential_document_opt return bsoncxx::v_noabi::document::view(data, len); } -stdx::optional uri::appname() const { +bsoncxx::v_noabi::stdx::optional uri::appname() const { return _string_option(_impl->uri_t, "appname"); } // Special case. authMechanismProperties are stored as part of libmongoc's credentials. -stdx::optional uri::auth_mechanism_properties() const { +bsoncxx::v_noabi::stdx::optional uri::auth_mechanism_properties() + const { return _credential_document_option(_impl->uri_t, "authMechanismProperties"); } -std::vector uri::compressors() const { +std::vector uri::compressors() const { const bson_t* compressors; - std::vector result; + std::vector result; bson_iter_t iter; compressors = libmongoc::uri_get_compressors(_impl->uri_t); @@ -215,88 +220,91 @@ std::vector uri::compressors() const { } bson_iter_init(&iter, compressors); while (bson_iter_next(&iter)) { - result.push_back(stdx::string_view{bson_iter_key(&iter), bson_iter_key_len(&iter)}); + result.push_back( + bsoncxx::v_noabi::stdx::string_view{bson_iter_key(&iter), bson_iter_key_len(&iter)}); } return result; } -stdx::optional uri::connect_timeout_ms() const { +bsoncxx::v_noabi::stdx::optional uri::connect_timeout_ms() const { return _int32_option(_impl->uri_t, "connectTimeoutMS"); } -stdx::optional uri::direct_connection() const { +bsoncxx::v_noabi::stdx::optional uri::direct_connection() const { return _bool_option(_impl->uri_t, "directConnection"); } -stdx::optional uri::heartbeat_frequency_ms() const { +bsoncxx::v_noabi::stdx::optional uri::heartbeat_frequency_ms() const { return _int32_option(_impl->uri_t, "heartbeatFrequencyMS"); } -stdx::optional uri::local_threshold_ms() const { +bsoncxx::v_noabi::stdx::optional uri::local_threshold_ms() const { return _int32_option(_impl->uri_t, "localThresholdMS"); } -stdx::optional uri::max_pool_size() const { +bsoncxx::v_noabi::stdx::optional uri::max_pool_size() const { return _int32_option(_impl->uri_t, "maxPoolSize"); } -stdx::optional uri::retry_reads() const { +bsoncxx::v_noabi::stdx::optional uri::retry_reads() const { return _bool_option(_impl->uri_t, "retryReads"); } -stdx::optional uri::retry_writes() const { +bsoncxx::v_noabi::stdx::optional uri::retry_writes() const { return _bool_option(_impl->uri_t, "retryWrites"); } -stdx::optional uri::server_selection_timeout_ms() const { +bsoncxx::v_noabi::stdx::optional uri::server_selection_timeout_ms() const { return _int32_option(_impl->uri_t, "serverSelectionTimeoutMS"); } -stdx::optional uri::server_selection_try_once() const { +bsoncxx::v_noabi::stdx::optional uri::server_selection_try_once() const { return _bool_option(_impl->uri_t, "serverSelectionTryOnce"); } -stdx::optional uri::socket_timeout_ms() const { +bsoncxx::v_noabi::stdx::optional uri::socket_timeout_ms() const { return _int32_option(_impl->uri_t, "socketTimeoutMS"); } -stdx::optional uri::tls_allow_invalid_certificates() const { +bsoncxx::v_noabi::stdx::optional uri::tls_allow_invalid_certificates() const { return _bool_option(_impl->uri_t, "tlsAllowInvalidCertificates"); } -stdx::optional uri::tls_allow_invalid_hostnames() const { +bsoncxx::v_noabi::stdx::optional uri::tls_allow_invalid_hostnames() const { return _bool_option(_impl->uri_t, "tlsAllowInvalidHostnames"); } -stdx::optional uri::tls_ca_file() const { +bsoncxx::v_noabi::stdx::optional uri::tls_ca_file() const { return _string_option(_impl->uri_t, "tlsCAFile"); } -stdx::optional uri::tls_certificate_key_file() const { +bsoncxx::v_noabi::stdx::optional +uri::tls_certificate_key_file() const { return _string_option(_impl->uri_t, "tlsCertificateKeyFile"); } -stdx::optional uri::tls_certificate_key_file_password() const { +bsoncxx::v_noabi::stdx::optional +uri::tls_certificate_key_file_password() const { return _string_option(_impl->uri_t, "tlsCertificateKeyFilePassword"); } -stdx::optional uri::tls_disable_certificate_revocation_check() const { +bsoncxx::v_noabi::stdx::optional uri::tls_disable_certificate_revocation_check() const { return _bool_option(_impl->uri_t, "tlsDisableCertificateRevocationCheck"); } -stdx::optional uri::tls_disable_ocsp_endpoint_check() const { +bsoncxx::v_noabi::stdx::optional uri::tls_disable_ocsp_endpoint_check() const { return _bool_option(_impl->uri_t, "tlsDisableOCSPEndpointCheck"); } -stdx::optional uri::tls_insecure() const { +bsoncxx::v_noabi::stdx::optional uri::tls_insecure() const { return _bool_option(_impl->uri_t, "tlsInsecure"); } -stdx::optional uri::wait_queue_timeout_ms() const { +bsoncxx::v_noabi::stdx::optional uri::wait_queue_timeout_ms() const { return _int32_option(_impl->uri_t, "waitQueueTimeoutMS"); } -stdx::optional uri::zlib_compression_level() const { +bsoncxx::v_noabi::stdx::optional uri::zlib_compression_level() const { return _int32_option(_impl->uri_t, "zlibCompressionLevel"); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/validation_criteria.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/validation_criteria.cpp index 413d192b24..588abf49b9 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/validation_criteria.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/validation_criteria.cpp @@ -72,15 +72,18 @@ validation_criteria& validation_criteria::action(validation_criteria::validation return *this; } -const stdx::optional& validation_criteria::rule() const { +const bsoncxx::v_noabi::stdx::optional& +validation_criteria::rule() const { return _rule; } -const stdx::optional& validation_criteria::level() const { +const bsoncxx::v_noabi::stdx::optional& +validation_criteria::level() const { return _level; } -const stdx::optional& validation_criteria::action() const { +const bsoncxx::v_noabi::stdx::optional& +validation_criteria::action() const { return _action; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp index e85229bd72..4256b8fdf6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp @@ -28,7 +28,8 @@ namespace mongocxx { namespace v_noabi { -write_concern::write_concern() : _impl{stdx::make_unique(libmongoc::write_concern_new())} {} +write_concern::write_concern() + : _impl{bsoncxx::v_noabi::stdx::make_unique(libmongoc::write_concern_new())} {} write_concern::write_concern(std::unique_ptr&& implementation) { _impl.reset(implementation.release()); @@ -38,10 +39,12 @@ write_concern::write_concern(write_concern&&) noexcept = default; write_concern& write_concern::operator=(write_concern&&) noexcept = default; write_concern::write_concern(const write_concern& other) - : _impl(stdx::make_unique(libmongoc::write_concern_copy(other._impl->write_concern_t))) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique( + libmongoc::write_concern_copy(other._impl->write_concern_t))) {} write_concern& write_concern::operator=(const write_concern& other) { - _impl.reset(stdx::make_unique(libmongoc::write_concern_copy(other._impl->write_concern_t)) + _impl.reset(bsoncxx::v_noabi::stdx::make_unique( + libmongoc::write_concern_copy(other._impl->write_concern_t)) .release()); return *this; } @@ -86,7 +89,7 @@ void write_concern::acknowledge_level(write_concern::level confirm_level) { libmongoc::write_concern_set_w(_impl->write_concern_t, w); } -void write_concern::tag(stdx::string_view confirm_from) { +void write_concern::tag(bsoncxx::v_noabi::stdx::string_view confirm_from) { libmongoc::write_concern_set_wtag(_impl->write_concern_t, bsoncxx::v_noabi::string::to_string(confirm_from).data()); } @@ -112,9 +115,10 @@ bool write_concern::journal() const { return libmongoc::write_concern_get_journal(_impl->write_concern_t); } -stdx::optional write_concern::nodes() const { +bsoncxx::v_noabi::stdx::optional write_concern::nodes() const { std::int32_t w = libmongoc::write_concern_get_w(_impl->write_concern_t); - return w >= 0 ? stdx::optional{w} : stdx::nullopt; + return w >= 0 ? bsoncxx::v_noabi::stdx::optional{w} + : bsoncxx::v_noabi::stdx::nullopt; } write_concern::level write_concern::acknowledge_level() const { @@ -135,9 +139,10 @@ write_concern::level write_concern::acknowledge_level() const { } } -stdx::optional write_concern::tag() const { +bsoncxx::v_noabi::stdx::optional write_concern::tag() const { const char* tag_str = libmongoc::write_concern_get_wtag(_impl->write_concern_t); - return tag_str ? stdx::make_optional(tag_str) : stdx::nullopt; + return tag_str ? bsoncxx::v_noabi::stdx::make_optional(tag_str) + : bsoncxx::v_noabi::stdx::nullopt; } bool write_concern::majority() const { diff --git a/src/mongocxx/test/bulk_write.cpp b/src/mongocxx/test/bulk_write.cpp index 8e16868cc5..cdf9500983 100644 --- a/src/mongocxx/test/bulk_write.cpp +++ b/src/mongocxx/test/bulk_write.cpp @@ -141,7 +141,7 @@ class update_functor { private: bool* _called; - stdx::optional _expected_collation; + bsoncxx::stdx::optional _expected_collation; bool _expected_upsert = false; bsoncxx::document::view _filter; bsoncxx::document::view _update; @@ -177,7 +177,7 @@ class delete_functor { private: bool* _called; - stdx::optional _expected_collation; + bsoncxx::stdx::optional _expected_collation; bsoncxx::document::view _filter; }; diff --git a/src/mongocxx/test/change_streams.cpp b/src/mongocxx/test/change_streams.cpp index f23e8c0d09..4afd18ae84 100644 --- a/src/mongocxx/test/change_streams.cpp +++ b/src/mongocxx/test/change_streams.cpp @@ -674,7 +674,7 @@ TEST_CASE("Watch a Collection", "[min36]") { SECTION("Can receive it") { auto it = *(x.begin()); - REQUIRE(it["fullDocument"]["a"].get_string().value == stdx::string_view("b")); + REQUIRE(it["fullDocument"]["a"].get_string().value == bsoncxx::stdx::string_view("b")); } SECTION("iterator equals itself") { @@ -692,8 +692,8 @@ TEST_CASE("Watch a Collection", "[min36]") { auto it = x.begin(); auto a = *it; auto b = *it; - REQUIRE(a["fullDocument"]["a"].get_string().value == stdx::string_view("b")); - REQUIRE(b["fullDocument"]["a"].get_string().value == stdx::string_view("b")); + REQUIRE(a["fullDocument"]["a"].get_string().value == bsoncxx::stdx::string_view("b")); + REQUIRE(b["fullDocument"]["a"].get_string().value == bsoncxx::stdx::string_view("b")); } SECTION("Calling .begin multiple times doesn't advance state") { diff --git a/src/mongocxx/test/client.cpp b/src/mongocxx/test/client.cpp index f520a4c387..42fb302913 100644 --- a/src/mongocxx/test/client.cpp +++ b/src/mongocxx/test/client.cpp @@ -82,7 +82,7 @@ TEST_CASE("list databases passes authorizedDatabases option", "[client]") { MOCK_CLIENT; bool called = false; - stdx::optional opts_passed; + bsoncxx::stdx::optional opts_passed; client_find_databases_with_opts->visit([&](mongoc_client_t*, const bson_t* opts) { called = true; @@ -363,7 +363,7 @@ TEST_CASE("A client can create a named database object", "[client]") { database_set_concern->interpose([](mongoc_database_t*, const mongoc_write_concern_t*) {}) .forever(); - stdx::string_view name("database"); + bsoncxx::stdx::string_view name("database"); client mongo_client{uri{}, test_util::add_test_server_api()}; database obtained_database = mongo_client[name]; @@ -384,7 +384,7 @@ TEST_CASE("integration tests for client metadata handshake feature") { bool found_op = false; for (auto&& op_view : cursor) { if (!op_view["appName"] || - op_view["appName"].get_string().value != stdx::string_view(app_name)) { + op_view["appName"].get_string().value != bsoncxx::stdx::string_view(app_name)) { continue; } @@ -398,13 +398,14 @@ TEST_CASE("integration tests for client metadata handshake feature") { REQUIRE(metadata_view["application"]); auto application = metadata_view["application"].get_document(); - REQUIRE(application.view()["name"].get_string().value == stdx::string_view(app_name)); + REQUIRE(application.view()["name"].get_string().value == + bsoncxx::stdx::string_view(app_name)); REQUIRE(metadata_view["driver"]); auto driver = metadata_view["driver"].get_document(); auto driver_view = driver.view(); REQUIRE(driver_view["name"].get_string().value == - stdx::string_view{"mongoc / mongocxx"}); + bsoncxx::stdx::string_view{"mongoc / mongocxx"}); auto version = bsoncxx::string::to_string(driver_view["version"].get_string().value); REQUIRE(version.find(MONGOCXX_VERSION_STRING) != std::string::npos); diff --git a/src/mongocxx/test/client_helpers.cpp b/src/mongocxx/test/client_helpers.cpp index e9c085a000..180eff31ba 100644 --- a/src/mongocxx/test/client_helpers.cpp +++ b/src/mongocxx/test/client_helpers.cpp @@ -67,9 +67,9 @@ document::value get_server_status(const client& client) { return status; } -stdx::optional get_shards(const client& client) { +bsoncxx::stdx::optional get_shards(const client& client) { static auto shards = client["config"]["shards"].find_one({}); - return (shards) ? shards.value() : stdx::optional{}; + return (shards) ? shards.value() : bsoncxx::stdx::optional{}; } } // namespace @@ -96,7 +96,7 @@ bsoncxx::array::value transform_array(bsoncxx::array::view view, for (auto&& element : view) { // Array elements are passed with disengaged key. - auto transformed = fcn({stdx::nullopt, element.get_value()}, context); + auto transformed = fcn({bsoncxx::stdx::nullopt, element.get_value()}, context); // Omit element if transformed is disengaged. if (!transformed) { @@ -228,12 +228,12 @@ bool newer_than(const client& client, std::string version) { return (compare_versions(server_version, version) >= 0); } -std::basic_string convert_hex_string_to_bytes(stdx::string_view hex) { +std::basic_string convert_hex_string_to_bytes(bsoncxx::stdx::string_view hex) { std::basic_string bytes; // Convert each pair of hexadecimal digits into a number and store it in the array. for (std::size_t i = 0; i < hex.size(); i += 2) { - stdx::string_view sub = hex.substr(i, 2); + bsoncxx::stdx::string_view sub = hex.substr(i, 2); bytes.push_back( static_cast(std::stoi(bsoncxx::string::to_string(sub), nullptr, 16))); } @@ -328,7 +328,7 @@ std::string get_topology(const client& client) { return "single"; } -stdx::optional parse_test_file(std::string path) { +bsoncxx::stdx::optional parse_test_file(std::string path) { std::stringstream stream; std::ifstream test_file{path}; @@ -366,7 +366,7 @@ bool is_numeric(types::bson_value::view value) { value.type() == type::k_double; } -static stdx::optional is_type_operator(types::bson_value::view value) { +static bsoncxx::stdx::optional is_type_operator(types::bson_value::view value) { if (value.type() == type::k_document && value.get_document().value["$$type"]) { auto t = value.get_document().value["$$type"].get_string().value; if (t.compare("binData") == 0) { @@ -410,7 +410,7 @@ bool matches(types::bson_value::view main, for (auto&& el : pattern.get_document().value) { match_action action = match_action::k_proceed; if (visitor_fn) { - stdx::optional main_value; + bsoncxx::stdx::optional main_value; if (main_view.find(el.key()) != main_view.end()) { main_value = main_view[el.key()].get_value(); } @@ -476,7 +476,7 @@ bool matches(document::view doc, document::view pattern, match_visitor visitor_f visitor_fn); } -std::string tolowercase(stdx::string_view view) { +std::string tolowercase(bsoncxx::stdx::string_view view) { std::string out; out.reserve(view.size()); for (size_t i = 0; i < view.length(); i++) { diff --git a/src/mongocxx/test/client_helpers.hh b/src/mongocxx/test/client_helpers.hh index f9d0a4b2a8..5b9afad581 100644 --- a/src/mongocxx/test/client_helpers.hh +++ b/src/mongocxx/test/client_helpers.hh @@ -32,7 +32,6 @@ #include #include #include -#include #include @@ -126,10 +125,12 @@ std::string get_hosts(const client& client = {uri{}, add_test_server_api()}); /// /// Returns none if the path is not found. /// -stdx::optional parse_test_file(std::string path); +bsoncxx::stdx::optional parse_test_file(std::string path); -using item_t = std::pair, bsoncxx::types::bson_value::view>; -using xformer_t = std::function(item_t, bsoncxx::builder::basic::array*)>; +using item_t = std::pair, + bsoncxx::types::bson_value::view>; +using xformer_t = + std::function(item_t, bsoncxx::builder::basic::array*)>; // // Transforms a document and returns a copy of it. @@ -195,7 +196,7 @@ bool matches(bsoncxx::document::view doc, } \ } while (0) -std::string tolowercase(stdx::string_view view); +std::string tolowercase(bsoncxx::stdx::string_view view); void check_outcome_collection(mongocxx::collection* coll, bsoncxx::document::view expected); diff --git a/src/mongocxx/test/client_session.cpp b/src/mongocxx/test/client_session.cpp index 4823c2e1d6..6350b95279 100644 --- a/src/mongocxx/test/client_session.cpp +++ b/src/mongocxx/test/client_session.cpp @@ -124,7 +124,7 @@ TEST_CASE("session options", "[session]") { options::client_session opts; - // Unfortunately, stdx::nullopt doesn't always play well with others, so we'll use + // Unfortunately, bsoncxx::stdx::nullopt doesn't always play well with others, so we'll use // an enumeration: enum struct optional_state { empty, no, yes }; @@ -215,8 +215,8 @@ TEST_CASE("session", "[session]") { SECTION("pool") { // "Pool is LIFO" test from Driver Sessions Spec. - auto session_a = stdx::make_unique(c.start_session()); - auto session_b = stdx::make_unique(c.start_session()); + auto session_a = bsoncxx::stdx::make_unique(c.start_session()); + auto session_b = bsoncxx::stdx::make_unique(c.start_session()); auto a_id = value(session_a->id()); auto b_id = value(session_b->id()); @@ -227,9 +227,9 @@ TEST_CASE("session", "[session]") { session_a = nullptr; session_b = nullptr; - auto session_c = stdx::make_unique(c.start_session()); + auto session_c = bsoncxx::stdx::make_unique(c.start_session()); REQUIRE(session_c->id() == b_id); - auto session_d = stdx::make_unique(c.start_session()); + auto session_d = bsoncxx::stdx::make_unique(c.start_session()); REQUIRE(session_d->id() == a_id); } diff --git a/src/mongocxx/test/client_side_encryption.cpp b/src/mongocxx/test/client_side_encryption.cpp index ced360d6bd..7fb75f8ddf 100644 --- a/src/mongocxx/test/client_side_encryption.cpp +++ b/src/mongocxx/test/client_side_encryption.cpp @@ -93,7 +93,7 @@ using bsoncxx::types::bson_value::make_value; using namespace mongocxx; // Takes a path relative to the CLIENT_SIDE_ENCRYPTION_TESTS_PATH variable, with leading '/'. -bsoncxx::document::value _doc_from_file(stdx::string_view sub_path) { +bsoncxx::document::value _doc_from_file(bsoncxx::stdx::string_view sub_path) { char* encryption_tests_path = std::getenv("CLIENT_SIDE_ENCRYPTION_TESTS_PATH"); REQUIRE(encryption_tests_path); @@ -242,7 +242,7 @@ void _add_cse_opts(options::client_encryption* opts, template void run_datakey_and_double_encryption(Callable create_data_key, - stdx::string_view provider, + bsoncxx::stdx::string_view provider, client* setup_client, client* client_encrypted, client_encryption* client_encryption, @@ -314,7 +314,7 @@ void run_datakey_and_double_encryption(Callable create_data_key, REQUIRE(res); auto decrypted_bson_val = res->view()["value"]; REQUIRE(decrypted_bson_val.type() == bsoncxx::type::k_string); - REQUIRE(decrypted_bson_val.get_string().value == stdx::string_view{"hello there"}); + REQUIRE(decrypted_bson_val.get_string().value == bsoncxx::stdx::string_view{"hello there"}); // 3. Call client_encryption.encrypt() with the value "hello there", the algorithm // AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic, and the key_alt_name of provider_altname @@ -950,58 +950,58 @@ void _run_corpus_test(bool use_schema_map) { // If method is auto, copy the field to corpus_copied. // If method is explicit, encrypt explicitly. - if (method == stdx::string_view("auto")) { + if (method == bsoncxx::stdx::string_view("auto")) { corpus_copied_builder.append(kvp(field_name, ele.get_value())); - } else if (method == stdx::string_view{"explicit"}) { + } else if (method == bsoncxx::stdx::string_view{"explicit"}) { options::encrypt encrypt_opts; // Encrypt with the algorithm described by algo - if (algo == stdx::string_view{"rand"}) { + if (algo == bsoncxx::stdx::string_view{"rand"}) { encrypt_opts.algorithm(options::encrypt::encryption_algorithm::k_random); - } else if (algo == stdx::string_view{"det"}) { + } else if (algo == bsoncxx::stdx::string_view{"det"}) { encrypt_opts.algorithm(options::encrypt::encryption_algorithm::k_deterministic); } else { throw exception{error_code::k_invalid_parameter, "unsupported algorithm"}; } - if (identifier == stdx::string_view{"id"}) { - if (kms == stdx::string_view{"local"}) { + if (identifier == bsoncxx::stdx::string_view{"id"}) { + if (kms == bsoncxx::stdx::string_view{"local"}) { // If kms is local set the key_id to the UUID with base64 value // LOCALAAAAAAAAAAAAAAAAA==. encrypt_opts.key_id(local_key_value.view()); - } else if (kms == stdx::string_view{"aws"}) { + } else if (kms == bsoncxx::stdx::string_view{"aws"}) { // If kms is aws set the key_id to the UUID with base64 value // AWSAAAAAAAAAAAAAAAAAAA==. encrypt_opts.key_id(aws_key_value.view()); - } else if (kms == stdx::string_view{"azure"}) { + } else if (kms == bsoncxx::stdx::string_view{"azure"}) { // If kms is azure set the key_id to the UUID with base64 value // AZUREAAAAAAAAAAAAAAAAA==. encrypt_opts.key_id(azure_key_value.view()); - } else if (kms == stdx::string_view("gcp")) { + } else if (kms == bsoncxx::stdx::string_view("gcp")) { // If kms is gcp set the key_id to the UUID with base64 value // GCPAAAAAAAAAAAAAAAAAAA==. encrypt_opts.key_id(gcp_key_value.view()); - } else if (kms == stdx::string_view("kmip")) { + } else if (kms == bsoncxx::stdx::string_view("kmip")) { // If kms is kmip set the key_id to the UUID with base64 value // KMIPAAAAAAAAAAAAAAAAAA==. encrypt_opts.key_id(kmip_key_value.view()); } else { throw exception{error_code::k_invalid_parameter, "unsupported kms identifier"}; } - } else if (identifier == stdx::string_view{"altname"}) { - if (kms == stdx::string_view{"local"}) { + } else if (identifier == bsoncxx::stdx::string_view{"altname"}) { + if (kms == bsoncxx::stdx::string_view{"local"}) { // If kms is local set the key_alt_name to "local". encrypt_opts.key_alt_name("local"); - } else if (kms == stdx::string_view{"aws"}) { + } else if (kms == bsoncxx::stdx::string_view{"aws"}) { // If kms is aws set the key_alt_name to "aws". encrypt_opts.key_alt_name("aws"); - } else if (kms == stdx::string_view("azure")) { + } else if (kms == bsoncxx::stdx::string_view("azure")) { // If kms is azure set the key_alt_name to "azure". encrypt_opts.key_alt_name("azure"); - } else if (kms == stdx::string_view("gcp")) { + } else if (kms == bsoncxx::stdx::string_view("gcp")) { // If kms is gcp set the key_alt_name to "gcp". encrypt_opts.key_alt_name("gcp"); - } else if (kms == stdx::string_view("kmip")) { + } else if (kms == bsoncxx::stdx::string_view("kmip")) { // If kms is kmip set the key_alt_name to "kmip". encrypt_opts.key_alt_name("kmip"); } else { @@ -1082,13 +1082,13 @@ void _run_corpus_test(bool use_schema_map) { // If the algo is det, that the value equals the value of the corresponding field // in corpus_encrypted_actual. - if (algo == stdx::string_view{"det"}) { + if (algo == bsoncxx::stdx::string_view{"det"}) { REQUIRE(value == actual_field["value"].get_value()); } // If the algo is rand and allowed is true, that the value does not equal the value // of the corresponding field in corpus_encrypted_actual. - if (algo == stdx::string_view{"rand"} && allowed) { + if (algo == bsoncxx::stdx::string_view{"rand"} && allowed) { REQUIRE(value != actual_field["value"].get_value()); } @@ -1140,11 +1140,12 @@ void _round_trip(mongocxx::client_encryption* client_encryption, REQUIRE(decrypted_val == to_encrypt); } -void _run_endpoint_test(mongocxx::client* setup_client, - bsoncxx::document::view masterkey, - std::string kms_provider, - stdx::optional error_msg = stdx::nullopt, - stdx::optional invalid_error_msg = stdx::nullopt) { +void _run_endpoint_test( + mongocxx::client* setup_client, + bsoncxx::document::view masterkey, + std::string kms_provider, + bsoncxx::stdx::optional error_msg = bsoncxx::stdx::nullopt, + bsoncxx::stdx::optional invalid_error_msg = bsoncxx::stdx::nullopt) { INFO("masterkey" << bsoncxx::to_json(masterkey)); mongocxx::options::client_encryption ce_opts; @@ -1392,7 +1393,7 @@ TEST_CASE("Custom endpoint", "[client_side_encryption]") { _run_endpoint_test(&setup_client, azure_masterkey.view(), "azure", - stdx::nullopt, + bsoncxx::stdx::nullopt, {{"Failed to resolve doesnotexist.invalid: generic server error"}}); } @@ -1424,7 +1425,7 @@ TEST_CASE("Custom endpoint", "[client_side_encryption]") { _run_endpoint_test(&setup_client, gcp_masterkey.view(), "gcp", - stdx::nullopt, + bsoncxx::stdx::nullopt, {{"Failed to resolve doesnotexist.invalid: generic server error"}}); } @@ -1468,7 +1469,7 @@ TEST_CASE("Custom endpoint", "[client_side_encryption]") { _run_endpoint_test(&setup_client, kmip_masterkey.view(), "kmip", - stdx::nullopt, + bsoncxx::stdx::nullopt, {{"Failed to resolve doesnotexist.local: generic server error"}}); } @@ -1823,9 +1824,9 @@ TEST_CASE("KMS TLS wrong host certificate", "[client_side_encryption]") { kms_tls_wrong_host_cert_matcher()); } -bsoncxx::document::value make_kms_providers_with_custom_endpoints(stdx::string_view azure, - stdx::string_view gcp, - stdx::string_view kmip) { +bsoncxx::document::value make_kms_providers_with_custom_endpoints(bsoncxx::stdx::string_view azure, + bsoncxx::stdx::string_view gcp, + bsoncxx::stdx::string_view kmip) { bsoncxx::builder::basic::document kms_doc; kms_doc.append(kvp("aws", [&](sub_document subdoc) { @@ -1859,7 +1860,7 @@ enum struct with_certs { none, ca_only, cert_only, both }; bsoncxx::document::value make_tls_opts_with_certs(with_certs with) { bsoncxx::builder::basic::document tls_opts; - stdx::string_view providers[] = {"aws", "azure", "gcp", "kmip"}; + bsoncxx::stdx::string_view providers[] = {"aws", "azure", "gcp", "kmip"}; for (const auto& provider : providers) { tls_opts.append(kvp(provider, [&](sub_document subdoc) { @@ -1880,9 +1881,9 @@ bsoncxx::document::value make_tls_opts_with_certs(with_certs with) { } client_encryption make_prose_test_11_ce(mongocxx::client* client, - stdx::string_view azure, - stdx::string_view gcp, - stdx::string_view kmip, + bsoncxx::stdx::string_view azure, + bsoncxx::stdx::string_view gcp, + bsoncxx::stdx::string_view kmip, with_certs with) { options::client_encryption cse_opts; cse_opts.key_vault_client(client); @@ -2489,7 +2490,7 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") { struct which { std::string kms_provider; - stdx::optional master_key; + bsoncxx::stdx::optional master_key; }; which w = GENERATE(Catch::Generators::values({ @@ -2499,7 +2500,7 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") { kvp("key", "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0"))}, // When testing 'local', use master_key of 'null' - {"local", stdx::nullopt}, + {"local", bsoncxx::stdx::nullopt}, })); options::client_encryption cse_opts; @@ -2526,7 +2527,8 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") { create_opts, fin_options, w.kms_provider, - w.master_key ? stdx::make_optional(w.master_key->view()) : stdx::nullopt); + w.master_key ? bsoncxx::stdx::make_optional(w.master_key->view()) + : bsoncxx::stdx::nullopt); CAPTURE(fin_options, coll); try { coll.insert_one(make_document(kvp("ssn", "123-45-6789"))); @@ -2545,7 +2547,8 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") { create_opts, fin_options, w.kms_provider, - w.master_key ? stdx::make_optional(w.master_key->view()) : stdx::nullopt); + w.master_key ? bsoncxx::stdx::make_optional(w.master_key->view()) + : bsoncxx::stdx::nullopt); CAPTURE(fin_options, coll); FAIL_CHECK("Did not throw"); } catch (const mongocxx::operation_exception& e) { @@ -2568,7 +2571,8 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") { create_opts, fin_options, w.kms_provider, - w.master_key ? stdx::make_optional(w.master_key->view()) : stdx::nullopt); + w.master_key ? bsoncxx::stdx::make_optional(w.master_key->view()) + : bsoncxx::stdx::nullopt); CAPTURE(fin_options, coll); FAIL_CHECK("Did not throw"); } catch (const mongocxx::operation_exception& e) { @@ -2591,7 +2595,8 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") { create_opts, fin_options, w.kms_provider, - w.master_key ? stdx::make_optional(w.master_key->view()) : stdx::nullopt); + w.master_key ? bsoncxx::stdx::make_optional(w.master_key->view()) + : bsoncxx::stdx::nullopt); CAPTURE(fin_options, coll); bsoncxx::types::b_string ssn{"123-45-6789"}; diff --git a/src/mongocxx/test/collection.cpp b/src/mongocxx/test/collection.cpp index 8e0c2bb811..4d8adf5204 100644 --- a/src/mongocxx/test/collection.cpp +++ b/src/mongocxx/test/collection.cpp @@ -70,7 +70,7 @@ TEST_CASE("mongocxx::collection copy constructor", "[collection]") { collection collection_a = db["a"]; collection collection_b{collection_a}; REQUIRE(collection_b); - REQUIRE(collection_b.name() == stdx::string_view{"a"}); + REQUIRE(collection_b.name() == bsoncxx::stdx::string_view{"a"}); } SECTION("constructing from invalid") { @@ -91,7 +91,7 @@ TEST_CASE("mongocxx::collection copy assignment operator", "[collection]") { collection collection_b = db["b1"]; collection_b = collection_a; REQUIRE(collection_b); - REQUIRE(collection_b.name() == stdx::string_view{"a1"}); + REQUIRE(collection_b.name() == bsoncxx::stdx::string_view{"a1"}); } SECTION("assigning invalid to valid") { @@ -106,7 +106,7 @@ TEST_CASE("mongocxx::collection copy assignment operator", "[collection]") { collection collection_b; collection_b = collection_a; REQUIRE(collection_b); - REQUIRE(collection_b.name() == stdx::string_view{"a3"}); + REQUIRE(collection_b.name() == bsoncxx::stdx::string_view{"a3"}); } SECTION("assigning invalid to invalid") { @@ -137,17 +137,17 @@ TEST_CASE("collection renaming", "[collection]") { coll.insert_one(filter.view()); // Ensure that the collection exists. other_coll.insert_one({}); - REQUIRE(coll.name() == stdx::string_view(collname)); + REQUIRE(coll.name() == bsoncxx::stdx::string_view(collname)); std::string new_name{"mongo_cxx_newname"}; coll.rename(new_name, false); - REQUIRE(coll.name() == stdx::string_view(new_name)); + REQUIRE(coll.name() == bsoncxx::stdx::string_view(new_name)); REQUIRE(coll.find_one(filter.view(), {})); coll.rename(other_collname, true); - REQUIRE(coll.name() == stdx::string_view(other_collname)); + REQUIRE(coll.name() == bsoncxx::stdx::string_view(other_collname)); REQUIRE(coll.find_one(filter.view(), {})); coll.drop(); @@ -203,7 +203,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { } SECTION("insert_one returns correct result object", "[collection]") { - stdx::string_view expected_id{"foo"}; + bsoncxx::stdx::string_view expected_id{"foo"}; auto doc = make_document(kvp("_id", expected_id)); @@ -249,7 +249,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options::insert options; options.bypass_document_validation(true); - stdx::optional result; + bsoncxx::stdx::optional result; REQUIRE_NOTHROW(result = coll.insert_one(doc.view(), options)); REQUIRE(result); REQUIRE(result->result().inserted_count() == 1); @@ -337,7 +337,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { // Verify result->inserted_ids() is correct: auto id_map = result->inserted_ids(); REQUIRE(id_map[0].type() == bsoncxx::type::k_string); - REQUIRE(id_map[0].get_string().value == stdx::string_view{"foo"}); + REQUIRE(id_map[0].get_string().value == bsoncxx::stdx::string_view{"foo"}); REQUIRE(id_map[1].type() == bsoncxx::type::k_oid); auto second_inserted_doc = coll.find_one(make_document(kvp("x", 2))); REQUIRE(second_inserted_doc); @@ -420,7 +420,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options::insert options; options.bypass_document_validation(true); - stdx::optional result; + bsoncxx::stdx::optional result; REQUIRE_NOTHROW(result = coll.insert_many(docs, options)); REQUIRE(result); @@ -434,7 +434,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { // Verify result->inserted_ids() is correct: auto id_map = result->inserted_ids(); REQUIRE(id_map[0].type() == bsoncxx::type::k_string); - REQUIRE(id_map[0].get_string().value == stdx::string_view{"foo"}); + REQUIRE(id_map[0].get_string().value == bsoncxx::stdx::string_view{"foo"}); REQUIRE(id_map[1].type() == bsoncxx::type::k_oid); auto second_inserted_doc = coll.find_one(make_document(kvp("x", 2))); REQUIRE(second_inserted_doc); @@ -474,7 +474,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { index_view indexes = coll.indexes(); auto key = make_document(kvp("a", 1)); - stdx::optional result = indexes.create_one(key.view()); + bsoncxx::stdx::optional result = indexes.create_one(key.view()); auto find_opts = options::find{}.return_key(true); auto cursor = coll.find(doc.view(), find_opts); @@ -563,7 +563,8 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { auto result = coll.find_one(bson.view()); REQUIRE(result); - REQUIRE(result->view()["name"].get_string().value == stdx::string_view("Charlotte")); + REQUIRE(result->view()["name"].get_string().value == + bsoncxx::stdx::string_view("Charlotte")); // Try adding stages with append_stage(s) instead pipeline array_update; @@ -587,8 +588,10 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { result = coll.find_one(bson.view()); REQUIRE(result); - REQUIRE(result->view()["lastname"].get_string().value == stdx::string_view("Krause")); - REQUIRE(result->view()["department"].get_string().value == stdx::string_view("VIS")); + REQUIRE(result->view()["lastname"].get_string().value == + bsoncxx::stdx::string_view("Krause")); + REQUIRE(result->view()["department"].get_string().value == + bsoncxx::stdx::string_view("VIS")); REQUIRE(result->view()["count"].get_int32().value == 1); } @@ -644,7 +647,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { coll.insert_one(doc.view()); - stdx::optional result; + bsoncxx::stdx::optional result; REQUIRE_NOTHROW(result = coll.update_one(doc.view(), update_doc.view(), options)); REQUIRE(result); @@ -757,7 +760,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { coll.insert_one(doc.view()); coll.insert_one(doc.view()); - stdx::optional result; + bsoncxx::stdx::optional result; REQUIRE_NOTHROW(result = coll.update_many(doc.view(), update_doc.view(), options)); REQUIRE(result); @@ -924,7 +927,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { coll.insert_one(b1.view()); - stdx::optional result; + bsoncxx::stdx::optional result; REQUIRE_NOTHROW(result = coll.replace_one(b1.view(), b2.view(), options)); REQUIRE(result); REQUIRE(result->result().matched_count() == 1); @@ -1228,7 +1231,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { auto doc = coll.find_one_and_replace(criteria.view(), replacement.view()); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"foo"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"foo"}); } SECTION("with return replacement returns new") { @@ -1244,7 +1247,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options.return_document(options::return_document::k_after); auto doc = coll.find_one_and_replace(criteria.view(), replacement.view(), options); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"bar"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"bar"}); } SECTION("with collation") { @@ -1272,7 +1275,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { auto doc = coll.find_one_and_replace(collation_criteria.view(), replacement.view(), options); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"foo"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"foo"}); } SECTION("bad criteria returns negative optional") { @@ -1305,11 +1308,11 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options.return_document(options::return_document::k_after); options.bypass_document_validation(true); - stdx::optional doc; + bsoncxx::stdx::optional doc; REQUIRE_NOTHROW( doc = coll.find_one_and_replace(criteria.view(), replacement.view(), options)); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"bar"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"bar"}); } } @@ -1331,7 +1334,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"foo"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"foo"}); } SECTION("with return update returns new") { @@ -1347,7 +1350,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options.return_document(options::return_document::k_after); auto doc = coll.find_one_and_update(criteria.view(), update.view(), options); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"bar"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"bar"}); } SECTION("with collation") { @@ -1374,7 +1377,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options.write_concern(default_wc); auto doc = coll.find_one_and_update(collation_criteria.view(), update.view(), options); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"foo"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"foo"}); } SECTION("bad criteria returns negative optional") { @@ -1407,11 +1410,11 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options.return_document(options::return_document::k_after); options.bypass_document_validation(true); - stdx::optional doc; + bsoncxx::stdx::optional doc; REQUIRE_NOTHROW(doc = coll.find_one_and_update(criteria.view(), update.view(), options)); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"bar"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"bar"}); } } @@ -1432,7 +1435,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"foo"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"foo"}); REQUIRE(coll.count_documents({}) == 1); } @@ -1459,7 +1462,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { options.write_concern(default_wc); auto doc = coll.find_one_and_delete(collation_criteria.view(), options); REQUIRE(doc); - REQUIRE(doc->view()["x"].get_string().value == stdx::string_view{"foo"}); + REQUIRE(doc->view()["x"].get_string().value == bsoncxx::stdx::string_view{"foo"}); } } @@ -1774,7 +1777,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { pipeline.project(make_document(kvp("x", 1))); pipeline.out(bsoncxx::string::to_string(coll_out.name())); - stdx::optional cursor; + bsoncxx::stdx::optional cursor; REQUIRE_NOTHROW(cursor = coll_in.aggregate(pipeline, options)); auto results = get_results(std::move(*cursor)); @@ -2044,7 +2047,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { cbulk.append(model::insert_one{std::move(doc1)}); cbulk.append(model::insert_one{std::move(doc2)}); - stdx::optional result; + bsoncxx::stdx::optional result; REQUIRE_NOTHROW(result = cbulk.execute()); REQUIRE(result); @@ -2086,12 +2089,12 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { auto res_doc = results[0].view(); auto values_array = res_doc["values"].get_array().value; - std::vector distinct_values; + std::vector distinct_values; for (auto&& value : values_array) { distinct_values.push_back(value.get_string().value); } - const auto assert_contains_one = [&](stdx::string_view val) { + const auto assert_contains_one = [&](bsoncxx::stdx::string_view val) { REQUIRE(std::count(distinct_values.begin(), distinct_values.end(), val) == 1); }; @@ -2117,7 +2120,7 @@ TEST_CASE("CRUD functionality", "[driver::collection]") { auto result = *iter; auto values = result["values"].get_array().value; REQUIRE(std::distance(values.begin(), values.end()) == 1); - REQUIRE(values[0].get_string().value == stdx::string_view{"foo"}); + REQUIRE(values[0].get_string().value == bsoncxx::stdx::string_view{"foo"}); } } @@ -2148,7 +2151,7 @@ TEST_CASE("read_concern is inherited from parent", "[collection]") { } void find_index_and_validate(collection& coll, - stdx::string_view index_name, + bsoncxx::stdx::string_view index_name, const std::function& validate = [](bsoncxx::document::view) {}) { auto cursor = coll.list_indexes(); @@ -2246,7 +2249,7 @@ TEST_CASE("create_index tests", "[collection]") { coll.drop(); coll.insert_one({}); // Ensure that the collection exists. - mongocxx::stdx::string_view index_name{"succeeds_with_options"}; + bsoncxx::stdx::string_view index_name{"succeeds_with_options"}; bsoncxx::document::value keys = make_document(kvp("cccc", 1)); @@ -2531,7 +2534,7 @@ TEST_CASE("find_and_x operations append write concern correctly", "[collection]" collection.drop(); collection.insert_one(make_document(kvp("x", 1))); - stdx::optional doc; + bsoncxx::stdx::optional doc; /* 4.4. servers will reply with an error, causing an exception. */ /* find_one_and_update */ mongocxx::options::find_one_and_update find_one_and_update_opts; diff --git a/src/mongocxx/test/collection_mocked.cpp b/src/mongocxx/test/collection_mocked.cpp index e5cc08a25e..2498a2b59d 100644 --- a/src/mongocxx/test/collection_mocked.cpp +++ b/src/mongocxx/test/collection_mocked.cpp @@ -394,13 +394,13 @@ TEST_CASE("Collection", "[collection]") { auto collection_find_called = false; auto find_doc = make_document(kvp("a", 1)); auto doc = find_doc.view(); - mongocxx::stdx::optional expected_allow_partial_results; - mongocxx::stdx::optional expected_comment{}; - mongocxx::stdx::optional expected_cursor_type{}; - mongocxx::stdx::optional expected_hint{}; - mongocxx::stdx::optional expected_no_cursor_timeout; - mongocxx::stdx::optional expected_sort{}; - mongocxx::stdx::optional expected_read_preference{}; + bsoncxx::stdx::optional expected_allow_partial_results; + bsoncxx::stdx::optional expected_comment{}; + bsoncxx::stdx::optional expected_cursor_type{}; + bsoncxx::stdx::optional expected_hint{}; + bsoncxx::stdx::optional expected_no_cursor_timeout; + bsoncxx::stdx::optional expected_sort{}; + bsoncxx::stdx::optional expected_read_preference{}; collection_find_with_opts->interpose([&](mongoc_collection_t*, const bson_t* filter, @@ -536,7 +536,7 @@ TEST_CASE("Collection", "[collection]") { auto expected_order_setting = false; auto expect_set_bypass_document_validation_called = false; auto expected_bypass_document_validation = false; - mongocxx::stdx::optional expected_hint{}; + bsoncxx::stdx::optional expected_hint{}; auto modification_doc = make_document(kvp("cool", "wow"), kvp("foo", "bar")); diff --git a/src/mongocxx/test/database.cpp b/src/mongocxx/test/database.cpp index eacd9e4e53..d4979fec66 100644 --- a/src/mongocxx/test/database.cpp +++ b/src/mongocxx/test/database.cpp @@ -84,7 +84,7 @@ TEST_CASE("mongocxx::database copy constructor", "[database]") { database database_a = client["a"]; database database_b{database_a}; REQUIRE(database_b); - REQUIRE(database_b.name() == stdx::string_view{"a"}); + REQUIRE(database_b.name() == bsoncxx::stdx::string_view{"a"}); } SECTION("constructing from invalid") { @@ -104,7 +104,7 @@ TEST_CASE("mongocxx::database copy assignment operator", "[database]") { database database_b = client["b1"]; database_b = database_a; REQUIRE(database_b); - REQUIRE(database_b.name() == stdx::string_view{"a1"}); + REQUIRE(database_b.name() == bsoncxx::stdx::string_view{"a1"}); } SECTION("assigning invalid to valid") { @@ -119,7 +119,7 @@ TEST_CASE("mongocxx::database copy assignment operator", "[database]") { database database_b; database_b = database_a; REQUIRE(database_b); - REQUIRE(database_b.name() == stdx::string_view{"a3"}); + REQUIRE(database_b.name() == bsoncxx::stdx::string_view{"a3"}); } SECTION("assigning invalid to invalid") { @@ -131,7 +131,7 @@ TEST_CASE("mongocxx::database copy assignment operator", "[database]") { } TEST_CASE("A database", "[database]") { - stdx::string_view database_name{"database"}; + bsoncxx::stdx::string_view database_name{"database"}; MOCK_CLIENT; MOCK_DATABASE; @@ -143,7 +143,7 @@ TEST_CASE("A database", "[database]") { bool called = false; get_database->interpose([&](mongoc_client_t*, const char* d_name) { called = true; - REQUIRE(database_name == stdx::string_view{d_name}); + REQUIRE(database_name == bsoncxx::stdx::string_view{d_name}); return nullptr; }); @@ -290,7 +290,7 @@ TEST_CASE("A database", "[database]") { SECTION("may create a collection") { MOCK_COLLECTION; - stdx::string_view collection_name{"dummy_collection"}; + bsoncxx::stdx::string_view collection_name{"dummy_collection"}; database database = mongo_client[database_name]; collection obtained_collection = database[collection_name]; REQUIRE(obtained_collection.name() == collection_name); @@ -325,7 +325,7 @@ TEST_CASE("Database integration tests", "[database]") { instance::current(); client mongo_client{uri{}, test_util::add_test_server_api()}; - stdx::string_view database_name{"database"}; + bsoncxx::stdx::string_view database_name{"database"}; database database = mongo_client[database_name]; auto case_insensitive_collation = make_document(kvp("locale", "en_US"), kvp("strength", 2)); @@ -360,12 +360,13 @@ TEST_CASE("Database integration tests", "[database]") { auto results = get_results(std::move(cursor)); REQUIRE(results.size() == 1); - REQUIRE(results[0].view()["name"].get_string().value == stdx::string_view("Jane")); + REQUIRE(results[0].view()["name"].get_string().value == + bsoncxx::stdx::string_view("Jane")); } } SECTION("A database may create a collection via create_collection") { - stdx::string_view collection_name{"collection_create_with_opts"}; + bsoncxx::stdx::string_view collection_name{"collection_create_with_opts"}; SECTION("without any options") { database[collection_name].drop(); @@ -425,7 +426,7 @@ TEST_CASE("Database integration tests", "[database]") { } SECTION("A database may be dropped") { - stdx::string_view collection_name{"collection_drop"}; + bsoncxx::stdx::string_view collection_name{"collection_drop"}; database[collection_name].drop(); database.create_collection(collection_name); @@ -581,7 +582,7 @@ TEST_CASE("serviceId presence depends on load-balancing mode") { // Adding ?loadBalanced=true results in an error in the C driver because // the initial hello response from the server does not include serviceId. client mongo_client(uri("mongodb://localhost:27017/"), client_opts); - stdx::string_view database_name{"database"}; + bsoncxx::stdx::string_view database_name{"database"}; database database = mongo_client[database_name]; // Run a command, triggering start and completion events: diff --git a/src/mongocxx/test/gridfs/bucket.cpp b/src/mongocxx/test/gridfs/bucket.cpp index 7d4cb20606..ecfb919701 100644 --- a/src/mongocxx/test/gridfs/bucket.cpp +++ b/src/mongocxx/test/gridfs/bucket.cpp @@ -67,7 +67,7 @@ void validate_gridfs_file(database db, expected_contents.size()); REQUIRE(files_doc->view()["chunkSize"].get_int32().value == expected_chunk_size); REQUIRE(files_doc->view()["filename"].get_string().value == - stdx::string_view(expected_file_name)); + bsoncxx::stdx::string_view(expected_file_name)); // md5 is deprecated in GridFS, we don't include it: // https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.md @@ -125,7 +125,7 @@ void validate_gridfs_file( REQUIRE(files_doc->view()["length"].get_int64().value == expected_length); REQUIRE(files_doc->view()["chunkSize"].get_int32().value == expected_chunk_size); REQUIRE(files_doc->view()["filename"].get_string().value == - stdx::string_view(expected_file_name)); + bsoncxx::stdx::string_view(expected_file_name)); std::size_t i = 0; @@ -239,7 +239,7 @@ TEST_CASE("mongocxx::gridfs::bucket copy constructor", "[gridfs::bucket]") { gridfs::bucket bucket_a = db.gridfs_bucket(options::gridfs::bucket{}.bucket_name("a")); gridfs::bucket bucket_b{bucket_a}; REQUIRE(bucket_b); - REQUIRE(bucket_b.bucket_name() == stdx::string_view{"a"}); + REQUIRE(bucket_b.bucket_name() == bsoncxx::stdx::string_view{"a"}); } SECTION("constructing from invalid") { @@ -260,7 +260,7 @@ TEST_CASE("mongocxx::gridfs::bucket copy assignment operator", "[gridfs::bucket] gridfs::bucket bucket_b = db.gridfs_bucket(options::gridfs::bucket{}.bucket_name("b")); bucket_b = bucket_a; REQUIRE(bucket_b); - REQUIRE(bucket_b.bucket_name() == stdx::string_view{"a"}); + REQUIRE(bucket_b.bucket_name() == bsoncxx::stdx::string_view{"a"}); } SECTION("assigning invalid to valid") { @@ -275,7 +275,7 @@ TEST_CASE("mongocxx::gridfs::bucket copy assignment operator", "[gridfs::bucket] gridfs::bucket bucket_b; bucket_b = bucket_a; REQUIRE(bucket_b); - REQUIRE(bucket_b.bucket_name() == stdx::string_view{"a"}); + REQUIRE(bucket_b.bucket_name() == bsoncxx::stdx::string_view{"a"}); } SECTION("assigning invalid to invalid") { @@ -356,9 +356,9 @@ TEST_CASE("downloading throws error when files document is corrupt", "[gridfs::b const std::int32_t k_expected_chunk_size_bytes = 255 * 1024; // Default chunk size. const std::int64_t k_expected_file_length = 1024 * 1024; - stdx::optional chunk_size{ + bsoncxx::stdx::optional chunk_size{ bsoncxx::types::bson_value::view{bsoncxx::types::b_int32{k_expected_chunk_size_bytes}}}; - stdx::optional length{ + bsoncxx::stdx::optional length{ bsoncxx::types::bson_value::view{bsoncxx::types::b_int64{k_expected_file_length}}}; bool expect_success = false; @@ -409,7 +409,7 @@ TEST_CASE("downloading throws error when files document is corrupt", "[gridfs::b run_test(); } SECTION("missing chunk size") { - chunk_size = stdx::nullopt; + chunk_size = bsoncxx::stdx::nullopt; run_test(); } @@ -423,7 +423,7 @@ TEST_CASE("downloading throws error when files document is corrupt", "[gridfs::b run_test(); } SECTION("missing length") { - length = stdx::nullopt; + length = bsoncxx::stdx::nullopt; run_test(); } @@ -454,15 +454,15 @@ TEST_CASE("downloading throws error when chunks document is corrupt", "[gridfs:: const std::uint8_t k_expected_data_byte = 'd'; - stdx::optional n{ + bsoncxx::stdx::optional n{ bsoncxx::types::bson_value::view{bsoncxx::types::b_int32{0}}}; - stdx::optional data{bsoncxx::types::bson_value::view{ + bsoncxx::stdx::optional data{bsoncxx::types::bson_value::view{ bsoncxx::types::b_binary{bsoncxx::binary_sub_type::k_binary, 1, &k_expected_data_byte}}}; bool expect_success = true; // Tests for invalid n. SECTION("missing n") { - n = stdx::nullopt; + n = bsoncxx::stdx::nullopt; expect_success = false; } SECTION("wrong type for n") { @@ -472,7 +472,7 @@ TEST_CASE("downloading throws error when chunks document is corrupt", "[gridfs:: // Tests for invalid data. SECTION("missing data") { - data = stdx::nullopt; + data = bsoncxx::stdx::nullopt; expect_success = false; } SECTION("wrong type for data") { @@ -503,7 +503,7 @@ TEST_CASE("downloading throws error when chunks document is corrupt", "[gridfs:: gridfs::downloader downloader = bucket.open_download_stream(bsoncxx::types::bson_value::view{bsoncxx::types::b_int32{0}}); auto downloader_read_one = [&downloader]() { - stdx::optional result; + bsoncxx::stdx::optional result; std::uint8_t byte; std::size_t bytes_downloaded = downloader.read(&byte, 1); if (bytes_downloaded > 0) { @@ -513,7 +513,7 @@ TEST_CASE("downloading throws error when chunks document is corrupt", "[gridfs:: }; if (expect_success) { - stdx::optional result = downloader_read_one(); + bsoncxx::stdx::optional result = downloader_read_one(); REQUIRE(result); REQUIRE(*result == k_expected_data_byte); result = downloader_read_one(); @@ -1042,7 +1042,7 @@ TEST_CASE("gridfs upload large file", "[gridfs::bucket]") { char* enable_slow_tests = std::getenv("MONGOCXX_ENABLE_SLOW_TESTS"); - if (!enable_slow_tests || stdx::string_view{enable_slow_tests}.empty()) { + if (!enable_slow_tests || bsoncxx::stdx::string_view{enable_slow_tests}.empty()) { return; } @@ -1099,7 +1099,7 @@ TEST_CASE("gridfs download large file", "[gridfs::bucket]") { char* enable_slow_tests = std::getenv("MONGOCXX_ENABLE_SLOW_TESTS"); - if (!enable_slow_tests || stdx::string_view{enable_slow_tests}.empty()) { + if (!enable_slow_tests || bsoncxx::stdx::string_view{enable_slow_tests}.empty()) { return; } diff --git a/src/mongocxx/test/index_view.cpp b/src/mongocxx/test/index_view.cpp index 088b8e6836..4e5d3ac02d 100644 --- a/src/mongocxx/test/index_view.cpp +++ b/src/mongocxx/test/index_view.cpp @@ -88,7 +88,8 @@ TEST_CASE("create_one", "[index_view]") { auto key = make_document(kvp("a", 1)); auto options = make_document(kvp("name", "myIndex")); - stdx::optional result = indexes.create_one(key.view(), options.view()); + bsoncxx::stdx::optional result = + indexes.create_one(key.view(), options.view()); REQUIRE(result); REQUIRE(*result == "myIndex"); @@ -101,7 +102,7 @@ TEST_CASE("create_one", "[index_view]") { index_view indexes = coll.indexes(); auto key = make_document(kvp("a", 1), kvp("b", -1)); - stdx::optional result = indexes.create_one(key.view()); + bsoncxx::stdx::optional result = indexes.create_one(key.view()); REQUIRE(result); REQUIRE(*result == "a_1_b_-1"); @@ -116,7 +117,7 @@ TEST_CASE("create_one", "[index_view]") { auto key = make_document(kvp("a", 1)); auto options = make_document(kvp("name", "myIndex")); index_model model(key.view(), options.view()); - stdx::optional result = indexes.create_one(model); + bsoncxx::stdx::optional result = indexes.create_one(model); REQUIRE(result); REQUIRE(*result == "myIndex"); @@ -130,7 +131,7 @@ TEST_CASE("create_one", "[index_view]") { auto key = make_document(kvp("a", 1), kvp("b", -1)); index_model model(key.view()); - stdx::optional result = indexes.create_one(model); + bsoncxx::stdx::optional result = indexes.create_one(model); REQUIRE(result); REQUIRE(*result == "a_1_b_-1"); @@ -273,7 +274,7 @@ TEST_CASE("create_many", "[index_view]") { auto name = index["name"].get_string(); for (auto expected : expected_names) { - if (stdx::string_view(expected) == name.value) { + if (bsoncxx::stdx::string_view(expected) == name.value) { found++; } } @@ -298,7 +299,7 @@ TEST_CASE("drop_one", "[index_view]") { REQUIRE(std::distance(cursor.begin(), cursor.end()) == 1); auto key = make_document(kvp("a", 1)); - stdx::optional result = indexes.create_one(key.view()); + bsoncxx::stdx::optional result = indexes.create_one(key.view()); auto cursor1 = indexes.list(); REQUIRE(std::distance(cursor1.begin(), cursor1.end()) == 2); @@ -319,7 +320,7 @@ TEST_CASE("drop_one", "[index_view]") { REQUIRE(std::distance(cursor.begin(), cursor.end()) == 1); auto key = make_document(kvp("a", 1)); - stdx::optional result = indexes.create_one(key.view()); + bsoncxx::stdx::optional result = indexes.create_one(key.view()); auto cursor1 = indexes.list(); REQUIRE(std::distance(cursor1.begin(), cursor1.end()) == 2); @@ -341,7 +342,7 @@ TEST_CASE("drop_one", "[index_view]") { auto key = make_document(kvp("a", 1)); index_model model(key.view()); - stdx::optional result = indexes.create_one(key.view()); + bsoncxx::stdx::optional result = indexes.create_one(key.view()); auto cursor1 = indexes.list(); REQUIRE(std::distance(cursor1.begin(), cursor1.end()) == 2); diff --git a/src/mongocxx/test/logging.cpp b/src/mongocxx/test/logging.cpp index 0d957a2fe2..704677a9b9 100644 --- a/src/mongocxx/test/logging.cpp +++ b/src/mongocxx/test/logging.cpp @@ -32,8 +32,8 @@ class test_log_handler : public logger { test_log_handler(std::vector* events) : _events(events) {} void operator()(log_level level, - stdx::string_view domain, - stdx::string_view message) noexcept final { + bsoncxx::stdx::string_view domain, + bsoncxx::stdx::string_view message) noexcept final { if (level == log_level::k_error) _events->emplace_back(level, std::string(domain), std::string(message)); } @@ -53,7 +53,7 @@ TEST_CASE("a user-provided log handler will be used for logging output", "[insta reset_log_handler_when_done rlhwd; std::vector events; - mongocxx::instance driver{stdx::make_unique(&events)}; + mongocxx::instance driver{bsoncxx::stdx::make_unique(&events)}; REQUIRE(&mongocxx::instance::current() == &driver); diff --git a/src/mongocxx/test/options/index.cpp b/src/mongocxx/test/options/index.cpp index bb52c3eb1a..3c3a573565 100644 --- a/src/mongocxx/test/options/index.cpp +++ b/src/mongocxx/test/options/index.cpp @@ -35,7 +35,7 @@ TEST_CASE("index", "[index][option]") { options::index idx; std::unique_ptr storage = - stdx::make_unique(); + bsoncxx::stdx::make_unique(); auto collation = make_document(kvp("locale", "en_US")); auto partial_filter_expression = make_document(kvp("x", true)); diff --git a/src/mongocxx/test/pool.cpp b/src/mongocxx/test/pool.cpp index fb6519b5f4..e716275857 100644 --- a/src/mongocxx/test/pool.cpp +++ b/src/mongocxx/test/pool.cpp @@ -151,11 +151,11 @@ TEST_CASE("calling acquire on a pool returns an entry that manages its client", pool p{}; auto client = p.acquire(); database db = client["mydb"]; - REQUIRE(db.name() == stdx::string_view{"mydb"}); + REQUIRE(db.name() == bsoncxx::stdx::string_view{"mydb"}); } } -TEST_CASE("try_acquire returns an engaged stdx::optional", "[pool]") { +TEST_CASE("try_acquire returns an engaged bsoncxx::stdx::optional", "[pool]") { instance::current(); pool p{}; auto client = p.try_acquire(); @@ -163,7 +163,7 @@ TEST_CASE("try_acquire returns an engaged stdx::optional", "[pool]") { } TEST_CASE( - "try_acquire returns a disengaged stdx::optional if mongoc_client_pool_try_pop " + "try_acquire returns a disengaged bsoncxx::stdx::optional if mongoc_client_pool_try_pop " "returns a null pointer", "[pool]") { MOCK_POOL; diff --git a/src/mongocxx/test/read_concern.cpp b/src/mongocxx/test/read_concern.cpp index 9b8d3421a2..05fffcc5a7 100644 --- a/src/mongocxx/test/read_concern.cpp +++ b/src/mongocxx/test/read_concern.cpp @@ -28,42 +28,42 @@ TEST_CASE("valid read concern settings", "[read_concern]") { read_concern rc{}; read_concern::level level_setting = read_concern::level::k_server_default; - stdx::string_view string_setting{""}; + bsoncxx::stdx::string_view string_setting{""}; SECTION("default-constructed read_concern") { level_setting = read_concern::level::k_server_default; - string_setting = stdx::string_view{""}; + string_setting = bsoncxx::stdx::string_view{""}; } SECTION("can be assigned with acknowledge_level()") { SECTION("local") { level_setting = read_concern::level::k_local; - string_setting = stdx::string_view{"local"}; + string_setting = bsoncxx::stdx::string_view{"local"}; } SECTION("majority") { level_setting = read_concern::level::k_majority; - string_setting = stdx::string_view{"majority"}; + string_setting = bsoncxx::stdx::string_view{"majority"}; } SECTION("linearizable") { level_setting = read_concern::level::k_linearizable; - string_setting = stdx::string_view{"linearizable"}; + string_setting = bsoncxx::stdx::string_view{"linearizable"}; } SECTION("server default") { level_setting = read_concern::level::k_server_default; - string_setting = stdx::string_view{""}; + string_setting = bsoncxx::stdx::string_view{""}; } SECTION("available") { level_setting = read_concern::level::k_available; - string_setting = stdx::string_view{"available"}; + string_setting = bsoncxx::stdx::string_view{"available"}; } SECTION("server default") { level_setting = read_concern::level::k_snapshot; - string_setting = stdx::string_view{"snapshot"}; + string_setting = bsoncxx::stdx::string_view{"snapshot"}; } REQUIRE_NOTHROW(rc.acknowledge_level(level_setting)); @@ -72,32 +72,32 @@ TEST_CASE("valid read concern settings", "[read_concern]") { SECTION("can be assigned with acknowledge_string()") { SECTION("local") { level_setting = read_concern::level::k_local; - string_setting = stdx::string_view{"local"}; + string_setting = bsoncxx::stdx::string_view{"local"}; } SECTION("majority") { level_setting = read_concern::level::k_majority; - string_setting = stdx::string_view{"majority"}; + string_setting = bsoncxx::stdx::string_view{"majority"}; } SECTION("linearizable") { level_setting = read_concern::level::k_linearizable; - string_setting = stdx::string_view{"linearizable"}; + string_setting = bsoncxx::stdx::string_view{"linearizable"}; } SECTION("server default") { level_setting = read_concern::level::k_server_default; - string_setting = stdx::string_view{""}; + string_setting = bsoncxx::stdx::string_view{""}; } SECTION("available") { level_setting = read_concern::level::k_available; - string_setting = stdx::string_view{"available"}; + string_setting = bsoncxx::stdx::string_view{"available"}; } SECTION("server default") { level_setting = read_concern::level::k_snapshot; - string_setting = stdx::string_view{"snapshot"}; + string_setting = bsoncxx::stdx::string_view{"snapshot"}; } REQUIRE_NOTHROW(rc.acknowledge_string(string_setting)); diff --git a/src/mongocxx/test/result/gridfs/upload.cpp b/src/mongocxx/test/result/gridfs/upload.cpp index 883c6c5253..502ddf3321 100644 --- a/src/mongocxx/test/result/gridfs/upload.cpp +++ b/src/mongocxx/test/result/gridfs/upload.cpp @@ -59,7 +59,7 @@ TEST_CASE("result::gridfs::upload owns id", "[result::gridfs::upload]") { // Because result::gridfs::upload owns its id, we should still be able to correctly read new // value for the id. - REQUIRE(res.id().get_string().value == stdx::string_view(bar)); + REQUIRE(res.id().get_string().value == bsoncxx::stdx::string_view(bar)); } TEST_CASE("result::gridfs::upload equals", "[result::gridfs::upload]") { diff --git a/src/mongocxx/test/sdam-monitoring.cpp b/src/mongocxx/test/sdam-monitoring.cpp index d632dd2c09..17fb528e39 100644 --- a/src/mongocxx/test/sdam-monitoring.cpp +++ b/src/mongocxx/test/sdam-monitoring.cpp @@ -58,7 +58,7 @@ TEST_CASE("SDAM Monitoring", "[sdam_monitoring]") { bsoncxx::test::exception_guard_state eguard; options::apm apm_opts; - stdx::optional topology_id; + bsoncxx::stdx::optional topology_id; SECTION("Server Events") { int server_opening_events = 0; diff --git a/src/mongocxx/test/spec/initial_dns_seedlist_discovery.cpp b/src/mongocxx/test/spec/initial_dns_seedlist_discovery.cpp index 57fb8c6e07..7e2772f8fc 100644 --- a/src/mongocxx/test/spec/initial_dns_seedlist_discovery.cpp +++ b/src/mongocxx/test/spec/initial_dns_seedlist_discovery.cpp @@ -63,7 +63,7 @@ struct initial_dns_seedlist_test { } }; -static bsoncxx::document::value _doc_from_file(mongocxx::stdx::string_view sub_path) { +static bsoncxx::document::value _doc_from_file(bsoncxx::stdx::string_view sub_path) { const char* test_path = std::getenv("INITIAL_DNS_SEEDLIST_DISCOVERY_TESTS_PATH"); REQUIRE(test_path); diff --git a/src/mongocxx/test/spec/monitoring.cpp b/src/mongocxx/test/spec/monitoring.cpp index e02aea5c40..2f14177474 100644 --- a/src/mongocxx/test/spec/monitoring.cpp +++ b/src/mongocxx/test/spec/monitoring.cpp @@ -38,11 +38,12 @@ using bsoncxx::to_json; static void remove_ignored_command_monitoring_events(apm_checker::event_vector& events, const std::vector& ignore) { auto is_ignored = [&](bsoncxx::document::value v) { - return std::any_of(std::begin(ignore), std::end(ignore), [&](stdx::string_view key) { - return v.view()["commandStartedEvent"]["command"][key] || - v.view()["commandFailedEvent"]["command"][key] || - v.view()["commandSucceededEvent"]["command"][key]; - }); + return std::any_of( + std::begin(ignore), std::end(ignore), [&](bsoncxx::stdx::string_view key) { + return v.view()["commandStartedEvent"]["command"][key] || + v.view()["commandFailedEvent"]["command"][key] || + v.view()["commandSucceededEvent"]["command"][key]; + }); }; events.erase(std::remove_if(events.begin(), events.end(), is_ignored), std::end(events)); @@ -62,7 +63,8 @@ void apm_checker::compare_unified(bsoncxx::array::view expectations, // Extra fields are only allowed in root-level documents. Here, each k in keys is treated // as its own root-level document, allowing extra fields. - auto match_events = [&](stdx::string_view event, std::initializer_list keys) { + auto match_events = [&](bsoncxx::stdx::string_view event, + std::initializer_list keys) { for (auto&& k : keys) if (exp[event][k]) assert::matches(actual[event][k].get_value(), exp[event][k].get_value(), map); @@ -105,16 +107,17 @@ void apm_checker::compare(bsoncxx::array::view expectations, if (view["command_started_event"]["command"]["listCollections"]) { const auto db = view["command_started_event"]["command"]["$db"]; - if (db && db.get_string().value == stdx::string_view("keyvault")) { + if (db && db.get_string().value == bsoncxx::stdx::string_view("keyvault")) { return true; } } - return std::any_of(std::begin(_ignore), std::end(_ignore), [&](stdx::string_view key) { - return view["command_started_event"]["command"][key] || - view["command_failed_event"]["command"][key] || - view["command_succeeded_event"]["command"][key]; - }); + return std::any_of( + std::begin(_ignore), std::end(_ignore), [&](bsoncxx::stdx::string_view key) { + return view["command_started_event"]["command"][key] || + view["command_failed_event"]["command"][key] || + view["command_succeeded_event"]["command"][key]; + }); }; auto events_iter = _events.begin(); @@ -148,10 +151,11 @@ void apm_checker::has(bsoncxx::array::view expectations) { } } -bool apm_checker::should_ignore(stdx::string_view command_name) const { - return std::any_of(std::begin(_ignore), - std::end(_ignore), - [command_name](stdx::string_view cmp) { return command_name == cmp; }); +bool apm_checker::should_ignore(bsoncxx::stdx::string_view command_name) const { + return std::any_of( + std::begin(_ignore), std::end(_ignore), [command_name](bsoncxx::stdx::string_view cmp) { + return command_name == cmp; + }); } std::string apm_checker::print_all() const { @@ -168,9 +172,10 @@ std::string apm_checker::print_all() const { /// We don't have access to the original command definition here, but (at present) we can /// detect that it is sensitive by the mongoc library having removed the main body of the /// command events' requests and responses, thus we check for ".empty()" on that body. -static bool is_hello_cmd_name(stdx::string_view name) { - return name == stdx::string_view("hello") || name == stdx::string_view("ismaster") || - name == stdx::string_view("isMaster"); +static bool is_hello_cmd_name(bsoncxx::stdx::string_view name) { + return name == bsoncxx::stdx::string_view("hello") || + name == bsoncxx::stdx::string_view("ismaster") || + name == bsoncxx::stdx::string_view("isMaster"); } static bool is_sensitive_hello_cmd_event(const events::command_started_event& event) { return event.command().empty(); @@ -187,13 +192,13 @@ static bool is_sensitive_hello_cmd_event(const events::command_failed_event& ev) /** * @brief Determine whether 'event' is one of the "sensitive" events. * - * `event` must have a `command_name() const -> stdx::string_view` method. If the + * `event` must have a `command_name() const -> bsoncxx::stdx::string_view` method. If the * event is a 'hello' or 'isMaster' event, it is sensitive if it is a commandStartedEvent * and 'speculativeAuthenticate' is provided in the command (See is_sensitive_hello_cmd_event). */ template static bool is_sensitive_command(const Ev& event) noexcept { - static stdx::string_view sensitive_commands[] = { + static bsoncxx::stdx::string_view sensitive_commands[] = { "authenticate", "saslStart", "saslContinue", diff --git a/src/mongocxx/test/spec/monitoring.hh b/src/mongocxx/test/spec/monitoring.hh index b560216a10..9d104d9b6e 100644 --- a/src/mongocxx/test/spec/monitoring.hh +++ b/src/mongocxx/test/spec/monitoring.hh @@ -44,7 +44,7 @@ class apm_checker { void has(bsoncxx::array::view expected); // True if we should not process the given command: - bool should_ignore(const stdx::string_view command_name) const; + bool should_ignore(const bsoncxx::stdx::string_view command_name) const; void clear(); void clear_events(); diff --git a/src/mongocxx/test/spec/operation.cpp b/src/mongocxx/test/spec/operation.cpp index b19e7cc9a9..8e48b0677c 100644 --- a/src/mongocxx/test/spec/operation.cpp +++ b/src/mongocxx/test/spec/operation.cpp @@ -124,7 +124,7 @@ bsoncxx::stdx::optional lookup_read_preference(document::view d return {}; } -client_session* operation_runner::_lookup_session(stdx::string_view key) { +client_session* operation_runner::_lookup_session(bsoncxx::stdx::string_view key) { if (key.compare("session0") == 0) { return _session0; } @@ -158,11 +158,11 @@ document::value operation_runner::_run_aggregate(document::view operation) { _set_collection_options(operation); - stdx::optional result_cursor; + bsoncxx::stdx::optional result_cursor; client_session* session = _lookup_session(operation["arguments"].get_document().value); if (operation["object"] && - operation["object"].get_string().value == stdx::string_view{"database"}) { + operation["object"].get_string().value == bsoncxx::stdx::string_view{"database"}) { REQUIRE(_db); // Run on the database @@ -206,7 +206,7 @@ document::value operation_runner::_run_distinct(document::view operation) { options.collation(arguments["collation"].get_document().value); } - stdx::optional result_cursor; + bsoncxx::stdx::optional result_cursor; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { result_cursor.emplace(_coll->distinct(*session, field_name, filter, options)); } else { @@ -293,7 +293,7 @@ document::value operation_runner::_run_find(document::view operation) { } } - stdx::optional result_cursor; + bsoncxx::stdx::optional result_cursor; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { result_cursor.emplace(_coll->find(*session, filter, options)); } else { @@ -416,7 +416,7 @@ document::value operation_runner::_run_find_one_and_delete(document::view operat } auto result = builder::basic::document{}; - stdx::optional document; + bsoncxx::stdx::optional document; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { document = _coll->find_one_and_delete(*session, filter, options); } else { @@ -495,7 +495,7 @@ document::value operation_runner::_run_find_one_and_replace(document::view opera } auto result = builder::basic::document{}; - stdx::optional document; + bsoncxx::stdx::optional document; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { document = _coll->find_one_and_replace(*session, filter, replacement, options); } else { @@ -559,7 +559,7 @@ document::value operation_runner::_run_find_one_and_update(document::view operat } auto result = builder::basic::document{}; - stdx::optional document; + bsoncxx::stdx::optional document; client_session* session = _lookup_session(operation["arguments"].get_document().value); switch (arguments["update"].type()) { @@ -636,7 +636,7 @@ document::value operation_runner::_run_insert_many(document::view operation) { documents_to_insert.push_back(element.get_document().value); } - stdx::optional insert_many_result; + bsoncxx::stdx::optional insert_many_result; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { insert_many_result = _coll->insert_many(*session, documents_to_insert, insert_options); } else { @@ -668,7 +668,7 @@ document::value operation_runner::_run_insert_one(document::view operation) { opts.bypass_document_validation(true); } - stdx::optional insert_one_result; + bsoncxx::stdx::optional insert_one_result; if (client_session* session = _lookup_session(arguments)) { insert_one_result = _coll->insert_one(*session, document, opts); } else { @@ -713,7 +713,7 @@ document::value operation_runner::_run_replace_one(document::view operation) { std::int32_t matched_count = 0; bsoncxx::stdx::optional modified_count; std::int32_t upserted_count = 0; - stdx::optional replace_result; + bsoncxx::stdx::optional replace_result; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { replace_result = _coll->replace_one(*session, filter, replacement, options); } else { @@ -786,7 +786,7 @@ document::value operation_runner::_run_update_many(document::view operation) { std::int32_t matched_count = 0; bsoncxx::stdx::optional modified_count; std::int32_t upserted_count = 0; - stdx::optional update_result; + bsoncxx::stdx::optional update_result; client_session* session = _lookup_session(operation["arguments"].get_document().value); switch (arguments["update"].type()) { @@ -899,7 +899,7 @@ document::value operation_runner::_run_update_one(document::view operation) { std::int32_t matched_count = 0; bsoncxx::stdx::optional modified_count; std::int32_t upserted_count = 0; - stdx::optional update_result; + bsoncxx::stdx::optional update_result; client_session* session = _lookup_session(operation["arguments"].get_document().value); switch (arguments["update"].type()) { @@ -1193,7 +1193,7 @@ document::value operation_runner::_run_bulk_write(document::view operation) { std::int32_t upserted_count = 0; result::bulk_write::id_map upserted_ids; std::int32_t inserted_count = 0; - stdx::optional bulk_write_result; + bsoncxx::stdx::optional bulk_write_result; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { bulk_write_result = _coll->bulk_write(*session, writes, options); } else { @@ -1320,7 +1320,7 @@ document::value operation_runner::_run_run_command(bsoncxx::document::view opera document::view arguments = operation["arguments"].get_document().value; document::view command = arguments["command"].get_document().value; - stdx::optional reply; + bsoncxx::stdx::optional reply; if (client_session* session = _lookup_session(operation["arguments"].get_document().value)) { reply = _db->run_command(*session, command); } else { @@ -1383,7 +1383,8 @@ document::value operation_runner::_run_drop_collection(document::view operation) if (arguments.find("encryptedFields") != arguments.end()) { auto encrypted_fields = arguments["encryptedFields"].get_document().value; auto encrypted_fields_map = make_document(kvp("encryptedFields", encrypted_fields)); - _db->collection(collection_name).drop(stdx::nullopt, std::move(encrypted_fields_map)); + _db->collection(collection_name) + .drop(bsoncxx::stdx::nullopt, std::move(encrypted_fields_map)); } else { _db->collection(collection_name).drop(); } @@ -1402,8 +1403,8 @@ document::value operation_runner::run(document::view operation) { using namespace bsoncxx::builder::basic; bsoncxx::document::value empty_document({}); - stdx::string_view key = operation["name"].get_string().value; - stdx::string_view object; + bsoncxx::stdx::string_view key = operation["name"].get_string().value; + bsoncxx::stdx::string_view object; if (operation["object"]) { object = operation["object"].get_string().value; } @@ -1471,19 +1472,19 @@ document::value operation_runner::run(document::view operation) { const auto state = arguments["state"].get_string().value; switch (session->get_transaction_state()) { case client_session::transaction_state::k_transaction_none: - REQUIRE(state == stdx::string_view("none")); + REQUIRE(state == bsoncxx::stdx::string_view("none")); break; case client_session::transaction_state::k_transaction_starting: - REQUIRE(state == stdx::string_view("starting")); + REQUIRE(state == bsoncxx::stdx::string_view("starting")); break; case client_session::transaction_state::k_transaction_in_progress: - REQUIRE(state == stdx::string_view("in_progress")); + REQUIRE(state == bsoncxx::stdx::string_view("in_progress")); break; case client_session::transaction_state::k_transaction_committed: - REQUIRE(state == stdx::string_view("committed")); + REQUIRE(state == bsoncxx::stdx::string_view("committed")); break; case client_session::transaction_state::k_transaction_aborted: - REQUIRE(state == stdx::string_view("aborted")); + REQUIRE(state == bsoncxx::stdx::string_view("aborted")); break; } return empty_document; @@ -1568,7 +1569,7 @@ document::value operation_runner::run(document::view operation) { return empty_document; } else if (key.compare("targetedFailPoint") == 0) { - REQUIRE(object == stdx::string_view("testRunner")); + REQUIRE(object == bsoncxx::stdx::string_view("testRunner")); const auto arguments = operation["arguments"].get_document().value; diff --git a/src/mongocxx/test/spec/operation.hh b/src/mongocxx/test/spec/operation.hh index becdd23a21..08f39d659c 100644 --- a/src/mongocxx/test/spec/operation.hh +++ b/src/mongocxx/test/spec/operation.hh @@ -55,7 +55,7 @@ class operation_runner { client* _client; client_session* _lookup_session(document::view doc); - client_session* _lookup_session(stdx::string_view key); + client_session* _lookup_session(bsoncxx::stdx::string_view key); document::value _run_aggregate(document::view operation); document::value _run_count(document::view operation); document::value _run_create_collection(document::view operation); diff --git a/src/mongocxx/test/spec/unified_tests/entity.cpp b/src/mongocxx/test/spec/unified_tests/entity.cpp index 835f45c3ce..04dd26d9ab 100644 --- a/src/mongocxx/test/spec/unified_tests/entity.cpp +++ b/src/mongocxx/test/spec/unified_tests/entity.cpp @@ -124,7 +124,7 @@ const std::type_info& map::type(const key_type& key) { return typeid(mongocxx::client); } -database& map::get_database_by_name(stdx::string_view name) { +database& map::get_database_by_name(bsoncxx::stdx::string_view name) { for (auto&& kvp : _database_map) if (name == kvp.second.name()) return kvp.second; diff --git a/src/mongocxx/test/spec/unified_tests/entity.hh b/src/mongocxx/test/spec/unified_tests/entity.hh index 3f21db2270..dd80517d55 100644 --- a/src/mongocxx/test/spec/unified_tests/entity.hh +++ b/src/mongocxx/test/spec/unified_tests/entity.hh @@ -61,7 +61,7 @@ class map { cursor& get_cursor(const key_type& key); mongocxx::client_encryption& get_client_encryption(const key_type& key); - database& get_database_by_name(stdx::string_view name); + database& get_database_by_name(bsoncxx::stdx::string_view name); void clear() noexcept; const std::type_info& type(const key_type& key); diff --git a/src/mongocxx/test/spec/unified_tests/operations.cpp b/src/mongocxx/test/spec/unified_tests/operations.cpp index 2906ca5770..6bf5601166 100644 --- a/src/mongocxx/test/spec/unified_tests/operations.cpp +++ b/src/mongocxx/test/spec/unified_tests/operations.cpp @@ -149,7 +149,7 @@ document::value find(collection& coll, client_session* session, document::view o options::find options = make_find_options(arguments); - stdx::optional result_cursor; + bsoncxx::stdx::optional result_cursor; if (session) { result_cursor.emplace(coll.find(*session, filter, options)); @@ -529,7 +529,7 @@ document::value insert_many(collection& coll, client_session* session, document: documents_to_insert.push_back(element.get_document().value); } - stdx::optional insert_many_result; + bsoncxx::stdx::optional insert_many_result; if (session) { insert_many_result = coll.insert_many(*session, documents_to_insert, insert_options); @@ -588,7 +588,7 @@ document::value replace_one(collection& coll, client_session* session, document: std::int32_t matched_count = 0; bsoncxx::stdx::optional modified_count; std::int32_t upserted_count = 0; - stdx::optional replace_result; + bsoncxx::stdx::optional replace_result; if (session) { replace_result = coll.replace_one(*session, filter, replacement, options); @@ -656,7 +656,7 @@ document::value aggregate(Entity& entity, client_session* session, document::vie options.allow_disk_use(allow_disk_use.get_bool()); } - stdx::optional result_cursor; + bsoncxx::stdx::optional result_cursor; if (session) { result_cursor.emplace(entity.aggregate(*session, pipeline, options)); @@ -688,7 +688,7 @@ document::value insert_one(collection& coll, client_session* session, document:: opts.comment(comment.get_value()); } - stdx::optional insert_one_result; + bsoncxx::stdx::optional insert_one_result; if (session) { insert_one_result = coll.insert_one(*session, document, opts); } else { @@ -872,7 +872,7 @@ document::value find_one_and_delete(collection& coll, options.sort(sort.get_document().value); } - stdx::optional document; + bsoncxx::stdx::optional document; if (session) { document = coll.find_one_and_delete(*session, filter, options); } else { @@ -941,7 +941,7 @@ document::value find_one_and_replace(collection& coll, options.upsert(upsert.get_bool().value); } - stdx::optional document; + bsoncxx::stdx::optional document; document::view replacement = arguments["replacement"].get_document().value; if (session) { document = coll.find_one_and_replace(*session, filter, replacement, options); @@ -1016,7 +1016,7 @@ document::value find_one_and_update(collection& coll, } auto result = builder::basic::document{}; - stdx::optional document; + bsoncxx::stdx::optional document; switch (arguments["update"].type()) { case bsoncxx::type::k_document: { @@ -1284,7 +1284,7 @@ document::value delete_many(collection& coll, client_session* session, document: auto result = builder::basic::document{}; std::int32_t deleted_count = 0; - stdx::optional delete_result; + bsoncxx::stdx::optional delete_result; if (session) { delete_result = coll.delete_many(*session, filter, options); } else { @@ -1372,7 +1372,7 @@ document::value update_one(collection& coll, client_session* session, document:: options.upsert(upsert.get_bool().value); } - stdx::optional update_one_result; + bsoncxx::stdx::optional update_one_result; { const auto update = arguments["update"]; @@ -1465,7 +1465,7 @@ document::value update_many(collection& coll, document::view operation) { options.upsert(upsert.get_bool().value); } - stdx::optional update_many_result; + bsoncxx::stdx::optional update_many_result; { const auto update = arguments["update"]; @@ -1621,7 +1621,7 @@ document::value distinct(collection& coll, client_session* session, document::vi options.comment(comment.get_value()); } - stdx::optional result_cursor; + bsoncxx::stdx::optional result_cursor; if (session) { result_cursor.emplace(coll.distinct(*session, field_name, filter, options)); } else { @@ -1893,7 +1893,7 @@ document::value list_search_indexes(collection& coll, document::view operation) if (arguments["aggregationOptions"]) { const auto aggregation_options = arguments["aggregationOptions"].get_document().view(); for (auto&& element : aggregation_options) { - if (element.key() == stdx::string_view("batchSize")) { + if (element.key() == bsoncxx::stdx::string_view("batchSize")) { options.batch_size(element.get_int32().value); } else { throw std::logic_error{"unsupported aggregateOptions field: " + diff --git a/src/mongocxx/test/spec/unified_tests/runner.cpp b/src/mongocxx/test/spec/unified_tests/runner.cpp index 611486ef59..c671b655f6 100644 --- a/src/mongocxx/test/spec/unified_tests/runner.cpp +++ b/src/mongocxx/test/spec/unified_tests/runner.cpp @@ -449,11 +449,11 @@ void add_observe_events(spec::apm_checker& apm, options::apm& apm_opts, document for (const auto& event : events) { const auto event_type = event.get_string().value; - if (event_type == mongocxx::stdx::string_view("commandStartedEvent")) { + if (event_type == bsoncxx::stdx::string_view("commandStartedEvent")) { apm.set_command_started_unified(apm_opts); - } else if (event_type == mongocxx::stdx::string_view("commandSucceededEvent")) { + } else if (event_type == bsoncxx::stdx::string_view("commandSucceededEvent")) { apm.set_command_succeeded_unified(apm_opts); - } else if (event_type == mongocxx::stdx::string_view("commandFailedEvent")) { + } else if (event_type == bsoncxx::stdx::string_view("commandFailedEvent")) { apm.set_command_failed_unified(apm_opts); } else { UNSCOPED_INFO("ignoring unsupported command monitoring event " << event_type); @@ -1085,9 +1085,9 @@ struct fail_point_guard_type { } }; -void disable_targeted_fail_point(mongocxx::stdx::string_view uri, +void disable_targeted_fail_point(bsoncxx::stdx::string_view uri, std::uint32_t server_id, - mongocxx::stdx::string_view fail_point) { + bsoncxx::stdx::string_view fail_point) { const auto command_owner = make_document(kvp("configureFailPoint", fail_point), kvp("mode", "off")); const auto command = command_owner.view(); @@ -1137,8 +1137,8 @@ document::value bulk_write_result(const mongocxx::bulk_write_exception& e) { } // Match test cases that should be skipped by both test and case descriptions. -const std::map, - mongocxx::stdx::string_view> +const std::map, + bsoncxx::stdx::string_view> should_skip_test_cases = { {{"retryable reads handshake failures", "collection.findOne succeeds after retryable handshake network error"}, @@ -1156,7 +1156,7 @@ const std::map& unsupported_tests = {}) { + const std::set& unsupported_tests = {}) { const char* p = std::getenv(env_path.c_str()); if (nullptr == p) @@ -1328,7 +1328,7 @@ void run_unified_format_tests_in_env_dir( } TEST_CASE("unified format spec automated tests", "[unified_format_specs]") { - const std::set unsupported_tests = { + const std::set unsupported_tests = { // Waiting on CDRIVER-3525 and CXX-2166. "valid-pass/entity-client-cmap-events.json", // Waiting on CDRIVER-3525 and CXX-2166. diff --git a/src/mongocxx/test/spec/uri_options.cpp b/src/mongocxx/test/spec/uri_options.cpp index 567b956ddf..650dd68807 100644 --- a/src/mongocxx/test/spec/uri_options.cpp +++ b/src/mongocxx/test/spec/uri_options.cpp @@ -56,7 +56,7 @@ struct URIOptionsTest { } }; -static bsoncxx::document::value _doc_from_file(mongocxx::stdx::string_view sub_path) { +static bsoncxx::document::value _doc_from_file(bsoncxx::stdx::string_view sub_path) { const char* test_path = std::getenv("URI_OPTIONS_TESTS_PATH"); REQUIRE(test_path); diff --git a/src/mongocxx/test/spec/util.cpp b/src/mongocxx/test/spec/util.cpp index ddf843b35b..27acd1b787 100644 --- a/src/mongocxx/test/spec/util.cpp +++ b/src/mongocxx/test/spec/util.cpp @@ -220,7 +220,7 @@ void configure_fail_point(const client& client, document::view test) { } } -void disable_fail_point(const client& client, stdx::string_view fail_point) { +void disable_fail_point(const client& client, bsoncxx::stdx::string_view fail_point) { /* Some transactions tests have a failCommand for "hello" repeat seven times. */ for (int i = 0; i < kMaxHelloFailCommands; i++) { try { @@ -255,7 +255,7 @@ struct fail_point_guard_type { void disable_fail_point(std::string uri_string, options::client client_opts, - stdx::string_view fail_point) { + bsoncxx::stdx::string_view fail_point) { mongocxx::client client = {uri{uri_string}, client_opts}; disable_fail_point(client, fail_point); } @@ -664,7 +664,7 @@ static void run_transaction_operations( string_view coll_name, client_session* session0, client_session* session1, - stdx::optional* targeted_fail_point_guard, + bsoncxx::stdx::optional* targeted_fail_point_guard, const apm_checker& apm_checker, bool throw_on_error = false) { auto operations = test["operations"].get_array().value; @@ -749,15 +749,15 @@ static void run_transaction_operations( // activating the disable guard. There is no harm attempting to disable a fail point // that hasn't been set. if (operation["name"] && operation["name"].get_string().value == - stdx::string_view("targetedFailPoint")) { + bsoncxx::stdx::string_view("targetedFailPoint")) { const auto arguments = operation["arguments"]; const auto session = [&]() -> mongocxx::client_session* { const auto value = arguments["session"].get_string().value; - if (value == stdx::string_view("session0")) { + if (value == bsoncxx::stdx::string_view("session0")) { return session0; } - if (value == stdx::string_view("session1")) { + if (value == bsoncxx::stdx::string_view("session1")) { return session1; } FAIL("unexpected session name: " << value); @@ -767,7 +767,7 @@ static void run_transaction_operations( // We expect and assume the name of the fail point is always "failCommand". To // date, *all* legacy spec tests use "failCommand" as the fail point name. REQUIRE(arguments["failPoint"]["configureFailPoint"].get_string().value == - stdx::string_view("failCommand")); + bsoncxx::stdx::string_view("failCommand")); // We expect at most one targetedFailPoint operation per test case. REQUIRE(!(*targeted_fail_point_guard)); @@ -894,7 +894,7 @@ void run_transactions_tests_in_file(const std::string& test_path) { test_setup(test.get_document().value, test_spec_view); { - stdx::optional fail_point_guard; + bsoncxx::stdx::optional fail_point_guard; if (test["failPoint"]) { const auto fail_point_name = string::to_string( test["failPoint"]["configureFailPoint"].get_string().value); @@ -949,7 +949,8 @@ void run_transactions_tests_in_file(const std::string& test_path) { // If a test uses `targetedFailPoint`, disable the fail point after running all // `operations` to avoid spurious failures in subsequent tests. - stdx::optional targeted_fail_point_guard; + bsoncxx::stdx::optional + targeted_fail_point_guard; // Step 11. Perform the operations. run_transaction_operations(test.get_document().value, @@ -1076,7 +1077,7 @@ void run_crud_tests_in_file(const std::string& test_path, uri test_uri) { configure_fail_point(client, test.get_document().value); - stdx::optional fail_point_guard; + bsoncxx::stdx::optional fail_point_guard; if (test["failPoint"]) { const auto fail_point_name = string::to_string(test["failPoint"]["configureFailPoint"].get_string().value); diff --git a/src/mongocxx/test/spec/util.hh b/src/mongocxx/test/spec/util.hh index 907ed4bf69..eb61425895 100644 --- a/src/mongocxx/test/spec/util.hh +++ b/src/mongocxx/test/spec/util.hh @@ -36,7 +36,7 @@ using namespace mongocxx; /// /// Returns corresponding error code from given error name. /// -uint32_t error_code_from_name(stdx::string_view name); +uint32_t error_code_from_name(bsoncxx::stdx::string_view name); bool check_if_skip_spec_test_impl(const client& client, document::view test, std::string& reason); @@ -57,10 +57,10 @@ void configure_fail_point(const client& client, document::view test); /// /// Disables fail points set by tests. /// -void disable_fail_point(const client& client, stdx::string_view failpoint = "failCommand"); +void disable_fail_point(const client& client, bsoncxx::stdx::string_view failpoint = "failCommand"); void disable_fail_point(std::string uri_string, options::client client_opts, - stdx::string_view failpoint = "failCommand"); + bsoncxx::stdx::string_view failpoint = "failCommand"); /// /// Drops the given collection, then recreates it using the jsonSchema @@ -69,8 +69,8 @@ void disable_fail_point(std::string uri_string, /// void set_up_collection(const client& client, document::view test, - stdx::string_view database_name = "database_name", - stdx::string_view collection_name = "collection_name"); + bsoncxx::stdx::string_view database_name = "database_name", + bsoncxx::stdx::string_view collection_name = "collection_name"); /// /// Deletes all existing documents in the given collection, then inserts diff --git a/src/mongocxx/test/transactions.cpp b/src/mongocxx/test/transactions.cpp index a960ed68a2..9968ada4de 100644 --- a/src/mongocxx/test/transactions.cpp +++ b/src/mongocxx/test/transactions.cpp @@ -43,56 +43,56 @@ TEST_CASE("Transaction tests", "[transactions]") { } // The test run in first 3 SECTIONs below - auto successful_insert_test = [&mongodb_client]( - client_session session, - stdx::optional transaction_opts) { - auto db = mongodb_client["test"]; - auto coll = db["txn_test"]; + auto successful_insert_test = + [&mongodb_client](client_session session, + bsoncxx::stdx::optional transaction_opts) { + auto db = mongodb_client["test"]; + auto coll = db["txn_test"]; - // Insert a document that should change in this test - coll.insert_one(make_document(kvp("should_be_two", 1))); - - if (transaction_opts) { - session.start_transaction(transaction_opts); - } else { - session.start_transaction(); - } + // Insert a document that should change in this test + coll.insert_one(make_document(kvp("should_be_two", 1))); - try { - coll.update_one(session, - make_document(kvp("should_be_two", 1)), - make_document(kvp("$set", make_document(kvp("should_be_two", 2))))); - coll.insert_one(session, make_document(kvp("x", 1))); - } catch (mongocxx::exception& e) { - INFO("Collection transaction exception: " << e.what() << "\n"); - session.abort_transaction(); - REQUIRE(false); - } - - try { - session.commit_transaction(); - } catch (const operation_exception& e) { - INFO("Exception raw: " << bsoncxx::to_json(*(e.raw_server_error())) << "\n"); - INFO("Exception message: " << e.what() << "\n"); - - if (e.has_error_label("TransientTransactionError")) { - INFO("Transient error in transaction.\n"); - REQUIRE(false); + if (transaction_opts) { + session.start_transaction(transaction_opts); } else { - INFO("Non-transient error in transaction.\n"); + session.start_transaction(); + } + + try { + coll.update_one(session, + make_document(kvp("should_be_two", 1)), + make_document(kvp("$set", make_document(kvp("should_be_two", 2))))); + coll.insert_one(session, make_document(kvp("x", 1))); + } catch (mongocxx::exception& e) { + INFO("Collection transaction exception: " << e.what() << "\n"); + session.abort_transaction(); REQUIRE(false); } - } - // Document with key should_be_two should have a value of 2 - REQUIRE(coll.count_documents(make_document(kvp("should_be_two", 2))) == 1); - // Document {x:1} should have also been inserted - REQUIRE(coll.count_documents(make_document(kvp("x", 1))) == 1); + try { + session.commit_transaction(); + } catch (const operation_exception& e) { + INFO("Exception raw: " << bsoncxx::to_json(*(e.raw_server_error())) << "\n"); + INFO("Exception message: " << e.what() << "\n"); + + if (e.has_error_label("TransientTransactionError")) { + INFO("Transient error in transaction.\n"); + REQUIRE(false); + } else { + INFO("Non-transient error in transaction.\n"); + REQUIRE(false); + } + } - // Cleanup - coll.find_one_and_delete(make_document(kvp("should_be_two", 2))); - coll.find_one_and_delete(make_document(kvp("x", 1))); - }; + // Document with key should_be_two should have a value of 2 + REQUIRE(coll.count_documents(make_document(kvp("should_be_two", 2))) == 1); + // Document {x:1} should have also been inserted + REQUIRE(coll.count_documents(make_document(kvp("x", 1))) == 1); + + // Cleanup + coll.find_one_and_delete(make_document(kvp("should_be_two", 2))); + coll.find_one_and_delete(make_document(kvp("x", 1))); + }; SECTION( "A move-constructed options::transactions object transfers properties and invalidates the " @@ -182,7 +182,8 @@ TEST_CASE("Transaction tests", "[transactions]") { // Intentionally do NOT abort to force TransientTransactionError from server on commit. auto label = "TransientTransactionError"; has_transient_error_null_str = e.has_error_label(label); - has_transient_error_no_null_str = e.has_error_label(stdx::string_view(label, 25)); + has_transient_error_no_null_str = + e.has_error_label(bsoncxx::stdx::string_view(label, 25)); } REQUIRE(has_transient_error_null_str); @@ -195,7 +196,8 @@ TEST_CASE("Transaction tests", "[transactions]") { } catch (const operation_exception& e) { auto label = "TransientTransactionError"; has_transient_error_null_str = e.has_error_label(label); - has_transient_error_no_null_str = e.has_error_label(stdx::string_view(label, 25)); + has_transient_error_no_null_str = + e.has_error_label(bsoncxx::stdx::string_view(label, 25)); } mongodb_client["admin"].run_command(