diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write-fwd.hpp index 3fa854ea9c..8334d97178 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API bulk_write; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API bulk_write; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::bulk_write; + } // namespace mongocxx #include 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 18c4e99168..df23122f2f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp @@ -25,7 +25,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a batch of write operations that can be sent to the server as a group. /// @@ -77,14 +78,14 @@ class bulk_write { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - /// @throws mongocxx::logic_error if the given operation is invalid. + /// @throws mongocxx::v_noabi::logic_error if the given operation is invalid. /// bulk_write& append(const model::write& operation); /// /// Executes a bulk write. /// - /// @throws mongocxx::bulk_write_exception when there are errors processing the writes. + /// @throws mongocxx::v_noabi::bulk_write_exception when there are errors processing the writes. /// /// @return The optional result of the bulk operation execution, a result::bulk_write. /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream-fwd.hpp index a274e8c2df..8cf6761622 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API change_stream; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API change_stream; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::change_stream; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp index 92eaaf3ff1..417040ad0b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp @@ -27,7 +27,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a MongoDB change stream. /// @@ -69,7 +70,7 @@ class change_stream { /// @return /// The change_stream::iterator /// @exception - /// Throws mongocxx::query_exception if the query failed. + /// Throws mongocxx::v_noabi::query_exception if the query failed. /// iterator begin() const; @@ -105,7 +106,7 @@ class change_stream { /// @return /// The token. /// - bsoncxx::stdx::optional get_resume_token() const; + bsoncxx::v_noabi::stdx::optional get_resume_token() const; private: friend ::mongocxx::v_noabi::client; @@ -127,7 +128,7 @@ class change_stream::iterator { public: // Support input-iterator (caveat of post-increment returning void) using difference_type = std::int64_t; - using value_type = const bsoncxx::document::view; + using value_type = const bsoncxx::v_noabi::document::view; using pointer = std::add_pointer::type; using reference = std::add_lvalue_reference::type; using iterator_category = std::input_iterator_tag; @@ -145,7 +146,7 @@ class change_stream::iterator { /// The returned document::view is valid until the iterator is incremented. The value may be /// copied to extend its lifetime. /// - const bsoncxx::document::view& operator*() const; + const bsoncxx::v_noabi::document::view& operator*() const; /// /// Accesses a member of the dereferenced document currently being pointed to. @@ -153,7 +154,7 @@ class change_stream::iterator { /// The returned document::view is valid until the iterator is incremented. The value may be /// copied to extend its lifetime. /// - const bsoncxx::document::view* operator->() const; + const bsoncxx::v_noabi::document::view* operator->() const; /// /// Pre-increments the iterator to move to the next document. @@ -166,7 +167,7 @@ class change_stream::iterator { /// If no notification is available, callers may call change_stream::begin() to check for more /// notifications. /// - /// @throws mongocxx::query_exception if the query failed + /// @throws mongocxx::v_noabi::query_exception if the query failed /// iterator& operator++(); @@ -181,7 +182,7 @@ class change_stream::iterator { /// If no notification is available, callers may call change_stream::begin() to check for more /// notifications. /// - /// @throws mongocxx::query_exception if the query failed + /// @throws mongocxx::v_noabi::query_exception if the query failed /// void operator++(int); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client-fwd.hpp index b0f8977257..8b39e990d4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API client; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API client; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::client; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp index 9044373354..5a2be2d3b4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp @@ -38,7 +38,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a client connection to MongoDB. /// @@ -51,8 +52,8 @@ inline namespace v_noabi { /// /// Example: /// @code -/// mongocxx::client mongo_client{mongocxx::uri{}}; -/// mongocxx::client mongo_client{mongocxx::uri{"mongodb://localhost:27017"}}; +/// mongocxx::v_noabi::client mongo_client{mongocxx::v_noabi::uri{}}; +/// mongocxx::v_noabi::client mongo_client{mongocxx::v_noabi::uri{"mongodb://localhost:27017"}}; /// @endcode /// /// Note that client is not thread-safe. See @@ -74,10 +75,11 @@ class client { /// @param options /// Additional options that cannot be specified via the mongodb_uri /// - /// @throws mongocxx::exception if invalid options are provided + /// @throws mongocxx::v_noabi::exception if invalid options are provided /// (whether from the URI or provided client options). /// - client(const mongocxx::uri& mongodb_uri, const options::client& options = options::client()); + client(const mongocxx::v_noabi::uri& mongodb_uri, + const options::client& options = options::client()); /// /// Move constructs a client. @@ -116,15 +118,15 @@ class client { /// /// @see https://www.mongodb.com/docs/manual/reference/read-concern/ /// - MONGOCXX_DEPRECATED void read_concern(mongocxx::read_concern rc); - void read_concern_deprecated(mongocxx::read_concern rc); + MONGOCXX_DEPRECATED void read_concern(mongocxx::v_noabi::read_concern rc); + void read_concern_deprecated(mongocxx::v_noabi::read_concern rc); /// /// Returns the current read concern for this client. /// /// @return The current @c read_concern /// - mongocxx::read_concern read_concern() const; + mongocxx::v_noabi::read_concern read_concern() const; /// /// Sets the read preference for this client. @@ -142,8 +144,8 @@ class client { /// /// @see https://www.mongodb.com/docs/manual/core/read-preference/ /// - MONGOCXX_DEPRECATED void read_preference(mongocxx::read_preference rp); - void read_preference_deprecated(mongocxx::read_preference rp); + MONGOCXX_DEPRECATED void read_preference(mongocxx::v_noabi::read_preference rp); + void read_preference_deprecated(mongocxx::v_noabi::read_preference rp); /// /// Returns the current read preference for this client. @@ -152,14 +154,14 @@ class client { /// /// @see https://www.mongodb.com/docs/manual/core/read-preference/ /// - mongocxx::read_preference read_preference() const; + mongocxx::v_noabi::read_preference read_preference() const; /// /// Returns the current uri for this client. /// /// @return The @c uri that this client was created with. /// - mongocxx::uri uri() const; + mongocxx::v_noabi::uri uri() const; /// /// Sets the write concern for this client. @@ -175,14 +177,14 @@ class client { /// @param wc /// The new write concern /// - MONGOCXX_DEPRECATED void write_concern(mongocxx::write_concern wc); - void write_concern_deprecated(mongocxx::write_concern wc); + MONGOCXX_DEPRECATED void write_concern(mongocxx::v_noabi::write_concern wc); + void write_concern_deprecated(mongocxx::v_noabi::write_concern wc); /// /// Returns the current write concern for this client. /// /// @return the current @c write_concern - mongocxx::write_concern write_concern() const; + mongocxx::v_noabi::write_concern write_concern() const; /// /// Obtains a database that represents a logical grouping of collections on a MongoDB server. @@ -194,8 +196,9 @@ class client { /// /// @return The database /// - mongocxx::database database(bsoncxx::string::view_or_value name) const&; - mongocxx::database database(bsoncxx::string::view_or_value name) const&& = delete; + mongocxx::v_noabi::database database(bsoncxx::v_noabi::string::view_or_value name) const&; + mongocxx::v_noabi::database database(bsoncxx::v_noabi::string::view_or_value name) const&& = + delete; /// /// Allows the syntax @c client["db_name"] as a convenient shorthand for the client::database() @@ -208,22 +211,24 @@ class client { /// /// @return Client side representation of a server side database /// - MONGOCXX_INLINE mongocxx::database operator[](bsoncxx::string::view_or_value name) const&; - MONGOCXX_INLINE mongocxx::database operator[](bsoncxx::string::view_or_value name) const&& = - delete; + MONGOCXX_INLINE mongocxx::v_noabi::database operator[]( + bsoncxx::v_noabi::string::view_or_value name) const&; + MONGOCXX_INLINE mongocxx::v_noabi::database operator[]( + bsoncxx::v_noabi::string::view_or_value name) const&& = delete; /// /// @{ /// /// Enumerates the databases in the client. /// - /// @return A mongocxx::cursor containing a BSON document for each + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each /// database. Each document contains a name field with the database /// name, a sizeOnDisk field with the total size of the database file on /// disk in bytes, and an empty field specifying whether the database /// has any data. /// - /// @throws mongocxx::operation_exception if the underlying 'listDatabases' command fails. + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// @@ -233,15 +238,16 @@ class client { /// Enumerates the databases in the client. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// - /// @return A mongocxx::cursor containing a BSON document for each + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each /// database. Each document contains a name field with the database /// name, a sizeOnDisk field with the total size of the database file on /// disk in bytes, and an empty field specifying whether the database /// has any data. /// - /// @throws mongocxx::operation_exception if the underlying 'listDatabases' command fails. + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// @@ -253,39 +259,41 @@ class client { /// @param opts /// Options passed directly to the 'listDatabases' command. /// - /// @return A mongocxx::cursor containing a BSON document for each + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each /// database. Each document contains a name field with the database /// name, a sizeOnDisk field with the total size of the database file on /// disk in bytes, and an empty field specifying whether the database /// has any data. /// - /// @throws mongocxx::operation_exception if the underlying 'listDatabases' command fails. + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// - cursor list_databases(const bsoncxx::document::view_or_value opts) const; + cursor list_databases(const bsoncxx::v_noabi::document::view_or_value opts) const; /// /// Enumerates the databases in the client. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// /// @param opts /// Options passed directly to the 'listDatabases' command. /// - /// @return A mongocxx::cursor containing a BSON document for each + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each /// database. Each document contains a name field with the database /// name, a sizeOnDisk field with the total size of the database file on /// disk in bytes, and an empty field specifying whether the database /// has any data. /// - /// @throws mongocxx::operation_exception if the underlying 'listDatabases' command fails. + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// cursor list_databases(const client_session& session, - const bsoncxx::document::view_or_value opts) const; + const bsoncxx::v_noabi::document::view_or_value opts) const; /// /// Queries the MongoDB server for a list of known databases. @@ -295,32 +303,33 @@ class client { /// /// @return std::vector containing the database names. /// - /// @throws mongocxx::operation_exception if the underlying 'listDatabases' + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' /// command fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// std::vector list_database_names( - const bsoncxx::document::view_or_value filter = {}) const; + const bsoncxx::v_noabi::document::view_or_value filter = {}) const; /// /// Queries the MongoDB server for a list of known databases. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// /// @param filter /// An optional query expression to filter the returned database names. /// /// @return std::vector containing the database names. /// - /// @throws mongocxx::operation_exception if the underlying 'listDatabases' + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' /// command fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// std::vector list_database_names( - const client_session& session, const bsoncxx::document::view_or_value filter = {}) const; + const client_session& session, + const bsoncxx::v_noabi::document::view_or_value filter = {}) const; /// /// @} @@ -329,11 +338,12 @@ class client { /// /// Create a client session for a sequence of operations. /// - /// @return A client_session object. See `mongocxx::client_session` for more information. + /// @return A client_session object. See `mongocxx::v_noabi::client_session` for more + /// information. /// - /// @throws mongocxx::operation_exception if the driver is not built with crypto support, if - /// options is misconfigured, or if the session is configured with options that the server does - /// not support. + /// @throws mongocxx::v_noabi::operation_exception if the driver is not built with crypto + /// support, if options is misconfigured, or if the session is configured with options that the + /// server does not support. /// client_session start_session(const options::client_session& options = {}); @@ -355,7 +365,7 @@ class client { /// /// @param session - /// The mongocxx::client_session with which to perform the watch operation. + /// The mongocxx::v_noabi::client_session with which to perform the watch operation. /// @param options /// The options to use when creating the change stream. /// @@ -388,7 +398,7 @@ class client { /// Gets a change stream on this client. /// /// @param session - /// The mongocxx::client_session with which to perform the watch operation. + /// The mongocxx::v_noabi::client_session with which to perform the watch operation. /// @param pipe /// The aggregation pipeline to be used on the change notifications. /// @param options @@ -446,7 +456,8 @@ class client { std::unique_ptr _impl; }; -MONGOCXX_INLINE mongocxx::database client::operator[](bsoncxx::string::view_or_value name) const& { +MONGOCXX_INLINE mongocxx::v_noabi::database client::operator[]( + bsoncxx::v_noabi::string::view_or_value name) const& { return database(name); } diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption-fwd.hpp index 1b808212ef..9c7f9c9e3c 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API client_encryption; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API client_encryption; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::client_encryption; + } // namespace mongocxx #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 5f65a2764e..4aba569541 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_encryption.hpp @@ -32,7 +32,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class supporting operations for MongoDB Client-Side Field Level Encryption. /// @@ -79,13 +80,13 @@ class client_encryption { /// @return The id of the created document as a bson_value::value containing /// a UUID (BSON binary subtype 4). /// - /// @throws mongocxx::exception if there is an error creating the key. + /// @throws mongocxx::v_noabi::exception if there is an error creating the key. /// /// @see /// https://www.mongodb.com/docs/ecosystem/use-cases/client-side-field-level-encryption-guide/#b-create-a-data-encryption-key /// - bsoncxx::types::bson_value::value create_data_key(std::string kms_provider, - const options::data_key& opts = {}); + bsoncxx::v_noabi::types::bson_value::value create_data_key(std::string kms_provider, + const options::data_key& opts = {}); /** * @brief Create a collection with client-side-encryption enabled, automatically filling any @@ -104,10 +105,10 @@ class client_encryption { collection create_encrypted_collection( const database& db, const std::string& coll_name, - const bsoncxx::document::view& options, - bsoncxx::document::value& out_options, + 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 stdx::optional& masterkey = stdx::nullopt); /// /// Encrypts a BSON value with a given key and algorithm. @@ -120,13 +121,13 @@ class client_encryption { /// /// @return The encrypted value (BSON binary subtype 6). /// - /// @throws mongocxx::exception if there is an error encrypting the value. + /// @throws mongocxx::v_noabi::exception if there is an error encrypting the value. /// /// @see /// https://www.mongodb.com/docs/manual/reference/method/ClientEncryption.encrypt/#ClientEncryption.encrypt /// - bsoncxx::types::bson_value::value encrypt(bsoncxx::types::bson_value::view value, - const options::encrypt& opts); + bsoncxx::v_noabi::types::bson_value::value encrypt( + bsoncxx::v_noabi::types::bson_value::view value, const options::encrypt& opts); /// /// Encrypts a Match Expression or Aggregate Expression to query a range index. @@ -141,8 +142,8 @@ class client_encryption { /// /// @warning The Range algorithm is experimental only. It is not intended for public use. It is /// subject to breaking changes. - bsoncxx::document::value encrypt_expression(bsoncxx::document::view_or_value expr, - const options::encrypt& opts); + bsoncxx::v_noabi::document::value encrypt_expression( + bsoncxx::v_noabi::document::view_or_value expr, const options::encrypt& opts); /// /// Decrypts an encrypted value (BSON binary of subtype 6). @@ -152,12 +153,13 @@ class client_encryption { /// /// @return The original BSON value. /// - /// @throws mongocxx::exception if there is an error decrypting the value. + /// @throws mongocxx::v_noabi::exception if there is an error decrypting the value. /// /// @see /// https://www.mongodb.com/docs/manual/reference/method/ClientEncryption.decrypt/#ClientEncryption.decrypt /// - bsoncxx::types::bson_value::value decrypt(bsoncxx::types::bson_value::view value); + bsoncxx::v_noabi::types::bson_value::value decrypt( + bsoncxx::v_noabi::types::bson_value::view value); /// /// Decrypts multiple data keys and (re-)encrypts them with a new masterKey, @@ -175,13 +177,13 @@ class client_encryption { /// /// @return a RewrapManyDataKeyResult. /// - /// @throws mongocxx::exception if there is an error rewrapping the key. + /// @throws mongocxx::v_noabi::exception if there is an error rewrapping the key. /// /// @see /// https://www.mongodb.com/docs/manual/reference/method/KeyVault.rewrapManyDataKey/ /// - result::rewrap_many_datakey rewrap_many_datakey(bsoncxx::document::view_or_value filter, - const options::rewrap_many_datakey& opts); + result::rewrap_many_datakey rewrap_many_datakey( + bsoncxx::v_noabi::document::view_or_value filter, const options::rewrap_many_datakey& opts); /// /// Removes the key document with the given UUID (BSON binary subtype 0x04) @@ -189,37 +191,38 @@ class client_encryption { /// /// @param id Binary id of which key to delete /// - /// @throws mongocxx::exception if there is an error deleting the key. + /// @throws mongocxx::v_noabi::exception if there is an error deleting the key. /// /// @return the result of the internal deleteOne() operation on the key vault collection. /// /// @see https://www.mongodb.com/docs/manual/reference/method/KeyVault.deleteKey/ /// - result::delete_result delete_key(bsoncxx::types::bson_value::view_or_value id); + result::delete_result delete_key(bsoncxx::v_noabi::types::bson_value::view_or_value id); /// /// Finds a single key document with the given UUID (BSON binary subtype 0x04). /// /// @param id Binary id of which key to delete /// - /// @throws mongocxx::exception if there is an error getting the key. + /// @throws mongocxx::v_noabi::exception if there is an error getting the key. /// /// @return The result of the internal find() operation on the key vault collection. /// /// @see https://www.mongodb.com/docs/manual/reference/method/KeyVault.getKey/ /// - stdx::optional get_key(bsoncxx::types::bson_value::view_or_value id); + stdx::optional get_key( + bsoncxx::v_noabi::types::bson_value::view_or_value id); /// /// Finds all documents in the key vault collection. /// - /// @throws mongocxx::exception if there is an error getting the keys. + /// @throws mongocxx::v_noabi::exception if there is an error getting the keys. /// /// @return the result of the internal find() operation on the key vault collection. /// /// @see https://www.mongodb.com/docs/manual/reference/method/KeyVault.getKeys/ /// - mongocxx::cursor get_keys(); + mongocxx::v_noabi::cursor get_keys(); /// /// Adds a keyAltName to the keyAltNames array of the key document in the @@ -229,14 +232,15 @@ class client_encryption { /// /// @param key_alt_name String alternative name for the key /// - /// @throws mongocxx::exception if there is an error adding the key alt name. + /// @throws mongocxx::v_noabi::exception if there is an error adding the key alt name. /// /// @return the previous version of the key document. /// /// @see https://www.mongodb.com/docs/manual/reference/method/KeyVault.addKeyAlternateName/ /// - stdx::optional add_key_alt_name( - bsoncxx::types::bson_value::view_or_value id, bsoncxx::string::view_or_value key_alt_name); + 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); /// /// Removes a keyAltName from the keyAltNames array of the key document in @@ -246,28 +250,29 @@ class client_encryption { /// /// @param key_alt_name String alternative name for the key /// - /// @throws mongocxx::exception if there is an error removing the key alt name. + /// @throws mongocxx::v_noabi::exception if there is an error removing the key alt name. /// /// @return The previous version of the key document. /// /// @see https://www.mongodb.com/docs/manual/reference/method/KeyVault.removeKeyAlternateName/ /// - stdx::optional remove_key_alt_name( - bsoncxx::types::bson_value::view_or_value id, bsoncxx::string::view_or_value key_alt_name); + 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); /// /// Get the key document from the key vault collection with the provided name. /// /// @param key_alt_name String alternative name for the key /// - /// @throws mongocxx::exception if there is an error getting the key by alt name. + /// @throws mongocxx::v_noabi::exception if there is an error getting the key by alt name. /// /// @return A key document in the key vault collection with the given keyAltName. /// /// @see https://www.mongodb.com/docs/manual/reference/method/KeyVault.getKeyByAltName/ /// - stdx::optional get_key_by_alt_name( - bsoncxx::string::view_or_value key_alt_name); + stdx::optional get_key_by_alt_name( + bsoncxx::v_noabi::string::view_or_value key_alt_name); private: class MONGOCXX_PRIVATE impl; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session-fwd.hpp index 5fd52e2995..450f8eef48 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API client_session; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API client_session; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::client_session; + } // namespace mongocxx #include 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 7d02d5bc99..3de194e889 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp @@ -32,7 +32,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Use a session for a sequence of operations, optionally with either causal consistency /// or snapshots. @@ -74,7 +75,7 @@ class client_session { /// /// Gets the client that started this session. /// - const mongocxx::client& client() const noexcept; + const mongocxx::v_noabi::client& client() const noexcept; /// /// Gets the options this session was created with. @@ -85,7 +86,7 @@ class client_session { /// Get the server-side "logical session ID" associated with this session, as a BSON document. /// This view is invalid after the session is destroyed. /// - bsoncxx::document::view id() const noexcept; + bsoncxx::v_noabi::document::view id() const noexcept; /// /// Get the session's clusterTime, as a BSON document. This is an opaque value suitable for @@ -93,14 +94,14 @@ class client_session { /// not been used for any operation and you have not called advance_cluster_time(). /// This view is invalid after the session is destroyed. /// - bsoncxx::document::view cluster_time() const noexcept; + bsoncxx::v_noabi::document::view cluster_time() const noexcept; /// /// Get the session's operationTime, as a BSON timestamp. This is an opaque value suitable for /// passing to advance_operation_time(). The timestamp is zero if the session has not been used /// for any operation and you have not called advance_operation_time(). /// - bsoncxx::types::b_timestamp operation_time() const noexcept; + bsoncxx::v_noabi::types::b_timestamp operation_time() const noexcept; /// /// Get the server_id the session is pinned to. The server_id is zero if the session is not @@ -126,7 +127,7 @@ class client_session { /// clusterTime from another session, ensuring subsequent operations in this session are /// causally consistent with the last operation in the other session. /// - void advance_cluster_time(const bsoncxx::document::view& cluster_time); + void advance_cluster_time(const bsoncxx::v_noabi::document::view& cluster_time); /// /// Advance the session's operation time, expressed as a BSON timestamp. Has an effect only if @@ -136,7 +137,7 @@ class client_session { /// clusterTime from another session, ensuring subsequent operations in this session are /// causally consistent with the last operation in the other session. /// - void advance_operation_time(const bsoncxx::types::b_timestamp& operation_time); + void advance_operation_time(const bsoncxx::v_noabi::types::b_timestamp& operation_time); /// /// Starts a transaction on the current client session. @@ -144,26 +145,26 @@ class client_session { /// @param transaction_opts (optional) /// The options to use in the transaction. /// - /// @throws mongocxx::operation_exception if the options are misconfigured, if there are network - /// or other transient failures, or if there are other errors such as a session with a - /// transaction already in progress. + /// @throws mongocxx::v_noabi::operation_exception if the options are misconfigured, if there + /// are network or other transient failures, or if there are other errors such as a session with + /// a transaction already in progress. /// void start_transaction(const stdx::optional& transaction_opts = {}); /// /// Commits a transaction on the current client session. /// - /// @throws mongocxx::operation_exception if the options are misconfigured, if there are network - /// or other transient failures, or if there are other errors such as a session with no - /// transaction in progress. + /// @throws mongocxx::v_noabi::operation_exception if the options are misconfigured, if there + /// are network or other transient failures, or if there are other errors such as a session with + /// no transaction in progress. /// void commit_transaction(); /// /// Aborts a transaction on the current client session. /// - /// @throws mongocxx::operation_exception if the options are misconfigured or if there are - /// other errors such as a session with no transaction in progress. + /// @throws mongocxx::v_noabi::operation_exception if the options are misconfigured or if there + /// are other errors such as a session with no transaction in progress. /// void abort_transaction(); @@ -185,7 +186,7 @@ class client_session { /// @param opts (optional) /// The options to use to run the transaction. /// - /// @throws mongocxx::operation_exception if there are errors completing the + /// @throws mongocxx::v_noabi::operation_exception if there are errors completing the /// transaction. /// using with_transaction_cb = std::function; @@ -201,7 +202,7 @@ class client_session { class MONGOCXX_PRIVATE impl; - MONGOCXX_PRIVATE client_session(const mongocxx::client* client, + MONGOCXX_PRIVATE client_session(const mongocxx::v_noabi::client* client, const options::client_session& options); MONGOCXX_PRIVATE impl& _get_impl(); @@ -217,5 +218,5 @@ class client_session { /// /// @example examples/mongocxx/client_session.cpp -/// Use a mongocxx::client_session for a sequence of operations with causal consistency. +/// Use a mongocxx::v_noabi::client_session for a sequence of operations with causal consistency. /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection-fwd.hpp index f38256bc06..8c251bee2b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API collection; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API collection; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::collection; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp index 0bfe941cd8..7070364e61 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp @@ -67,7 +67,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing server side document groupings within a MongoDB database. /// @@ -78,18 +79,18 @@ inline namespace v_noabi { /// Example: /// @code /// // Connect and get a collection. -/// mongocxx::client mongo_client{mongocxx::uri{}}; +/// mongocxx::v_noabi::client mongo_client{mongocxx::v_noabi::uri{}}; /// auto coll = mongo_client["database"]["collection"]; /// @endcode /// class collection { // - // Utility class supporting the convenience of {} meaning an empty bsoncxx::document. + // Utility class supporting the convenience of {} meaning an empty bsoncxx::v_noabi::document. // // Users may not use this class directly. // // In places where driver methods take this class as a parameter, passing {} will - // translate to a default-constructed bsoncxx::document::view_or_value, + // translate to a default-constructed bsoncxx::v_noabi::document::view_or_value, // regardless of other overloads taking other default-constructible types // for that parameter. This class avoids compiler ambiguity with such overloads. // @@ -147,10 +148,10 @@ class collection { /// @param pipeline /// The pipeline of aggregation operations to perform. /// @param options - /// Optional arguments, see mongocxx::options::aggregate. + /// Optional arguments, see mongocxx::v_noabi::options::aggregate. /// - /// @return A mongocxx::cursor with the results. If the query fails, - /// the cursor throws mongocxx::query_exception when the returned cursor + /// @return A mongocxx::v_noabi::cursor with the results. If the query fails, + /// the cursor throws mongocxx::v_noabi::query_exception when the returned cursor /// is iterated. /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ @@ -167,14 +168,14 @@ class collection { /// Runs an aggregation framework pipeline against this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// @param pipeline /// The pipeline of aggregation operations to perform. /// @param options - /// Optional arguments, see mongocxx::options::aggregate. + /// Optional arguments, see mongocxx::v_noabi::options::aggregate. /// - /// @return A mongocxx::cursor with the results. If the query fails, - /// the cursor throws mongocxx::query_exception when the returned cursor + /// @return A mongocxx::v_noabi::cursor with the results. If the query fails, + /// the cursor throws mongocxx::v_noabi::query_exception when the returned cursor /// is iterated. /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ @@ -198,27 +199,27 @@ class collection { /// The lifetime of the bulk_write is independent of the collection. /// /// @param options - /// Optional arguments; see mongocxx::options::bulk_write. + /// Optional arguments; see mongocxx::v_noabi::options::bulk_write. /// /// @return /// The newly-created bulk write. /// - mongocxx::bulk_write create_bulk_write(const options::bulk_write& options = {}); + mongocxx::v_noabi::bulk_write create_bulk_write(const options::bulk_write& options = {}); /// /// Creates a new bulk operation to be executed against this collection. /// The lifetime of the bulk_write is independent of the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the bulk operation. + /// The mongocxx::v_noabi::client_session with which to perform the bulk operation. /// @param options - /// Optional arguments; see mongocxx::options::bulk_write. + /// Optional arguments; see mongocxx::v_noabi::options::bulk_write. /// /// @return /// The newly-created bulk write. /// - mongocxx::bulk_write create_bulk_write(const client_session& session, - const options::bulk_write& options = {}); + mongocxx::v_noabi::bulk_write create_bulk_write(const client_session& session, + const options::bulk_write& options = {}); /// /// @} /// @@ -239,10 +240,10 @@ class collection { /// disengaged. /// /// @exception - /// mongocxx::bulk_write_exception when there are errors processing + /// mongocxx::v_noabi::bulk_write_exception when there are errors processing /// the writes. /// - /// @see mongocxx::bulk_write + /// @see mongocxx::v_noabi::bulk_write /// @see https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// MONGOCXX_INLINE stdx::optional write( @@ -252,7 +253,7 @@ class collection { /// Sends a write to the server as a bulk write operation. /// /// @param session - /// The mongocxx::client_session with which to perform the bulk operation. + /// The mongocxx::v_noabi::client_session with which to perform the bulk operation. /// @param write /// A model::write. /// @param options @@ -264,10 +265,10 @@ class collection { /// disengaged. /// /// @exception - /// mongocxx::bulk_write_exception when there are errors processing + /// mongocxx::v_noabi::bulk_write_exception when there are errors processing /// the writes. /// - /// @see mongocxx::bulk_write + /// @see mongocxx::v_noabi::bulk_write /// @see https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// MONGOCXX_INLINE stdx::optional write( @@ -296,9 +297,9 @@ class collection { /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception when there are errors processing the writes. + /// @throws mongocxx::v_noabi::bulk_write_exception when there are errors processing the writes. /// - /// @see mongocxx::bulk_write + /// @see mongocxx::v_noabi::bulk_write /// @see https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template @@ -313,7 +314,7 @@ class collection { /// type of model::write. /// /// @param session - /// The mongocxx::client_session with which to perform the bulk operation. + /// The mongocxx::v_noabi::client_session with which to perform the bulk operation. /// @param writes /// A container of model::write. /// @param options @@ -323,9 +324,9 @@ class collection { /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception when there are errors processing the writes. + /// @throws mongocxx::v_noabi::bulk_write_exception when there are errors processing the writes. /// - /// @see mongocxx::bulk_write + /// @see mongocxx::v_noabi::bulk_write /// @see https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template @@ -356,9 +357,9 @@ class collection { /// /// @return The optional result of the bulk operation execution, a result::bulk_write. /// - /// @throws mongocxx::bulk_write_exception when there are errors processing the writes. + /// @throws mongocxx::v_noabi::bulk_write_exception when there are errors processing the writes. /// - /// @see mongocxx::bulk_write + /// @see mongocxx::v_noabi::bulk_write /// @see https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template @@ -376,7 +377,7 @@ class collection { /// type of model::write. /// /// @param session - /// The mongocxx::client_session with which to perform the bulk operation. + /// The mongocxx::v_noabi::client_session with which to perform the bulk operation. /// @param begin /// Iterator pointing to the first model::write to send. /// @param end @@ -386,9 +387,9 @@ class collection { /// /// @return The optional result of the bulk operation execution, a result::bulk_write. /// - /// @throws mongocxx::bulk_write_exception when there are errors processing the writes. + /// @throws mongocxx::v_noabi::bulk_write_exception when there are errors processing the writes. /// - /// @see mongocxx::bulk_write + /// @see mongocxx::v_noabi::bulk_write /// @see https://www.mongodb.com/docs/manual/core/bulk-write-operations/ /// template @@ -409,11 +410,11 @@ class collection { /// @param filter /// The filter that documents must match in order to be counted. /// @param options - /// Optional arguments, see mongocxx::options::count. + /// Optional arguments, see mongocxx::v_noabi::options::count. /// /// @return The count of the documents that matched the filter. /// - /// @throws mongocxx::query_exception if the count operation fails. + /// @throws mongocxx::v_noabi::query_exception if the count operation fails. /// /// @note For a fast count of the total documents in a collection, see /// estimated_document_count(). @@ -423,34 +424,34 @@ class collection { /// estimatedDocumentCount are recommended to upgrade their server version to 5.0.8 or newer, or /// set `apiStrict: false` to avoid encountering errors. /// - /// @see mongocxx::estimated_document_count + /// @see mongocxx::v_noabi::collection::estimated_document_count /// - std::int64_t count_documents(bsoncxx::document::view_or_value filter, + std::int64_t count_documents(bsoncxx::v_noabi::document::view_or_value filter, const options::count& options = options::count()); /// /// Counts the number of documents matching the provided filter. /// /// @param session - /// The mongocxx::client_session with which to perform the count. + /// The mongocxx::v_noabi::client_session with which to perform the count. /// @param filter /// The filter that documents must match in order to be counted. /// @param options - /// Optional arguments, see mongocxx::options::count. + /// Optional arguments, see mongocxx::v_noabi::options::count. /// /// @return The count of the documents that matched the filter. /// - /// @throws mongocxx::query_exception if the count operation fails. + /// @throws mongocxx::v_noabi::query_exception if the count operation fails. /// /// @note Due to an oversight in MongoDB server versions 5.0.0 through 5.0.7, the `count` /// command was not included in Stable API v1. Users of the Stable API with /// estimatedDocumentCount are recommended to upgrade their server version to 5.0.8 or newer, or /// set `apiStrict: false` to avoid encountering errors. /// - /// @see mongocxx::estimated_document_count + /// @see mongocxx::v_noabi::collection::estimated_document_count /// std::int64_t count_documents(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::count& options = options::count()); /// /// @} @@ -462,16 +463,16 @@ class collection { /// Returns an estimate of the number of documents in the collection. /// /// @param options - /// Optional arguments, see mongocxx::options::count. + /// Optional arguments, see mongocxx::v_noabi::options::count. /// /// @return The count of the documents that matched the filter. /// - /// @throws mongocxx::query_exception if the count operation fails. + /// @throws mongocxx::v_noabi::query_exception if the count operation fails. /// /// @note This function is implemented in terms of the count server command. See: /// https://www.mongodb.com/docs/manual/reference/command/count/#behavior for more information. /// - /// @see mongocxx::count_documents + /// @see mongocxx::v_noabi::collection::count_documents /// std::int64_t estimated_document_count( const options::estimated_document_count& options = options::estimated_document_count()); @@ -489,10 +490,10 @@ class collection { /// @param index_options /// A document containing optional arguments for creating the index. /// @param operation_options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception - /// mongocxx::operation_exception if index creation fails. + /// mongocxx::v_noabi::operation_exception if index creation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/createIndexes/ @@ -500,25 +501,25 @@ class collection { /// @note /// Write concern supported only for MongoDB 3.4+. /// - bsoncxx::document::value create_index( - bsoncxx::document::view_or_value keys, - bsoncxx::document::view_or_value index_options = {}, + bsoncxx::v_noabi::document::value create_index( + bsoncxx::v_noabi::document::view_or_value keys, + bsoncxx::v_noabi::document::view_or_value index_options = {}, options::index_view operation_options = options::index_view{}); /// /// Creates an index over the collection for the provided keys with the provided options. /// /// @param session - /// The mongocxx::client_session with which to perform the index creation. + /// The mongocxx::v_noabi::client_session with which to perform the index creation. /// @param keys /// The keys for the index: @c {a: 1, b: -1} /// @param index_options /// A document containing optional arguments for creating the index. /// @param operation_options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception - /// mongocxx::operation_exception if index creation fails. + /// mongocxx::v_noabi::operation_exception if index creation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/createIndexes/ @@ -526,10 +527,10 @@ class collection { /// @note /// Write concern supported only for MongoDB 3.4+. /// - bsoncxx::document::value create_index( + bsoncxx::v_noabi::document::value create_index( const client_session& session, - bsoncxx::document::view_or_value keys, - bsoncxx::document::view_or_value index_options = {}, + bsoncxx::v_noabi::document::view_or_value keys, + bsoncxx::v_noabi::document::view_or_value index_options = {}, options::index_view operation_options = options::index_view{}); /// @@ -544,41 +545,41 @@ class collection { /// @param filter /// Document view representing the data to be deleted. /// @param options - /// Optional arguments, see mongocxx::options::delete_options. + /// Optional arguments, see mongocxx::v_noabi::options::delete_options. /// /// @return The optional result of performing the deletion. /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception if the delete fails. + /// @throws mongocxx::v_noabi::bulk_write_exception if the delete fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/delete/ /// stdx::optional delete_many( - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); /// /// Deletes all matching documents from the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the deletion. + /// The mongocxx::v_noabi::client_session with which to perform the deletion. /// @param filter /// Document view representing the data to be deleted. /// @param options - /// Optional arguments, see mongocxx::options::delete_options. + /// Optional arguments, see mongocxx::v_noabi::options::delete_options. /// /// @return The optional result of performing the deletion. /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception if the delete fails. + /// @throws mongocxx::v_noabi::bulk_write_exception if the delete fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/delete/ /// stdx::optional delete_many( const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); /// @@ -593,41 +594,41 @@ class collection { /// @param filter /// Document view representing the data to be deleted. /// @param options - /// Optional arguments, see mongocxx::options::delete_options. + /// Optional arguments, see mongocxx::v_noabi::options::delete_options. /// /// @return The optional result of performing the deletion. /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception if the delete fails. + /// @throws mongocxx::v_noabi::bulk_write_exception if the delete fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/delete/ /// stdx::optional delete_one( - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); /// /// Deletes a single matching document from the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the deletion. + /// The mongocxx::v_noabi::client_session with which to perform the deletion. /// @param filter /// Document view representing the data to be deleted. /// @param options - /// Optional arguments, see mongocxx::options::delete_options. + /// Optional arguments, see mongocxx::v_noabi::options::delete_options. /// /// @return The optional result of performing the deletion. /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception if the delete fails. + /// @throws mongocxx::v_noabi::bulk_write_exception if the delete fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/delete/ /// stdx::optional delete_one( const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); /// @@ -646,21 +647,21 @@ class collection { /// @param options /// Optional arguments, see options::distinct. - /// @return mongocxx::cursor having the distinct values for the specified + /// @return mongocxx::v_noabi::cursor having the distinct values for the specified /// field. If the operation fails, the cursor throws - /// mongocxx::query_exception when the returned cursor is iterated. + /// mongocxx::v_noabi::query_exception when the returned cursor is iterated. /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - cursor distinct(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value filter, + cursor distinct(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value filter, const options::distinct& options = options::distinct()); /// /// Finds the distinct values for a specified field across the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param name /// The field for which the distinct values will be found. /// @param filter @@ -668,15 +669,15 @@ class collection { /// @param options /// Optional arguments, see options::distinct. - /// @return mongocxx::cursor having the distinct values for the specified + /// @return mongocxx::v_noabi::cursor having the distinct values for the specified /// field. If the operation fails, the cursor throws - /// mongocxx::query_exception when the returned cursor is iterated. + /// mongocxx::v_noabi::query_exception when the returned cursor is iterated. /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// cursor distinct(const client_session& session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value filter, const options::distinct& options = options::distinct()); /// @@ -696,7 +697,7 @@ class collection { /// Collection options to use for this operation. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/drop/ @@ -704,14 +705,15 @@ class collection { /// @note /// Write concern supported only for MongoDB 3.4+. /// - void drop(const bsoncxx::stdx::optional& write_concern = {}, - bsoncxx::document::view_or_value collection_options = {}); + void drop(const bsoncxx::v_noabi::stdx::optional& + write_concern = {}, + bsoncxx::v_noabi::document::view_or_value collection_options = {}); /// /// Drops this collection and all its contained documents from the database. /// /// @param session - /// The mongocxx::client_session with which to perform the drop. + /// The mongocxx::v_noabi::client_session with which to perform the drop. /// @param write_concern (optional) /// The write concern to use for this operation. Defaults to the collection wide write /// concern if none is provided. @@ -719,7 +721,7 @@ class collection { /// Collection options to use for this operation. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/drop/ @@ -728,8 +730,9 @@ class collection { /// Write concern supported only for MongoDB 3.4+. /// void drop(const client_session& session, - const bsoncxx::stdx::optional& write_concern = {}, - bsoncxx::document::view_or_value collection_options = {}); + const bsoncxx::v_noabi::stdx::optional& + write_concern = {}, + bsoncxx::v_noabi::document::view_or_value collection_options = {}); /// /// @} @@ -745,39 +748,39 @@ class collection { /// @param options /// Optional arguments, see options::find /// - /// @return A mongocxx::cursor with the results. If the query fails, - /// the cursor throws mongocxx::query_exception when the returned cursor + /// @return A mongocxx::v_noabi::cursor with the results. If the query fails, + /// the cursor throws mongocxx::v_noabi::query_exception when the returned cursor /// is iterated. /// - /// @throws mongocxx::logic_error if the options are invalid, or if the unsupported option - /// modifiers "$query" or "$explain" are used. + /// @throws mongocxx::v_noabi::logic_error if the options are invalid, or if the unsupported + /// option modifiers "$query" or "$explain" are used. /// /// @see https://www.mongodb.com/docs/manual/core/read-operations-introduction/ /// - cursor find(bsoncxx::document::view_or_value filter, + cursor find(bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); /// /// Finds the documents in this collection which match the provided filter. /// /// @param session - /// The mongocxx::client_session with which to perform the query. + /// The mongocxx::v_noabi::client_session with which to perform the query. /// @param filter /// Document view representing a document that should match the query. /// @param options /// Optional arguments, see options::find /// - /// @return A mongocxx::cursor with the results. If the query fails, - /// the cursor throws mongocxx::query_exception when the returned cursor + /// @return A mongocxx::v_noabi::cursor with the results. If the query fails, + /// the cursor throws mongocxx::v_noabi::query_exception when the returned cursor /// is iterated. /// - /// @throws mongocxx::logic_error if the options are invalid, or if the unsupported option - /// modifiers "$query" or "$explain" are used. + /// @throws mongocxx::v_noabi::logic_error if the options are invalid, or if the unsupported + /// option modifiers "$query" or "$explain" are used. /// /// @see https://www.mongodb.com/docs/manual/core/read-operations-introduction/ /// cursor find(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); /// @@ -792,18 +795,19 @@ class collection { /// /// @return An optional document that matched the filter. /// - /// @throws mongocxx::query_exception if the operation fails. + /// @throws mongocxx::v_noabi::query_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/core/read-operations-introduction/ /// - stdx::optional find_one( - bsoncxx::document::view_or_value filter, const options::find& options = options::find()); + stdx::optional find_one( + bsoncxx::v_noabi::document::view_or_value filter, + const options::find& options = options::find()); /// /// Finds a single document in this collection that match the provided filter. /// /// @param session - /// The mongocxx::client_session with which to perform the query. + /// The mongocxx::v_noabi::client_session with which to perform the query. /// @param filter /// Document view representing a document that should match the query. /// @param options @@ -811,13 +815,13 @@ class collection { /// /// @return An optional document that matched the filter. /// - /// @throws mongocxx::query_exception if the operation fails. + /// @throws mongocxx::v_noabi::query_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/core/read-operations-introduction/ /// - stdx::optional find_one( + stdx::optional find_one( const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); /// @@ -837,21 +841,21 @@ class collection { /// @return The document that was deleted. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_delete( - bsoncxx::document::view_or_value filter, + 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()); /// /// Finds a single document matching the filter, deletes it, and returns the original. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param filter /// Document view representing a document that should be deleted. /// @param options @@ -860,15 +864,15 @@ class collection { /// @return The document that was deleted. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_delete( + stdx::optional find_one_and_delete( const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find_one_and_delete& options = options::find_one_and_delete()); /// @@ -891,15 +895,15 @@ class collection { /// @return The original or replaced document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_replace( - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement, + stdx::optional find_one_and_replace( + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement, const options::find_one_and_replace& options = options::find_one_and_replace()); /// @@ -907,7 +911,7 @@ class collection { /// or the replacement document. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param filter /// Document view representing a document that should be replaced. /// @param replacement @@ -918,16 +922,16 @@ class collection { /// @return The original or replaced document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_replace( + stdx::optional find_one_and_replace( const client_session& session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement, const options::find_one_and_replace& options = options::find_one_and_replace()); /// @@ -950,15 +954,15 @@ class collection { /// @return The original or updated document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_update( - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + stdx::optional find_one_and_update( + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::find_one_and_update& options = options::find_one_and_update()); /// @@ -975,14 +979,14 @@ class collection { /// @return The original or updated document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_update( - bsoncxx::document::view_or_value filter, + stdx::optional find_one_and_update( + bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::find_one_and_update& options = options::find_one_and_update()); @@ -1000,14 +1004,14 @@ class collection { /// @return The original or updated document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_update( - bsoncxx::document::view_or_value filter, + stdx::optional find_one_and_update( + bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, const options::find_one_and_update& options = options::find_one_and_update()); @@ -1016,7 +1020,7 @@ class collection { /// or the newly-updated document. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param filter /// Document view representing a document that should be updated. /// @param update @@ -1027,16 +1031,16 @@ class collection { /// @return The original or updated document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_update( + stdx::optional find_one_and_update( const client_session& session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::find_one_and_update& options = options::find_one_and_update()); /// @@ -1044,7 +1048,7 @@ class collection { /// or the newly-updated document. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param filter /// Document view representing a document that should be updated. /// @param update @@ -1055,15 +1059,15 @@ class collection { /// @return The original or updated document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_update( + stdx::optional find_one_and_update( const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::find_one_and_update& options = options::find_one_and_update()); @@ -1072,7 +1076,7 @@ class collection { /// or the newly-updated document. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param filter /// Document view representing a document that should be updated. /// @param update @@ -1083,15 +1087,15 @@ class collection { /// @return The original or updated document. /// /// @exception - /// Throws mongocxx::logic_error if the collation option is specified and an unacknowledged - /// write concern is used. + /// Throws mongocxx::v_noabi::logic_error if the collation option is specified and an + /// unacknowledged write concern is used. /// /// @exception - /// Throws mongocxx::write_exception if the operation fails. + /// Throws mongocxx::v_noabi::write_exception if the operation fails. /// - stdx::optional find_one_and_update( + stdx::optional find_one_and_update( const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, const options::find_one_and_update& options = options::find_one_and_update()); @@ -1114,15 +1118,15 @@ class collection { /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception if the operation fails. - stdx::optional insert_one(bsoncxx::document::view_or_value document, - const options::insert& options = {}); + /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. + stdx::optional insert_one( + bsoncxx::v_noabi::document::view_or_value document, const options::insert& options = {}); /// /// Inserts a single document into the collection. If the document is missing an identifier /// (@c _id field) one will be generated for it. /// /// @param session - /// The mongocxx::client_session with which to perform the insert. + /// The mongocxx::v_noabi::client_session with which to perform the insert. /// @param document /// The document to insert. /// @param options @@ -1132,10 +1136,11 @@ class collection { /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception if the operation fails. - stdx::optional insert_one(const client_session& session, - bsoncxx::document::view_or_value document, - const options::insert& options = {}); + /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. + stdx::optional insert_one( + const client_session& session, + bsoncxx::v_noabi::document::view_or_value document, + const options::insert& options = {}); /// /// @} /// @@ -1163,7 +1168,7 @@ class collection { /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception when the operation fails. + /// @throws mongocxx::v_noabi::bulk_write_exception when the operation fails. /// template MONGOCXX_INLINE stdx::optional insert_many( @@ -1178,7 +1183,7 @@ class collection { /// type of model::write. /// /// @param session - /// The mongocxx::client_session with which to perform the inserts. + /// The mongocxx::v_noabi::client_session with which to perform the inserts. /// @param container /// Container of a documents to insert. /// @param options @@ -1188,7 +1193,7 @@ class collection { /// If the write concern is unacknowledged, the optional will be /// disengaged. /// - /// @throws mongocxx::bulk_write_exception when the operation fails. + /// @throws mongocxx::v_noabi::bulk_write_exception when the operation fails. /// template MONGOCXX_INLINE stdx::optional insert_many( @@ -1208,7 +1213,7 @@ class collection { /// /// @tparam document_view_iterator_type /// The iterator type. Must meet the requirements for the input iterator concept with a value - /// type of bsoncxx::document::view. + /// type of bsoncxx::v_noabi::document::view. /// /// @param begin /// Iterator pointing to the first document to be inserted. @@ -1219,7 +1224,7 @@ class collection { /// /// @return The result of attempting to performing the insert. /// - /// @throws mongocxx::bulk_write_exception if the operation fails. + /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. /// template MONGOCXX_INLINE stdx::optional insert_many( @@ -1233,10 +1238,10 @@ class collection { /// /// @tparam document_view_iterator_type /// The iterator type. Must meet the requirements for the input iterator concept with a value - /// type of bsoncxx::document::view. + /// type of bsoncxx::v_noabi::document::view. /// /// @param session - /// The mongocxx::client_session with which to perform the inserts. + /// The mongocxx::v_noabi::client_session with which to perform the inserts. /// @param begin /// Iterator pointing to the first document to be inserted. /// @param end @@ -1246,7 +1251,7 @@ class collection { /// /// @return The result of attempting to performing the insert. /// - /// @throws mongocxx::bulk_write_exception if the operation fails. + /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. /// template MONGOCXX_INLINE stdx::optional insert_many( @@ -1265,7 +1270,7 @@ class collection { /// /// @return Cursor yielding the index specifications. /// - /// @throws mongocxx::operation_exception if the operation fails. + /// @throws mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listIndexes/ /// @@ -1275,11 +1280,11 @@ class collection { /// Returns a list of the indexes currently on this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// /// @return Cursor yielding the index specifications. /// - /// @throws mongocxx::operation_exception if the operation fails. + /// @throws mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listIndexes/ /// @@ -1308,7 +1313,7 @@ class collection { /// concern if none is provided. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/renameCollection/ @@ -1316,15 +1321,15 @@ class collection { /// @note /// Write concern supported only for MongoDB 3.4+. /// - void rename(bsoncxx::string::view_or_value new_name, + void rename(bsoncxx::v_noabi::string::view_or_value new_name, bool drop_target_before_rename = false, - const bsoncxx::stdx::optional& write_concern = {}); + const bsoncxx::v_noabi::stdx::optional& write_concern = {}); /// /// Rename this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the rename. + /// The mongocxx::v_noabi::client_session with which to perform the rename. /// @param new_name The new name to assign to the collection. /// @param drop_target_before_rename Whether to overwrite any /// existing collections called new_name. The default is false. @@ -1333,7 +1338,7 @@ class collection { /// concern if none is provided. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/renameCollection/ @@ -1342,9 +1347,9 @@ class collection { /// Write concern supported only for MongoDB 3.4+. /// void rename(const client_session& session, - bsoncxx::string::view_or_value new_name, + bsoncxx::v_noabi::string::view_or_value new_name, bool drop_target_before_rename = false, - const bsoncxx::stdx::optional& write_concern = {}); + const bsoncxx::v_noabi::stdx::optional& write_concern = {}); /// /// @} @@ -1359,7 +1364,7 @@ class collection { /// /// @see https://www.mongodb.com/docs/manual/reference/read-concern/ /// - void read_concern(mongocxx::read_concern rc); + void read_concern(mongocxx::v_noabi::read_concern rc); /// /// Gets the read_concern for the collection. @@ -1369,7 +1374,7 @@ class collection { /// /// @return The current read_concern. /// - mongocxx::read_concern read_concern() const; + mongocxx::v_noabi::read_concern read_concern() const; /// /// Sets the read_preference for this collection. Changes will not have any effect on existing @@ -1380,7 +1385,7 @@ class collection { /// /// @see https://www.mongodb.com/docs/manual/core/read-preference/ /// - void read_preference(mongocxx::read_preference rp); + void read_preference(mongocxx::v_noabi::read_preference rp); /// /// Gets the read_preference for the collection. @@ -1389,7 +1394,7 @@ class collection { /// /// @see https://www.mongodb.com/docs/manual/core/read-preference/ /// - mongocxx::read_preference read_preference() const; + mongocxx::v_noabi::read_preference read_preference() const; /// /// @{ @@ -1408,21 +1413,21 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the replacement is invalid, or mongocxx::bulk_write_exception if - /// the operation fails. + /// mongocxx::v_noabi::logic_error if the replacement is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional replace_one( - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement, const options::replace& options = options::replace{}); /// /// Replaces a single document matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the replace. + /// The mongocxx::v_noabi::client_session with which to perform the replace. /// @param filter /// Document representing the match criteria. /// @param replacement @@ -1435,15 +1440,15 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the replacement is invalid, or mongocxx::bulk_write_exception if - /// the operation fails. + /// mongocxx::v_noabi::logic_error if the replacement is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional replace_one( const client_session& session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement, const options::replace& options = options::replace{}); /// @@ -1463,13 +1468,13 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - stdx::optional update_many(bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + 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()); /// @@ -1487,12 +1492,12 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - stdx::optional update_many(bsoncxx::document::view_or_value filter, + stdx::optional update_many(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::update& options = options::update()); @@ -1511,12 +1516,12 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - stdx::optional update_many(bsoncxx::document::view_or_value filter, + 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()); @@ -1524,7 +1529,7 @@ class collection { /// Updates multiple documents matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the update. + /// The mongocxx::v_noabi::client_session with which to perform the update. /// @param filter /// Document representing the match criteria. /// @param update @@ -1537,21 +1542,21 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional update_many(const client_session& session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::update& options = options::update()); /// /// Updates multiple documents matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the update. + /// The mongocxx::v_noabi::client_session with which to perform the update. /// @param filter /// Document representing the match criteria. /// @param update @@ -1564,13 +1569,13 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional update_many(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::update& options = options::update()); @@ -1578,7 +1583,7 @@ class collection { /// Updates multiple documents matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the update. + /// The mongocxx::v_noabi::client_session with which to perform the update. /// @param filter /// Document representing the match criteria. /// @param update @@ -1591,13 +1596,13 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional update_many(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, const options::update& options = options::update()); @@ -1622,13 +1627,13 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - stdx::optional update_one(bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + 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()); /// @@ -1646,12 +1651,12 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - stdx::optional update_one(bsoncxx::document::view_or_value filter, + stdx::optional update_one(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::update& options = options::update()); @@ -1670,12 +1675,12 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - stdx::optional update_one(bsoncxx::document::view_or_value filter, + 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()); @@ -1683,7 +1688,7 @@ class collection { /// Updates a single document matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the update. + /// The mongocxx::v_noabi::client_session with which to perform the update. /// @param filter /// Document representing the match criteria. /// @param update @@ -1696,21 +1701,21 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional update_one(const client_session& session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::update& options = options::update()); /// /// Updates a single document matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the update. + /// The mongocxx::v_noabi::client_session with which to perform the update. /// @param filter /// Document representing the match criteria. /// @param update @@ -1723,13 +1728,13 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional update_one(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update, const options::update& options = options::update()); @@ -1737,7 +1742,7 @@ class collection { /// Updates a single document matching the provided filter in this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the update. + /// The mongocxx::v_noabi::client_session with which to perform the update. /// @param filter /// Document representing the match criteria. /// @param update @@ -1750,13 +1755,13 @@ class collection { /// disengaged. /// /// @throws - /// mongocxx::logic_error if the update is invalid, or mongocxx::bulk_write_exception if the - /// operation fails. + /// mongocxx::v_noabi::logic_error if the update is invalid, or + /// mongocxx::v_noabi::bulk_write_exception if the operation fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// stdx::optional update_one(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update, const options::update& options = options::update()); @@ -1771,14 +1776,14 @@ class collection { /// @param wc /// The new write_concern to use. /// - void write_concern(mongocxx::write_concern wc); + void write_concern(mongocxx::v_noabi::write_concern wc); /// /// Gets the write_concern for the collection. /// /// @return The current write_concern. /// - mongocxx::write_concern write_concern() const; + mongocxx::v_noabi::write_concern write_concern() const; /// /// Gets an index_view to the collection. @@ -1802,7 +1807,7 @@ class collection { /// /// @param session - /// The mongocxx::client_session with which to perform the watch operation. + /// The mongocxx::v_noabi::client_session with which to perform the watch operation. /// @param options /// The options to use when creating the change stream. /// @@ -1835,7 +1840,7 @@ class collection { /// Gets a change stream on this collection. /// /// @param session - /// The mongocxx::client_session with which to perform the watch operation. + /// The mongocxx::v_noabi::client_session with which to perform the watch operation. /// @param pipe /// The aggregation pipeline to be used on the change notifications. /// @param options @@ -1864,7 +1869,7 @@ class collection { friend ::mongocxx::v_noabi::database; MONGOCXX_PRIVATE collection(const database& database, - bsoncxx::string::view_or_value collection_name); + bsoncxx::v_noabi::string::view_or_value collection_name); MONGOCXX_PRIVATE collection(const database& database, void* collection); @@ -1873,75 +1878,75 @@ class collection { const options::aggregate& options); MONGOCXX_PRIVATE std::int64_t _count(const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::count& options); MONGOCXX_PRIVATE std::int64_t _count_documents(const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::count& options); - MONGOCXX_PRIVATE bsoncxx::document::value _create_index( + MONGOCXX_PRIVATE bsoncxx::v_noabi::document::value _create_index( const client_session* session, - bsoncxx::document::view_or_value keys, - bsoncxx::document::view_or_value index_options, + bsoncxx::v_noabi::document::view_or_value keys, + bsoncxx::v_noabi::document::view_or_value index_options, options::index_view operation_options); MONGOCXX_PRIVATE stdx::optional _delete_many( const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options); MONGOCXX_PRIVATE stdx::optional _delete_one( const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options); MONGOCXX_PRIVATE cursor _distinct(const client_session* session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value filter, const options::distinct& options); MONGOCXX_PRIVATE void _drop( const client_session* session, - const bsoncxx::stdx::optional& write_concern, - bsoncxx::document::view_or_value collection_options); + const bsoncxx::v_noabi::stdx::optional& write_concern, + bsoncxx::v_noabi::document::view_or_value collection_options); MONGOCXX_PRIVATE cursor _find(const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find& options); - MONGOCXX_PRIVATE stdx::optional _find_one( + MONGOCXX_PRIVATE stdx::optional _find_one( const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find& options); - MONGOCXX_PRIVATE stdx::optional _find_one_and_delete( + MONGOCXX_PRIVATE stdx::optional _find_one_and_delete( const client_session* session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find_one_and_delete& options); - MONGOCXX_PRIVATE stdx::optional _find_one_and_replace( + MONGOCXX_PRIVATE stdx::optional _find_one_and_replace( const client_session* session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement, const options::find_one_and_replace& options); - MONGOCXX_PRIVATE stdx::optional _find_one_and_update( + MONGOCXX_PRIVATE stdx::optional _find_one_and_update( const client_session* session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::find_one_and_update& options); MONGOCXX_PRIVATE stdx::optional _insert_one( const client_session* session, - bsoncxx::document::view_or_value document, + bsoncxx::v_noabi::document::view_or_value document, const options::insert& options); MONGOCXX_PRIVATE void _rename( const client_session* session, - bsoncxx::string::view_or_value new_name, + bsoncxx::v_noabi::string::view_or_value new_name, bool drop_target_before_rename, - const bsoncxx::stdx::optional& write_concern); + const bsoncxx::v_noabi::stdx::optional& write_concern); MONGOCXX_PRIVATE stdx::optional _replace_one( const client_session* session, @@ -1950,20 +1955,20 @@ class collection { MONGOCXX_PRIVATE stdx::optional _replace_one( const client_session* session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement, const options::replace& options); MONGOCXX_PRIVATE stdx::optional _update_one( const client_session* session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::update& options); MONGOCXX_PRIVATE stdx::optional _update_many( const client_session* session, - bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update, + bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update, const options::update& options); MONGOCXX_PRIVATE change_stream _watch(const client_session* session, @@ -1971,15 +1976,16 @@ class collection { const options::change_stream& options); // Helpers for the insert_many method templates. - mongocxx::bulk_write _init_insert_many(const options::insert& options, - const client_session* session); + mongocxx::v_noabi::bulk_write _init_insert_many(const options::insert& options, + const client_session* session); - void _insert_many_doc_handler(mongocxx::bulk_write& writes, - bsoncxx::builder::basic::array& inserted_ids, - bsoncxx::document::view doc) const; + void _insert_many_doc_handler(mongocxx::v_noabi::bulk_write& writes, + bsoncxx::v_noabi::builder::basic::array& inserted_ids, + bsoncxx::v_noabi::document::view doc) const; stdx::optional _exec_insert_many( - mongocxx::bulk_write& writes, bsoncxx::builder::basic::array& inserted_ids); + mongocxx::v_noabi::bulk_write& writes, + bsoncxx::v_noabi::builder::basic::array& inserted_ids); template MONGOCXX_PRIVATE stdx::optional _insert_many( @@ -2062,9 +2068,9 @@ MONGOCXX_INLINE stdx::optional collection::_insert_many( document_view_iterator_type begin, document_view_iterator_type end, const options::insert& options) { - bsoncxx::builder::basic::array inserted_ids; + bsoncxx::v_noabi::builder::basic::array inserted_ids; auto writes = _init_insert_many(options, session); - std::for_each(begin, end, [&inserted_ids, &writes, this](bsoncxx::document::view doc) { + std::for_each(begin, end, [&inserted_ids, &writes, this](bsoncxx::v_noabi::document::view doc) { _insert_many_doc_handler(writes, inserted_ids, doc); }); return _exec_insert_many(writes, inserted_ids); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor-fwd.hpp index 98828890ca..2fa673aeb4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API cursor; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API cursor; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::cursor; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp index db9d983299..68b52b650e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp @@ -30,7 +30,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a pointer to the result set of a query on a MongoDB server. /// @@ -71,7 +72,7 @@ class cursor { /// /// @return the cursor::iterator /// - /// @throws mongocxx::query_exception if the query failed + /// @throws mongocxx::v_noabi::query_exception if the query failed /// iterator begin(); @@ -93,8 +94,9 @@ class cursor { friend ::mongocxx::v_noabi::cursor::iterator; - MONGOCXX_PRIVATE cursor(void* cursor_ptr, - bsoncxx::stdx::optional cursor_type = bsoncxx::stdx::nullopt); + MONGOCXX_PRIVATE cursor( + void* cursor_ptr, + bsoncxx::v_noabi::stdx::optional cursor_type = bsoncxx::v_noabi::stdx::nullopt); class MONGOCXX_PRIVATE impl; std::unique_ptr _impl; @@ -104,14 +106,14 @@ class cursor { /// Class representing an input iterator of documents in a MongoDB cursor /// result set. /// -/// All non-end iterators derived from the same mongocxx::cursor move in +/// All non-end iterators derived from the same mongocxx::v_noabi::cursor move in /// lock-step. Dereferencing any non-end() iterator always gives the first /// remaining document in the cursor. Incrementing one non-end iterator is /// equivalent to incrementing them all. /// /// An iterator is 'exhausted' when no documents are available. An /// end-iterator is always exhausted. A non-end iterator is exhausted when the -/// originating mongocxx::cursor has no more documents. When an iterator is +/// originating mongocxx::v_noabi::cursor has no more documents. When an iterator is /// exhausted, it must not be dereferenced or incremented. /// /// For iterators of a tailable cursor, calling cursor.begin() may revive an @@ -123,33 +125,33 @@ class cursor::iterator { /// /// std::iterator_traits /// - using value_type = bsoncxx::document::view; - using reference = bsoncxx::document::view&; - using pointer = bsoncxx::document::view*; + using value_type = bsoncxx::v_noabi::document::view; + using reference = bsoncxx::v_noabi::document::view&; + using pointer = bsoncxx::v_noabi::document::view*; using iterator_category = std::input_iterator_tag; using difference_type = std::ptrdiff_t; /// /// Dereferences the view for the document currently being pointed to. /// - const bsoncxx::document::view& operator*() const; + const bsoncxx::v_noabi::document::view& operator*() const; /// /// Accesses a member of the dereferenced document currently being pointed to. /// - const bsoncxx::document::view* operator->() const; + const bsoncxx::v_noabi::document::view* operator->() const; /// /// Pre-increments the iterator to move to the next document. /// - /// @throws mongocxx::query_exception if the query failed + /// @throws mongocxx::v_noabi::query_exception if the query failed /// iterator& operator++(); /// /// Post-increments the iterator to move to the next document. /// - /// @throws mongocxx::query_exception if the query failed + /// @throws mongocxx::v_noabi::query_exception if the query failed /// void operator++(int); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database-fwd.hpp index df41e7745a..e5ba76ecb1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API database; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API database; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::database; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp index 2835504510..da717ce4f8 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp @@ -35,7 +35,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a MongoDB database. /// @@ -92,10 +93,10 @@ class database { /// @param pipeline /// The pipeline of aggregation operations to perform. /// @param options - /// Optional arguments, see mongocxx::options::aggregate. + /// Optional arguments, see mongocxx::v_noabi::options::aggregate. /// - /// @return A mongocxx::cursor with the results. If the query fails, - /// the cursor throws mongocxx::query_exception when the returned cursor + /// @return A mongocxx::v_noabi::cursor with the results. If the query fails, + /// the cursor throws mongocxx::v_noabi::query_exception when the returned cursor /// is iterated. /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/#dbcmd.aggregate @@ -114,14 +115,14 @@ class database { /// such as $currentOp and $listLocalSessions. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// @param pipeline /// The pipeline of aggregation operations to perform. /// @param options - /// Optional arguments, see mongocxx::options::aggregate. + /// Optional arguments, see mongocxx::v_noabi::options::aggregate. /// - /// @return A mongocxx::cursor with the results. If the query fails, - /// the cursor throws mongocxx::query_exception when the returned cursor + /// @return A mongocxx::v_noabi::cursor with the results. If the query fails, + /// the cursor throws mongocxx::v_noabi::query_exception when the returned cursor /// is iterated. /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/#dbcmd.aggregate @@ -148,23 +149,24 @@ class database { /// @param command document representing the command to be run. /// @return the result of executing the command. /// - /// @throws mongocxx::operation_exception if the operation fails. + /// @throws mongocxx::v_noabi::operation_exception if the operation fails. /// - bsoncxx::document::value run_command(bsoncxx::document::view_or_value command); + bsoncxx::v_noabi::document::value run_command( + bsoncxx::v_noabi::document::view_or_value command); /// /// Runs a command against this database. /// /// @see https://www.mongodb.com/docs/manual/reference/method/db.runCommand/ /// - /// @param session The mongocxx::client_session with which to run the command. + /// @param session The mongocxx::v_noabi::client_session with which to run the command. /// @param command document representing the command to be run. /// @return the result of executing the command. /// - /// @throws mongocxx::operation_exception if the operation fails. + /// @throws mongocxx::v_noabi::operation_exception if the operation fails. /// - bsoncxx::document::value run_command(const client_session& session, - bsoncxx::document::view_or_value command); + bsoncxx::v_noabi::document::value run_command( + const client_session& session, bsoncxx::v_noabi::document::view_or_value command); /// /// Executes a command on a specific server using this database. @@ -175,10 +177,10 @@ class database { /// @param server_id specifying which server to use. /// @return the result of executing the command. /// - /// @throws mongocxx::operation_exception if the operation fails. + /// @throws mongocxx::v_noabi::operation_exception if the operation fails. /// - bsoncxx::document::value run_command(bsoncxx::document::view_or_value command, - uint32_t server_id); + bsoncxx::v_noabi::document::value run_command(bsoncxx::v_noabi::document::view_or_value command, + uint32_t server_id); /// /// @} /// @@ -203,11 +205,12 @@ class database { /// set write concern if none passed here. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// - mongocxx::collection create_collection(stdx::string_view name, - bsoncxx::document::view_or_value collection_options = {}, - const stdx::optional& write_concern = {}); + mongocxx::v_noabi::collection create_collection( + stdx::string_view name, + bsoncxx::v_noabi::document::view_or_value collection_options = {}, + const stdx::optional& write_concern = {}); /// /// Explicitly creates a collection in this database with the specified options. @@ -219,7 +222,7 @@ class database { /// https://www.mongodb.com/docs/manual/core/timeseries-collections/ /// /// @param session - /// The mongocxx::client_session with which to perform the create operation. + /// The mongocxx::v_noabi::client_session with which to perform the create operation. /// @param name /// the new collection's name. /// @param collection_options @@ -229,19 +232,20 @@ class database { /// set write concern if none passed here. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// - mongocxx::collection create_collection(const client_session& session, - stdx::string_view name, - bsoncxx::document::view_or_value collection_options = {}, - const stdx::optional& write_concern = {}); + mongocxx::v_noabi::collection create_collection( + const client_session& session, + stdx::string_view name, + bsoncxx::v_noabi::document::view_or_value collection_options = {}, + const stdx::optional& write_concern = {}); /// /// Explicitly creates a collection in this database with the specified options. /// /// @deprecated /// This overload is deprecated. Call database::create_collection with a - /// bsoncxx::document::view_or_value collection_options instead. + /// bsoncxx::v_noabi::document::view_or_value collection_options instead. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/create/ @@ -255,17 +259,17 @@ class database { /// set write concern if none passed here. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// - MONGOCXX_DEPRECATED mongocxx::collection create_collection( - bsoncxx::string::view_or_value name, + MONGOCXX_DEPRECATED 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 = {}) { return create_collection_deprecated(name, collection_options, write_concern); } - mongocxx::collection create_collection_deprecated( - bsoncxx::string::view_or_value name, + 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 = {}); @@ -274,13 +278,13 @@ class database { /// /// @deprecated /// This overload is deprecated. Call database::create_collection with a - /// bsoncxx::document::view_or_value collection_options instead. + /// bsoncxx::v_noabi::document::view_or_value collection_options instead. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/create/ /// /// @param session - /// The mongocxx::client_session with which to perform the create operation. + /// The mongocxx::v_noabi::client_session with which to perform the create operation. /// @param name /// the new collection's name. /// @param collection_options @@ -290,11 +294,11 @@ class database { /// set write concern if none passed here. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// - MONGOCXX_DEPRECATED mongocxx::collection create_collection( + MONGOCXX_DEPRECATED mongocxx::v_noabi::collection create_collection( const client_session& session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, const stdx::optional& write_concern = {}) { return create_collection_deprecated(session, name, collection_options, write_concern); @@ -305,13 +309,13 @@ class database { /// /// @deprecated /// This overload is deprecated. Call database::create_collection with a - /// bsoncxx::document::view_or_value collection_options instead. + /// bsoncxx::v_noabi::document::view_or_value collection_options instead. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/create/ /// /// @param session - /// The mongocxx::client_session with which to perform the create operation. + /// The mongocxx::v_noabi::client_session with which to perform the create operation. /// @param name /// the new collection's name. /// @param collection_options @@ -321,11 +325,11 @@ class database { /// set write concern if none passed here. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// - mongocxx::collection create_collection_deprecated( + mongocxx::v_noabi::collection create_collection_deprecated( const client_session& session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, const stdx::optional& write_concern = {}); @@ -343,30 +347,32 @@ class database { /// set on the database will be used. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/dropDatabase/ /// - void drop(const bsoncxx::stdx::optional& write_concern = {}); + void drop(const bsoncxx::v_noabi::stdx::optional& + write_concern = {}); /// /// Drops the database and all its collections. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// @param write_concern (optional) /// The write concern to be used for this operation. If not passed here, the write concern /// set on the database will be used. /// /// @exception - /// mongocxx::operation_exception if the operation fails. + /// mongocxx::v_noabi::operation_exception if the operation fails. /// /// @see /// https://www.mongodb.com/docs/manual/reference/command/dropDatabase/ /// void drop(const client_session& session, - const bsoncxx::stdx::optional& write_concern = {}); + const bsoncxx::v_noabi::stdx::optional& + write_concern = {}); /// /// @} /// @@ -378,10 +384,10 @@ class database { /// /// @return bool whether the collection exists in this database. /// - /// @throws mongocxx::operation_exception if the underlying 'listCollections' + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listCollections' /// command fails. /// - bool has_collection(bsoncxx::string::view_or_value name) const; + bool has_collection(bsoncxx::v_noabi::string::view_or_value name) const; /// /// @{ @@ -391,26 +397,26 @@ class database { /// @param filter /// An optional query expression to filter the returned collections. /// - /// @return mongocxx::cursor containing the collection information. + /// @return mongocxx::v_noabi::cursor containing the collection information. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listCollections/ /// - cursor list_collections(bsoncxx::document::view_or_value filter = {}); + cursor list_collections(bsoncxx::v_noabi::document::view_or_value filter = {}); /// /// Enumerates the collections in this database. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// @param filter /// An optional query expression to filter the returned collections. /// - /// @return mongocxx::cursor containing the collection information. + /// @return mongocxx::v_noabi::cursor containing the collection information. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listCollections/ /// cursor list_collections(const client_session& session, - bsoncxx::document::view_or_value filter = {}); + bsoncxx::v_noabi::document::view_or_value filter = {}); /// /// Enumerates the collection names in this database. @@ -420,30 +426,31 @@ class database { /// /// @return std::vector containing the collection names. /// - /// @throws mongocxx::operation_exception if the underlying 'listCollections' + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listCollections' /// command fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listCollections/ /// - std::vector list_collection_names(bsoncxx::document::view_or_value filter = {}); + std::vector list_collection_names( + bsoncxx::v_noabi::document::view_or_value filter = {}); /// /// Enumerates the collection names in this database. /// /// @param session - /// The mongocxx::client_session with which to perform the aggregation. + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// @param filter /// An optional query expression to filter the returned collection names. /// /// @return std::vector containing the collection names. /// - /// @throws mongocxx::operation_exception if the underlying 'listCollections' + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listCollections' /// command fails. /// /// @see https://www.mongodb.com/docs/manual/reference/command/listCollections/ /// - std::vector list_collection_names(const client_session& session, - bsoncxx::document::view_or_value filter = {}); + std::vector list_collection_names( + const client_session& session, bsoncxx::v_noabi::document::view_or_value filter = {}); /// /// @} @@ -468,7 +475,7 @@ class database { /// /// @see https://www.mongodb.com/docs/manual/reference/read-concern/ /// - void read_concern(mongocxx::read_concern rc); + void read_concern(mongocxx::v_noabi::read_concern rc); /// /// The current read concern for this database. @@ -478,7 +485,7 @@ class database { /// /// @return the current read_concern /// - mongocxx::read_concern read_concern() const; + mongocxx::v_noabi::read_concern read_concern() const; /// /// Sets the read_preference for this database. @@ -491,7 +498,7 @@ class database { /// /// @param rp the new read_preference. /// - void read_preference(mongocxx::read_preference rp); + void read_preference(mongocxx::v_noabi::read_preference rp); /// /// The current read preference for this database. @@ -500,7 +507,7 @@ class database { /// /// @return the current read_preference /// - mongocxx::read_preference read_preference() const; + mongocxx::v_noabi::read_preference read_preference() const; /// /// Sets the write_concern for this database. @@ -509,14 +516,14 @@ class database { /// from this database, but do affect new ones as new collections will receive a copy of the /// write_concern of this database upon instantiation. /// - void write_concern(mongocxx::write_concern wc); + void write_concern(mongocxx::v_noabi::write_concern wc); /// /// The current write_concern for this database. /// /// @return the current write_concern /// - mongocxx::write_concern write_concern() const; + mongocxx::v_noabi::write_concern write_concern() const; /// /// Access a collection (logical grouping of documents) within this database. @@ -525,7 +532,7 @@ class database { /// /// @return the collection. /// - mongocxx::collection collection(bsoncxx::string::view_or_value name) const; + mongocxx::v_noabi::collection collection(bsoncxx::v_noabi::string::view_or_value name) const; /// /// Allows the db["collection_name"] syntax to be used to access a collection within this @@ -535,7 +542,8 @@ class database { /// /// @return the collection. /// - MONGOCXX_INLINE mongocxx::collection operator[](bsoncxx::string::view_or_value name) const; + MONGOCXX_INLINE mongocxx::v_noabi::collection operator[]( + bsoncxx::v_noabi::string::view_or_value name) const; /// /// Access a GridFS bucket within this database. @@ -549,9 +557,9 @@ class database { /// @note /// See the class comment for `gridfs::bucket` for more information about GridFS. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - mongocxx::gridfs::bucket gridfs_bucket( + gridfs::bucket gridfs_bucket( const options::gridfs::bucket& options = options::gridfs::bucket()) const; /// @@ -572,7 +580,7 @@ class database { /// /// @param session - /// The mongocxx::client_session with which to perform the watch operation. + /// The mongocxx::v_noabi::client_session with which to perform the watch operation. /// @param options /// The options to use when creating the change stream. /// @@ -605,7 +613,7 @@ class database { /// Gets a change stream on this database. /// /// @param session - /// The mongocxx::client_session with which to perform the watch operation. + /// The mongocxx::v_noabi::client_session with which to perform the watch operation. /// @param pipe /// The aggregation pipeline to be used on the change notifications. /// @param options @@ -629,36 +637,37 @@ class database { friend ::mongocxx::v_noabi::client; friend ::mongocxx::v_noabi::collection; - MONGOCXX_PRIVATE database(const mongocxx::client& client, bsoncxx::string::view_or_value name); + MONGOCXX_PRIVATE database(const mongocxx::v_noabi::client& client, + bsoncxx::v_noabi::string::view_or_value name); MONGOCXX_PRIVATE cursor _aggregate(const client_session* session, const pipeline& pipeline, const options::aggregate& options); - MONGOCXX_PRIVATE bsoncxx::document::value _run_command( - const client_session* session, bsoncxx::document::view_or_value command); + MONGOCXX_PRIVATE bsoncxx::v_noabi::document::value _run_command( + const client_session* session, bsoncxx::v_noabi::document::view_or_value command); - MONGOCXX_PRIVATE mongocxx::collection _create_collection( + MONGOCXX_PRIVATE mongocxx::v_noabi::collection _create_collection( const client_session* session, stdx::string_view name, - bsoncxx::document::view_or_value collection_options, - const stdx::optional& write_concern); + bsoncxx::v_noabi::document::view_or_value collection_options, + const stdx::optional& write_concern); - MONGOCXX_PRIVATE mongocxx::collection _create_collection_deprecated( + MONGOCXX_PRIVATE mongocxx::v_noabi::collection _create_collection_deprecated( const client_session* session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern); + const stdx::optional& write_concern); MONGOCXX_PRIVATE cursor _list_collections(const client_session* session, - bsoncxx::document::view_or_value filter); + bsoncxx::v_noabi::document::view_or_value filter); MONGOCXX_PRIVATE std::vector _list_collection_names( - const client_session* session, bsoncxx::document::view_or_value filter); + const client_session* session, bsoncxx::v_noabi::document::view_or_value filter); MONGOCXX_PRIVATE void _drop( const client_session* session, - const bsoncxx::stdx::optional& write_concern); + const bsoncxx::v_noabi::stdx::optional& write_concern); MONGOCXX_PRIVATE change_stream _watch(const client_session* session, const pipeline& pipe, @@ -672,8 +681,8 @@ class database { std::unique_ptr _impl; }; -MONGOCXX_INLINE mongocxx::collection database::operator[]( - bsoncxx::string::view_or_value name) const { +MONGOCXX_INLINE mongocxx::v_noabi::collection database::operator[]( + bsoncxx::v_noabi::string::view_or_value name) const { return collection(name); } diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event-fwd.hpp index 89ff98ba11..07147546fc 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API command_failed_event; @@ -26,4 +26,12 @@ class MONGOCXX_API command_failed_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::command_failed_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event.hpp index a3f492d52a..e76670ac48 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_failed_event.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -48,14 +48,14 @@ class command_failed_event { /// /// @return The failure. /// - bsoncxx::document::view failure() const; + bsoncxx::v_noabi::document::view failure() const; /// /// Returns the name of the command. /// /// @return The command name. /// - bsoncxx::stdx::string_view command_name() const; + bsoncxx::v_noabi::stdx::string_view command_name() const; /// /// Returns the duration of the failed operation. @@ -83,14 +83,14 @@ class command_failed_event { /// /// @return No contained value, or contains the service id if load balancing is enabled. /// - bsoncxx::stdx::optional service_id() const; + bsoncxx::v_noabi::stdx::optional service_id() const; /// /// Returns the host name. /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event-fwd.hpp index e3560ab5bb..42d1b64c8c 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API command_started_event; @@ -26,4 +26,12 @@ class MONGOCXX_API command_started_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::command_started_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event.hpp index 205597687a..746f24d928 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_started_event.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -48,21 +48,21 @@ class command_started_event { /// /// @return The command. /// - bsoncxx::document::view command() const; + bsoncxx::v_noabi::document::view command() const; /// /// Returns the name of the database. /// /// @return The database name. /// - bsoncxx::stdx::string_view database_name() const; + bsoncxx::v_noabi::stdx::string_view database_name() const; /// /// Returns the name of the command. /// /// @return The command name. /// - bsoncxx::stdx::string_view command_name() const; + bsoncxx::v_noabi::stdx::string_view command_name() const; /// /// Returns the request id. @@ -83,14 +83,14 @@ class command_started_event { /// /// @return No contained value, or contains the service id if load balancing is enabled. /// - bsoncxx::stdx::optional service_id() const; + bsoncxx::v_noabi::stdx::optional service_id() const; /// /// Returns the host name. /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event-fwd.hpp index cecee1f21c..96b80f1cb9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API command_succeeded_event; @@ -26,4 +26,12 @@ class MONGOCXX_API command_succeeded_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::command_succeeded_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.hpp index 955d915b63..420da0dac2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -48,14 +48,14 @@ class command_succeeded_event { /// /// @return The reply. /// - bsoncxx::document::view reply() const; + bsoncxx::v_noabi::document::view reply() const; /// /// Returns the name of the command. /// /// @return The command name. /// - bsoncxx::stdx::string_view command_name() const; + bsoncxx::v_noabi::stdx::string_view command_name() const; /// /// Returns the duration of the successful operation. @@ -83,14 +83,14 @@ class command_succeeded_event { /// /// @return No contained value, or contains the service id if load balancing is enabled. /// - bsoncxx::stdx::optional service_id() const; + bsoncxx::v_noabi::stdx::optional service_id() const; /// /// Returns the host name. /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event-fwd.hpp index a6a9ff7ff3..bc3122df5b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API heartbeat_failed_event; @@ -26,4 +26,12 @@ class MONGOCXX_API heartbeat_failed_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::heartbeat_failed_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.hpp index 1ed8ddce91..2f993cc121 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.hpp @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -61,7 +61,7 @@ class heartbeat_failed_event { /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event-fwd.hpp index 017b551c2c..cc1d7371e0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API heartbeat_started_event; @@ -26,4 +26,12 @@ class MONGOCXX_API heartbeat_started_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::heartbeat_started_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.hpp index 9b13a182b8..82045ce16a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.hpp @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -47,7 +47,7 @@ class heartbeat_started_event { /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event-fwd.hpp index 5ab181df9c..4acda625e0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API heartbeat_succeeded_event; @@ -26,4 +26,12 @@ class MONGOCXX_API heartbeat_succeeded_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::heartbeat_succeeded_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.hpp index fea4c60b2f..210164d38e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.hpp @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -46,7 +46,7 @@ class heartbeat_succeeded_event { /// /// @return The reply. /// - bsoncxx::document::view reply() const; + bsoncxx::v_noabi::document::view reply() const; /// /// Returns the duration of the successful operation. @@ -60,7 +60,7 @@ class heartbeat_succeeded_event { /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event-fwd.hpp index 77b25ac0e6..9ef5937138 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API server_changed_event; @@ -26,4 +26,12 @@ class MONGOCXX_API server_changed_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::server_changed_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event.hpp index e9dcee5b2d..89b8f83ef6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_changed_event.hpp @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -47,7 +47,7 @@ class server_changed_event { /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the server port. @@ -57,11 +57,12 @@ class server_changed_event { std::uint16_t port() const; /// - /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this topology for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// - const bsoncxx::oid topology_id() const; + const bsoncxx::v_noabi::oid topology_id() const; /// /// The server's description before it changed. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event-fwd.hpp index 349dd91fcd..3e136b2244 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API server_closed_event; @@ -26,4 +26,12 @@ class MONGOCXX_API server_closed_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::server_closed_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event.hpp index e01056f1e5..12661a555a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_closed_event.hpp @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -48,7 +48,7 @@ class server_closed_event { /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the server port. @@ -58,11 +58,12 @@ class server_closed_event { std::uint16_t port() const; /// - /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this topology for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// - const bsoncxx::oid topology_id() const; + const bsoncxx::v_noabi::oid topology_id() const; private: const void* _event; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description-fwd.hpp index df9bde891f..6e59f86ba8 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API server_description; @@ -26,4 +26,12 @@ class MONGOCXX_API server_description; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::server_description; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description.hpp index fc4a206f06..cf39e4c3ab 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_description.hpp @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -38,7 +38,8 @@ class server_description { ~server_description(); /// - /// An opaque id, unique to this server for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this server for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// @@ -57,14 +58,14 @@ class server_description { /// /// @return The type as a short-lived string view. /// - bsoncxx::stdx::string_view type() const; + bsoncxx::v_noabi::stdx::string_view type() const; /// /// @return The response as a short-lived document view. /// /// @deprecated use hello instead. /// - MONGOCXX_DEPRECATED bsoncxx::document::view is_master() const; + MONGOCXX_DEPRECATED bsoncxx::v_noabi::document::view is_master() const; /// /// The server's last response to the "hello" command, or an empty document if the driver @@ -72,14 +73,14 @@ class server_description { /// /// @return The response as a short-lived document view. /// - bsoncxx::document::view hello() const; + bsoncxx::v_noabi::document::view hello() const; /// /// Returns the server host name. /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the server port. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event-fwd.hpp index 7440f339b7..c52b87e2bf 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API server_opening_event; @@ -26,4 +26,12 @@ class MONGOCXX_API server_opening_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::server_opening_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event.hpp index c7feea9a03..e086b52180 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/server_opening_event.hpp @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -47,7 +47,7 @@ class server_opening_event { /// /// @return The host name. /// - bsoncxx::stdx::string_view host() const; + bsoncxx::v_noabi::stdx::string_view host() const; /// /// Returns the server port. @@ -57,11 +57,12 @@ class server_opening_event { std::uint16_t port() const; /// - /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this topology for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// - const bsoncxx::oid topology_id() const; + const bsoncxx::v_noabi::oid topology_id() const; private: const void* _event; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event-fwd.hpp index 535e8b0d57..459ac3fbe2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API topology_changed_event; @@ -26,4 +26,12 @@ class MONGOCXX_API topology_changed_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::topology_changed_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event.hpp index 227e81201d..28501264a3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_changed_event.hpp @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -42,11 +42,12 @@ class topology_changed_event { ~topology_changed_event(); /// - /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this topology for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// - bsoncxx::oid topology_id() const; + bsoncxx::v_noabi::oid topology_id() const; /// /// The server's description before it changed. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event-fwd.hpp index 2dc84e6438..83103d86cb 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API topology_closed_event; @@ -26,4 +26,12 @@ class MONGOCXX_API topology_closed_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::topology_closed_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event.hpp index 73c6a8f658..c1fb3eb4b3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_closed_event.hpp @@ -21,7 +21,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -41,11 +41,12 @@ class topology_closed_event { ~topology_closed_event(); /// - /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this topology for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// - bsoncxx::oid topology_id() const; + bsoncxx::v_noabi::oid topology_id() const; private: const void* _event; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description-fwd.hpp index bfac18c7b6..02543e7863 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API topology_description; @@ -26,4 +26,12 @@ class MONGOCXX_API topology_description; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::topology_description; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp index 5504514a31..2f980d3373 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp @@ -25,10 +25,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { -using mongocxx::read_preference; +using mongocxx::v_noabi::read_preference; /// /// Class representing what the driver knows about a topology of MongoDB servers: either a @@ -125,7 +125,7 @@ class topology_description { /// /// @return The type as a short-lived string view. /// - bsoncxx::stdx::string_view type() const; + bsoncxx::v_noabi::stdx::string_view type() const; /// /// Determines if the topology has a readable server available. Servers are @@ -136,7 +136,7 @@ class topology_description { /// /// @return Whether there is a readable server available. /// - bool has_readable_server(const mongocxx::read_preference& pref) const; + bool has_readable_server(const mongocxx::v_noabi::read_preference& pref) const; /// /// Determines if the topology has a writable server available, such as a @@ -165,4 +165,12 @@ class topology_description { } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::read_preference; // Deprecated. + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event-fwd.hpp index 640268ca5c..c944795305 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { class MONGOCXX_API topology_opening_event; @@ -26,4 +26,12 @@ class MONGOCXX_API topology_opening_event; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace events { + +using ::mongocxx::v_noabi::events::topology_opening_event; + +} // namespace events +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event.hpp index 41d1872cc0..d4aa071e99 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_opening_event.hpp @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { /// @@ -41,11 +41,12 @@ class topology_opening_event { ~topology_opening_event(); /// - /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool. + /// An opaque id, unique to this topology for this mongocxx::v_noabi::client or + /// mongocxx::v_noabi::pool. /// /// @return The id. /// - bsoncxx::oid topology_id() const; + bsoncxx::v_noabi::oid topology_id() const; private: const void* _event; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception-fwd.hpp index abe30ac106..8525251bd5 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API authentication_exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API authentication_exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::authentication_exception; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception.hpp index b7692c67a4..7e8c7f8f3f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception.hpp @@ -22,11 +22,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an exception during authentication. /// -/// @see mongocxx::operation_exception +/// @see mongocxx::v_noabi::operation_exception /// class authentication_exception : public operation_exception { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception-fwd.hpp index 865654fd56..091aaf98dd 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API bulk_write_exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API bulk_write_exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::bulk_write_exception; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception.hpp index 531c79436d..6f9f6a3d89 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception.hpp @@ -22,11 +22,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an exception during a bulk write operation. /// -/// @see mongocxx::operation_exception +/// @see mongocxx::v_noabi::operation_exception /// class bulk_write_exception : public operation_exception { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code-fwd.hpp index 8f985ad659..f5015d4f47 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code-fwd.hpp @@ -18,12 +18,22 @@ #include namespace mongocxx { -inline namespace v_noabi { enum class error_code : std::int32_t; } // namespace v_noabi +namespace v_noabi { + +enum class error_code : std::int32_t; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::error_code; + } // namespace mongocxx namespace std { template <> -struct is_error_code_enum; +struct is_error_code_enum<::mongocxx::v_noabi::error_code>; } // namespace std diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code.hpp index c3f2e9e89c..133658260a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/error_code.hpp @@ -22,21 +22,22 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Enum representing the various error types that can occur during driver usage. /// enum class error_code : std::int32_t { - /// More than one mongocxx::instance has been created. + /// More than one mongocxx::v_noabi::instance has been created. k_cannot_recreate_instance = 1, - /// A default-constructed or moved-from mongocxx::client object has been used. + /// A default-constructed or moved-from mongocxx::v_noabi::client object has been used. k_invalid_client_object, - /// A default-constructed or moved-from mongocxx::collection object has been used. + /// A default-constructed or moved-from mongocxx::v_noabi::collection object has been used. k_invalid_collection_object, - /// A default-constructed or moved-from mongocxx::database object has been used. + /// A default-constructed or moved-from mongocxx::v_noabi::database object has been used. k_invalid_database_object, /// An invalid or out-of-bounds parameter was provided. @@ -57,20 +58,23 @@ enum class error_code : std::int32_t { /// An invalid MongoDB URI was provided. k_invalid_uri, - /// A default-constructed or moved-from mongocxx::gridfs::bucket object has been used. + /// A default-constructed or moved-from mongocxx::v_noabi::gridfs::bucket object has been used. k_invalid_gridfs_bucket_object, - /// A default-constructed or moved-from mongocxx::gridfs::uploader object has been used. + /// A default-constructed or moved-from mongocxx::v_noabi::gridfs::uploader object has been + /// used. k_invalid_gridfs_uploader_object, - /// A default-constructed or moved-from mongocxx::gridfs::downloader object has been used. + /// A default-constructed or moved-from mongocxx::v_noabi::gridfs::downloader object has been + /// used. k_invalid_gridfs_downloader_object, - /// A mongocxx::gridfs::uploader object was not open for writing, or a - /// mongocxx::gridfs::downloader object was not open for reading. + /// A mongocxx::v_noabi::gridfs::uploader object was not open for writing, or a + /// mongocxx::v_noabi::gridfs::downloader object was not open for reading. k_gridfs_stream_not_open, - /// A mongocxx::gridfs::uploader object has exceeded the maximum number of allowable GridFS + /// A mongocxx::v_noabi::gridfs::uploader object has exceeded the maximum number of allowable + /// GridFS /// chunks when attempting to upload the requested file. k_gridfs_upload_requires_too_many_chunks, @@ -80,25 +84,28 @@ enum class error_code : std::int32_t { /// A GridFS file being operated on was discovered to be corrupted. k_gridfs_file_corrupted, - /// The mongocxx::instance has been destroyed. + /// The mongocxx::v_noabi::instance has been destroyed. k_instance_destroyed, - /// mongocxx::client.create_session failed to create a mongocxx::client_session. + /// mongocxx::v_noabi::client.create_session failed to create a + /// mongocxx::v_noabi::client_session. k_cannot_create_session, - /// A failure attempting to pass a mongocxx::client_session to a method. + /// A failure attempting to pass a mongocxx::v_noabi::client_session to a method. k_invalid_session, - /// A moved-from mongocxx::options::transaction object has been used. + /// A moved-from mongocxx::v_noabi::options::transaction object has been used. k_invalid_transaction_options_object, // A resource (server API handle, etc.) could not be created: k_create_resource_fail, - // A default-constructed or moved-from mongocxx::search_index_model object has been used. + // A default-constructed or moved-from mongocxx::v_noabi::search_index_model object has been + // used. k_invalid_search_index_model, - // A default-constructed or moved-from mongocxx::search_index_view object has been used. + // A default-constructed or moved-from mongocxx::v_noabi::search_index_view object has been + // used. k_invalid_search_index_view, // Add new constant string message to error_code.cpp as well! @@ -112,9 +119,9 @@ enum class error_code : std::int32_t { MONGOCXX_API const std::error_category& MONGOCXX_CALL error_category(); /// -/// Translate a mongocxx::error_code into a std::error_code. +/// Translate a mongocxx::v_noabi::error_code into a std::error_code. /// -/// @param error A mongocxx::error_code +/// @param error A mongocxx::v_noabi::error_code /// /// @return A std::error_code /// @@ -125,10 +132,19 @@ MONGOCXX_INLINE std::error_code make_error_code(error_code error) { } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { + +using ::mongocxx::v_noabi::error_category; +using ::mongocxx::v_noabi::make_error_code; + +} // namespace mongocxx + #include namespace std { + // Specialize is_error_code_enum so we get simpler std::error_code construction template <> -struct is_error_code_enum : public true_type {}; +struct is_error_code_enum<::mongocxx::v_noabi::error_code> : std::true_type {}; + } // namespace std diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception-fwd.hpp index 7536897ce8..1f0f0c696d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::exception; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception.hpp index 189bafe7fe..a499756d6a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/exception.hpp @@ -22,7 +22,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// A class to be used as the base class for all mongocxx exceptions. /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception-fwd.hpp index 3b8b2c69e9..fee943867f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API gridfs_exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API gridfs_exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::gridfs_exception; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception.hpp index af32688344..54d9d30f88 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/gridfs_exception.hpp @@ -21,12 +21,13 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an error encountered when attempting to perform the requested GridFS /// operation. /// -/// @see mongocxx::exception +/// @see mongocxx::v_noabi::exception /// class gridfs_exception : public exception { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error-fwd.hpp index c5b098ade5..f593039f18 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API logic_error; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API logic_error; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::logic_error; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error.hpp index 99605a2d6d..8b2c77edbc 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/logic_error.hpp @@ -21,11 +21,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an exception caused by using the mongocxx API improperly. /// -/// @see mongocxx::exception +/// @see mongocxx::v_noabi::exception /// class logic_error : public exception { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception-fwd.hpp index 7a34118476..c800aa66aa 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API operation_exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API operation_exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::operation_exception; + } // namespace mongocxx #include 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 6877c3f451..35f5a9e478 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 @@ -24,12 +24,13 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an exception received from a MongoDB server. It includes the server-provided /// error code, if one was available. /// -/// @see mongocxx::exception +/// @see mongocxx::v_noabi::exception /// class operation_exception : public exception { public: @@ -46,7 +47,7 @@ class operation_exception : public exception { /// An optional message to be returned by `what`. /// operation_exception(std::error_code ec, - bsoncxx::document::value&& raw_server_error, + bsoncxx::v_noabi::document::value&& raw_server_error, std::string what_arg = ""); /// @@ -56,8 +57,8 @@ 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 stdx::optional& raw_server_error() const; + stdx::optional& raw_server_error(); /// /// @} /// @@ -73,7 +74,7 @@ class operation_exception : public exception { bool has_error_label(stdx::string_view label) const; private: - stdx::optional _raw_server_error; + stdx::optional _raw_server_error; }; } // namespace v_noabi diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception-fwd.hpp index f36cfb983a..1714b72f09 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API query_exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API query_exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::query_exception; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception.hpp index ef85186c16..2a43491243 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/query_exception.hpp @@ -21,11 +21,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an exception during a query operation. /// -/// @see mongocxx::operation_exception +/// @see mongocxx::v_noabi::operation_exception /// class query_exception : public operation_exception { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code-fwd.hpp index 278b3d30f0..d2e9053d44 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code-fwd.hpp @@ -18,12 +18,22 @@ #include namespace mongocxx { -inline namespace v_noabi { enum class server_error_code : std::int32_t; } // namespace v_noabi +namespace v_noabi { + +enum class server_error_code : std::int32_t; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::server_error_code; + } // namespace mongocxx namespace std { template <> -struct is_error_code_enum; +struct is_error_code_enum<::mongocxx::v_noabi::server_error_code>; } // namespace std diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code.hpp index ba76d632e7..ab28805d16 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/server_error_code.hpp @@ -22,7 +22,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Enum representing the various errors types that can be returned from the server. As this list /// changes over time, this is just a placeholder for an Int32 error code value from the server. @@ -39,9 +40,9 @@ enum class server_error_code : std::int32_t { MONGOCXX_API const std::error_category& MONGOCXX_CALL server_error_category(); /// -/// Translate a mongocxx::server_error_code into a std::error_code. +/// Translate a mongocxx::v_noabi::server_error_code into a std::error_code. /// -/// @param error A mongocxx::error_code +/// @param error A mongocxx::v_noabi::error_code /// /// @return A std::error_code /// @@ -52,10 +53,19 @@ MONGOCXX_INLINE std::error_code make_error_code(server_error_code error) { } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { + +using ::mongocxx::v_noabi::make_error_code; +using ::mongocxx::v_noabi::server_error_category; + +} // namespace mongocxx + #include namespace std { + // Specialize is_error_code_enum so we get simpler std::error_code construction template <> -struct is_error_code_enum : public true_type {}; +struct is_error_code_enum<::mongocxx::v_noabi::server_error_code> : std::true_type {}; + } // namespace std diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception-fwd.hpp index 05c6baf5d9..bdd435757e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API write_exception; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API write_exception; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::write_exception; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception.hpp index c3f3ffe390..485aba3d70 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/write_exception.hpp @@ -21,11 +21,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an exception during a write operation. /// -/// @see mongocxx::operation_exception +/// @see mongocxx::v_noabi::operation_exception /// class write_exception : public operation_exception { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket-fwd.hpp index 84c48fe059..66ca8616da 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { class MONGOCXX_API bucket; @@ -26,4 +26,12 @@ class MONGOCXX_API bucket; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace gridfs { + +using ::mongocxx::v_noabi::gridfs::bucket; + +} // namespace gridfs +} // namespace mongocxx + #include 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 9c82092ffb..0e965d3cd1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp @@ -37,7 +37,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { /// @@ -52,11 +52,11 @@ namespace gridfs { /// /// Example of how obtain the default GridFS bucket for a given database: /// @code -/// mongocxx::client mongo_client{mongocxx::uri{}}; +/// mongocxx::v_noabi::client mongo_client{mongocxx::v_noabi::uri{}}; /// auto gridfs_bucket = mongo_client["database"].gridfs_bucket(); /// @endcode /// -/// See also the method documentation for `mongocxx::database::gridfs_bucket()`. +/// See also the method documentation for `mongocxx::v_noabi::database::gridfs_bucket()`. /// /// @see https://www.mongodb.com/display/DOCS/GridFS /// @@ -119,12 +119,13 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// uploader open_upload_stream(stdx::string_view filename, const options::gridfs::upload& options = {}); @@ -134,8 +135,8 @@ class bucket { /// automatically generated as an ObjectId. /// /// @param session - /// The mongocxx::client_session with which to perform the upload. The client session must - /// remain valid for the lifetime of the uploader. + /// The mongocxx::v_noabi::client_session with which to perform the upload. The client session + /// must remain valid for the lifetime of the uploader. /// /// @param filename /// The name of the file to be uploaded. A bucket can contain multiple files with the same @@ -151,12 +152,13 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// uploader open_upload_stream(const client_session& session, stdx::string_view filename, @@ -187,14 +189,15 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// - uploader open_upload_stream_with_id(bsoncxx::types::bson_value::view id, + uploader open_upload_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload& options = {}); @@ -202,8 +205,8 @@ class bucket { /// Opens a gridfs::uploader to create a new GridFS file. /// /// @param session - /// The mongocxx::client_session with which to perform the upload. The client session must - /// remain valid for the lifetime of the uploader. + /// The mongocxx::v_noabi::client_session with which to perform the upload. The client session + /// must remain valid for the lifetime of the uploader. /// /// @param id /// The unique id of the file being uploaded. @@ -222,15 +225,16 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// uploader open_upload_stream_with_id(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload& options = {}); /// @@ -261,23 +265,24 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when writing chunk data or file metadata to the database. /// /// @throws std::ios_base::failure /// if reading from `source` fails. Any exception thrown during the execution of /// `source::read()` will be re-thrown. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk /// size. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// result::gridfs::upload upload_from_stream(stdx::string_view filename, std::istream* source, @@ -288,7 +293,7 @@ class bucket { /// be automatically generated as an ObjectId. /// /// @param session - /// The mongocxx::client_session with which to perform the upload. + /// The mongocxx::v_noabi::client_session with which to perform the upload. /// /// @param filename /// The name of the file to be uploaded. A bucket can contain multiple files with the same @@ -308,23 +313,24 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when writing chunk data or file metadata to the database. /// /// @throws std::ios_base::failure /// if reading from `source` fails. Any exception thrown during the execution of /// `source::read()` will be re-thrown. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk /// size. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// result::gridfs::upload upload_from_stream(const client_session& session, stdx::string_view filename, @@ -358,25 +364,26 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when writing chunk data or file metadata to the database. /// /// @throws std::ios_base::failure /// if reading from `source` fails. Any exception thrown during the execution of /// `source::read()` will be re-thrown. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk /// size. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// - void upload_from_stream_with_id(bsoncxx::types::bson_value::view id, + void upload_from_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); @@ -386,7 +393,7 @@ class bucket { /// stream. /// /// @param session - /// The mongocxx::client_session with which to perform the upload. + /// The mongocxx::v_noabi::client_session with which to perform the upload. /// /// @param id /// A unique id for the file being uploaded. @@ -406,26 +413,27 @@ class bucket { /// If this GridFS bucket does not already exist in the database, it will be implicitly /// created and initialized with GridFS indexes. /// - /// @throws mongocxx::logic_error if `options` are invalid. + /// @throws mongocxx::v_noabi::logic_error if `options` are invalid. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when writing chunk data or file metadata to the database. /// /// @throws std::ios_base::failure /// if reading from `source` fails. Any exception thrown during the execution of /// `source::read()` will be re-thrown. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk /// size. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - /// @throws mongocxx::operation_exception if an error occurs when building GridFS indexes. + /// @throws mongocxx::v_noabi::operation_exception if an error occurs when building GridFS + /// indexes. /// void upload_from_stream_with_id(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); @@ -444,20 +452,20 @@ class bucket { /// @return /// The gridfs::downloader from which the GridFS file should be read. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the requested file does not exist, or if the requested file has been corrupted. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// - downloader open_download_stream(bsoncxx::types::bson_value::view id); + downloader open_download_stream(bsoncxx::v_noabi::types::bson_value::view id); /// /// Opens a gridfs::downloader to read a GridFS file. /// /// @param session - /// The mongocxx::client_session with which to perform the download. The client session must - /// remain valid for the lifetime of the downloader. + /// The mongocxx::v_noabi::client_session with which to perform the download. The client + /// session must remain valid for the lifetime of the downloader. /// /// @param id /// The id of the file to read. @@ -465,14 +473,14 @@ class bucket { /// @return /// The gridfs::downloader from which the GridFS file should be read. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the requested file does not exist, or if the requested file has been corrupted. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files collection for this bucket. /// downloader open_download_stream(const client_session& session, - bsoncxx::types::bson_value::view id); + bsoncxx::v_noabi::types::bson_value::view id); /// /// @} /// @@ -488,10 +496,10 @@ class bucket { /// @param destination /// The non-null stream to which the GridFS file should be written. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the requested file does not exist, or if the requested file has been corrupted. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files or chunks collections for this bucket. /// /// @throws std::ios_base::failure @@ -499,15 +507,17 @@ class bucket { /// `badbit`, any exception thrown during execution of `destination::write()` will be /// re-thrown. /// - void download_to_stream(bsoncxx::types::bson_value::view id, std::ostream* destination); + void download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, + std::ostream* destination); /// - /// @copydoc download_to_stream(bsoncxx::types::bson_value::view id, std::ostream* destination) + /// @copydoc download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, std::ostream* + /// destination) /// /// @param start The byte offset to the beginning of content to download. /// @param end The byte offset to the end of content to download. /// - void download_to_stream(bsoncxx::types::bson_value::view id, + void download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, std::size_t start, std::size_t end); @@ -516,7 +526,7 @@ class bucket { /// Downloads the contents of a stored GridFS file from the bucket and writes it to a stream. /// /// @param session - /// The mongocxx::client_session with which to perform the download. + /// The mongocxx::v_noabi::client_session with which to perform the download. /// /// @param id /// The id of the file to read. @@ -524,10 +534,10 @@ class bucket { /// @param destination /// The non-null stream to which the GridFS file should be written. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the requested file does not exist, or if the requested file has been corrupted. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading from the files or chunks collections for this bucket. /// /// @throws std::ios_base::failure @@ -536,19 +546,19 @@ class bucket { /// re-thrown. /// void download_to_stream(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination); // clang-format off /// - /// @copydoc download_to_stream(const client_session& session, bsoncxx::types::bson_value::view id, std::ostream* destination) + /// @copydoc download_to_stream(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination) /// /// @param start The byte offset to the beginning of content to download. /// @param end The byte offset to the end of content to download. /// // clang-format on void download_to_stream(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, std::size_t start, std::size_t end); @@ -564,28 +574,28 @@ class bucket { /// @param id /// The id of the file to be deleted. /// - /// @throws mongocxx::gridfs_exception if the requested file does not exist. + /// @throws mongocxx::v_noabi::gridfs_exception if the requested file does not exist. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when removing file data or chunk data from the database. /// - void delete_file(bsoncxx::types::bson_value::view id); + void delete_file(bsoncxx::v_noabi::types::bson_value::view id); /// /// Deletes a GridFS file from the bucket. /// /// @param session - /// The mongocxx::client_session with which to perform the delete. + /// The mongocxx::v_noabi::client_session with which to perform the delete. /// /// @param id /// The id of the file to be deleted. /// - /// @throws mongocxx::gridfs_exception if the requested file does not exist. + /// @throws mongocxx::v_noabi::gridfs_exception if the requested file does not exist. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when removing file data or chunk data from the database. /// - void delete_file(const client_session& session, bsoncxx::types::bson_value::view id); + void delete_file(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id); /// /// @} /// @@ -602,22 +612,23 @@ class bucket { /// Optional arguments; see options::find. /// /// @return - /// A mongocxx::cursor with the results. If the query fails, the cursor throws - /// mongocxx::query_exception when the returned cursor is iterated. + /// A mongocxx::v_noabi::cursor with the results. If the query fails, the cursor throws + /// mongocxx::v_noabi::query_exception when the returned cursor is iterated. /// - /// @throws mongocxx::logic_error if the options are invalid, or if the unsupported option - /// modifiers "$query" or "$explain" are used. + /// @throws mongocxx::v_noabi::logic_error if the options are invalid, or if the unsupported + /// option modifiers "$query" or "$explain" are used. /// - /// @see mongocxx::collection::find. + /// @see mongocxx::v_noabi::collection::find. /// - cursor find(bsoncxx::document::view_or_value filter, const options::find& options = {}); + cursor find(bsoncxx::v_noabi::document::view_or_value filter, + const options::find& options = {}); /// /// Finds the documents in the files collection of the bucket which match the provided filter. /// /// @param session - /// The mongocxx::client_session with which to perform the query. The client session must - /// remain valid for the lifetime of the cursor. + /// The mongocxx::v_noabi::client_session with which to perform the query. The client session + /// must remain valid for the lifetime of the cursor. /// /// @param filter /// Document view representing a document that should match the query. @@ -626,16 +637,16 @@ class bucket { /// Optional arguments; see options::find. /// /// @return - /// A mongocxx::cursor with the results. If the query fails, the cursor throws - /// mongocxx::query_exception when the returned cursor is iterated. + /// A mongocxx::v_noabi::cursor with the results. If the query fails, the cursor throws + /// mongocxx::v_noabi::query_exception when the returned cursor is iterated. /// - /// @throws mongocxx::logic_error if the options are invalid, or if the unsupported option - /// modifiers "$query" or "$explain" are used. + /// @throws mongocxx::v_noabi::logic_error if the options are invalid, or if the unsupported + /// option modifiers "$query" or "$explain" are used. /// - /// @see mongocxx::collection::find. + /// @see mongocxx::v_noabi::collection::find. /// cursor find(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = {}); /// /// @} @@ -657,30 +668,31 @@ class bucket { MONGOCXX_PRIVATE void create_indexes_if_nonexistent(const client_session* session); - MONGOCXX_PRIVATE uploader _open_upload_stream_with_id(const client_session* session, - bsoncxx::types::bson_value::view id, - stdx::string_view filename, - const options::gridfs::upload& options); + MONGOCXX_PRIVATE uploader + _open_upload_stream_with_id(const client_session* session, + bsoncxx::v_noabi::types::bson_value::view id, + stdx::string_view filename, + const options::gridfs::upload& options); MONGOCXX_PRIVATE void _upload_from_stream_with_id(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options); MONGOCXX_PRIVATE downloader _open_download_stream(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::optional start, stdx::optional end); MONGOCXX_PRIVATE void _download_to_stream(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, stdx::optional start, stdx::optional end); MONGOCXX_PRIVATE void _delete_file(const client_session* session, - bsoncxx::types::bson_value::view id); + bsoncxx::v_noabi::types::bson_value::view id); class MONGOCXX_PRIVATE impl; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader-fwd.hpp index 42af4408ce..f7d7fc87df 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { struct chunks_and_bytes_offset; @@ -28,4 +28,14 @@ class MONGOCXX_API downloader; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace gridfs { + +using ::mongocxx::v_noabi::gridfs::chunks_and_bytes_offset; + +using ::mongocxx::v_noabi::gridfs::downloader; + +} // namespace gridfs +} // namespace mongocxx + #include 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 5945cb876e..d6de941d1a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp @@ -31,7 +31,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { /// @@ -92,11 +92,11 @@ class downloader { /// The number of bytes actually read. If zero, the downloader has reached the end of the /// file. /// - /// @throws mongocxx::logic_error if the download stream was already closed. + /// @throws mongocxx::v_noabi::logic_error if the download stream was already closed. /// - /// @throws mongocxx::gridfs_exception if the requested file has been corrupted. + /// @throws mongocxx::v_noabi::gridfs_exception if the requested file has been corrupted. /// - /// @throws mongocxx::query_exception + /// @throws mongocxx::v_noabi::query_exception /// if an error occurs when reading chunk data from the database for the requested file. /// std::size_t read(std::uint8_t* buffer, std::size_t length); @@ -104,7 +104,7 @@ class downloader { /// /// Closes the downloader stream. /// - /// @throws mongocxx::logic_error if the download stream was already closed. + /// @throws mongocxx::v_noabi::logic_error if the download stream was already closed. /// void close(); @@ -130,7 +130,7 @@ class downloader { /// @return /// A view to the files collection document of the file being downloaded. /// - bsoncxx::document::view files_document() const; + bsoncxx::v_noabi::document::view files_document() const; private: friend ::mongocxx::v_noabi::gridfs::bucket; @@ -158,7 +158,7 @@ class downloader { chunks_and_bytes_offset start, std::int32_t chunk_size, std::int64_t file_len, - bsoncxx::document::value files_doc); + bsoncxx::v_noabi::document::value files_doc); MONGOCXX_PRIVATE void fetch_chunk(); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader-fwd.hpp index 21fdf6ec35..34c87965ec 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { class MONGOCXX_API uploader; @@ -26,4 +26,12 @@ class MONGOCXX_API uploader; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace gridfs { + +using ::mongocxx::v_noabi::gridfs::uploader; + +} // namespace gridfs +} // namespace mongocxx + #include 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 eae0fc4956..6e5797597a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp @@ -34,7 +34,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { /// @@ -82,12 +82,12 @@ class uploader { /// @param length /// The number of bytes to write. /// - /// @throws mongocxx::logic_error if the upload stream was already closed. + /// @throws mongocxx::v_noabi::logic_error if the upload stream was already closed. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when writing chunk data to the database. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk /// size. /// @@ -96,12 +96,12 @@ class uploader { /// /// Closes the uploader stream. /// - /// @throws mongocxx::logic_error if the upload stream was already closed. + /// @throws mongocxx::v_noabi::logic_error if the upload stream was already closed. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when writing chunk data or file metadata to the database. /// - /// @throws mongocxx::gridfs_exception + /// @throws mongocxx::v_noabi::gridfs_exception /// if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk /// size. /// @@ -110,9 +110,9 @@ class uploader { /// /// Aborts uploading the file. /// - /// @throws mongocxx::logic_error if the upload stream was already closed. + /// @throws mongocxx::v_noabi::logic_error if the upload stream was already closed. /// - /// @throws mongocxx::bulk_write_exception + /// @throws mongocxx::v_noabi::bulk_write_exception /// if an error occurs when removing chunk data from the database. /// void abort(); @@ -149,13 +149,14 @@ class uploader { // @param metadata // Optional metadata field of the files collection document. // - MONGOCXX_PRIVATE uploader(const client_session* session, - bsoncxx::types::bson_value::view id, - stdx::string_view filename, - collection files, - collection chunks, - std::int32_t chunk_size, - stdx::optional metadata = {}); + MONGOCXX_PRIVATE 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 = {}); MONGOCXX_PRIVATE void finish_chunk(); MONGOCXX_PRIVATE void flush_chunks(); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint-fwd.hpp index f3e501adf6..c21a38fbc8 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API hint; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API hint; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::hint; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp index b4c29202be..a8eed5e69f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp @@ -26,7 +26,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a hint to be passed to a database operation. /// @@ -41,7 +42,7 @@ class hint { /// @param index /// Document view or value representing the index to be used. /// - hint(bsoncxx::document::view_or_value index); + hint(bsoncxx::v_noabi::document::view_or_value index); /// /// Constructs a new hint. @@ -49,7 +50,7 @@ class hint { /// @param index /// String representing the name of the index to be used. /// - explicit hint(bsoncxx::string::view_or_value index); + explicit hint(bsoncxx::v_noabi::string::view_or_value index); /// /// @{ @@ -61,7 +62,7 @@ class hint { friend MONGOCXX_API bool MONGOCXX_CALL operator==(const hint& index_hint, std::string index); friend MONGOCXX_API bool MONGOCXX_CALL operator==(const hint& index_hint, - bsoncxx::document::view index); + bsoncxx::v_noabi::document::view index); /// /// @} /// @@ -73,7 +74,7 @@ class hint { /// not outlive /// the hint object that it was created from. /// - bsoncxx::types::bson_value::view to_value() const; + bsoncxx::v_noabi::types::bson_value::view to_value() const; /// /// Returns a types::bson_value::view representing this hint. @@ -82,11 +83,11 @@ class hint { /// not outlive /// the hint object that it was created from. /// - MONGOCXX_INLINE operator bsoncxx::types::bson_value::view() const; + MONGOCXX_INLINE operator bsoncxx::v_noabi::types::bson_value::view() const; private: - stdx::optional _index_doc; - stdx::optional _index_string; + stdx::optional _index_doc; + stdx::optional _index_string; }; /// @@ -120,7 +121,8 @@ MONGOCXX_API bool MONGOCXX_CALL operator!=(std::string index, const hint& index_ /// /// @relates hint /// -MONGOCXX_API bool MONGOCXX_CALL operator==(bsoncxx::document::view index, const hint& index_hint); +MONGOCXX_API bool MONGOCXX_CALL operator==(bsoncxx::v_noabi::document::view index, + const hint& index_hint); /// /// @{ @@ -132,17 +134,26 @@ MONGOCXX_API bool MONGOCXX_CALL operator==(bsoncxx::document::view index, const /// /// @relates hint /// -MONGOCXX_API bool MONGOCXX_CALL operator!=(const hint& index_hint, bsoncxx::document::view index); -MONGOCXX_API bool MONGOCXX_CALL operator!=(bsoncxx::document::view index, const hint& index_hint); +MONGOCXX_API bool MONGOCXX_CALL operator!=(const hint& index_hint, + bsoncxx::v_noabi::document::view index); +MONGOCXX_API bool MONGOCXX_CALL operator!=(bsoncxx::v_noabi::document::view index, + const hint& index_hint); /// /// @} /// -MONGOCXX_INLINE hint::operator bsoncxx::types::bson_value::view() const { +MONGOCXX_INLINE hint::operator bsoncxx::v_noabi::types::bson_value::view() const { return to_value(); } } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { + +using ::mongocxx::v_noabi::operator==; +using ::mongocxx::v_noabi::operator!=; + +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model-fwd.hpp index f98e644e02..9d7ea5436e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API index_model; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API index_model; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::index_model; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model.hpp index 380d9cd5c3..e8a6f43801 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_model.hpp @@ -23,17 +23,18 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an index on a MongoDB server. /// class index_model { public: /// - /// Initializes a new index_model over a mongocxx::collection. + /// Initializes a new index_model over a mongocxx::v_noabi::collection. /// - index_model(const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& options = {}); + index_model(const bsoncxx::v_noabi::document::view_or_value& keys, + const bsoncxx::v_noabi::document::view_or_value& options = {}); index_model() = delete; @@ -62,16 +63,16 @@ class index_model { /// /// Retrieves keys of an index_model. /// - bsoncxx::document::view keys() const; + bsoncxx::v_noabi::document::view keys() const; /// /// Retrieves options of an index_model. /// - bsoncxx::document::view options() const; + bsoncxx::v_noabi::document::view options() const; private: - bsoncxx::document::value _keys; - bsoncxx::document::value _options; + bsoncxx::v_noabi::document::value _keys; + bsoncxx::v_noabi::document::value _options; }; } // namespace v_noabi diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view-fwd.hpp index 2b56953115..36743621a2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API index_view; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API index_view; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::index_view; + } // namespace mongocxx #include 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 eb21c9361a..0d32ed90a1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp @@ -30,7 +30,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a MongoDB index view. /// @@ -52,7 +53,7 @@ class index_view { /// Returns a cursor over all the indexes. /// /// @param session - /// The mongocxx::client_session with which to perform the list operation. + /// The mongocxx::v_noabi::client_session with which to perform the list operation. /// cursor list(const client_session& session); @@ -71,7 +72,7 @@ class index_view { /// A document containing set of options that controls the creation of the index. See /// https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @return /// An optional containing the name of the created index. If and index with the same keys @@ -84,22 +85,22 @@ class index_view { /// @see https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/ /// stdx::optional create_one( - const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options = {}, + 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{}); /// /// Creates an index. A convenience method that calls create_many. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param keys /// A document containing the index keys and their corresponding index types. /// @param index_options /// A document containing set of options that controls the creation of the index. See /// https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @return /// An optional containing the name of the created index. If and index with the same keys @@ -113,8 +114,8 @@ class index_view { /// stdx::optional create_one( const client_session& session, - const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options = {}, + 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{}); /// @@ -129,7 +130,7 @@ class index_view { /// @param index /// Index_model describing the index being created. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @return /// An optional containing the name of the created index. If and index with the same keys @@ -148,11 +149,11 @@ class index_view { /// Creates an index. A convenience method that calls create_many. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param index /// Index_model describing the index being created. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @return /// An optional containing the name of the created index. If and index with the same keys @@ -181,7 +182,7 @@ class index_view { /// @param indexes /// std::vector containing index models describing the indexes being created. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @return /// The result document sent back by the server as if the createIndexes command was run from @@ -193,7 +194,7 @@ class index_view { /// /// @see https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// - bsoncxx::document::value create_many( + bsoncxx::v_noabi::document::value create_many( const std::vector& indexes, const options::index_view& options = options::index_view{}); @@ -201,11 +202,11 @@ class index_view { /// Adds a container of indexes to the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param indexes /// std::vector containing index models describing the indexes being created. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @return /// The result document sent back by the server as if the createIndexes command was run from @@ -217,7 +218,7 @@ class index_view { /// /// @see https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// - bsoncxx::document::value create_many( + bsoncxx::v_noabi::document::value create_many( const client_session& session, const std::vector& indexes, const options::index_view& options = options::index_view{}); @@ -234,7 +235,7 @@ class index_view { /// @param name /// The name of the index being dropped. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms @@ -251,11 +252,11 @@ class index_view { /// Drops a single index by name. /// /// @param session - /// The mongocxx::client_session with which to perform the drop. + /// The mongocxx::v_noabi::client_session with which to perform the drop. /// @param name /// The name of the index being dropped. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms @@ -285,10 +286,11 @@ class index_view { /// A document containing set of options used to create the index. Only the name field will /// be used from here, and if it is not included, a name based on they keys will be used. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception - /// Throws bsoncxx::exception if "name" key is present in options but is not a string. + /// Throws bsoncxx::v_noabi::exception if "name" key is present in options but is not a + /// string. /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms /// option is present and the operation exceeds the time limit. @@ -297,15 +299,15 @@ class index_view { /// /// @see https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// - void drop_one(const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options = {}, + void drop_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{}); /// /// Attempts to drop a single index from the collection given the keys and options. /// /// @param session - /// The mongocxx::client_session with which to perform the drop. + /// The mongocxx::v_noabi::client_session with which to perform the drop. /// @param keys /// A document containing the index keys and their corresponding index types. If no name /// option is present in the options, a name based on the keys will be used. @@ -313,10 +315,11 @@ class index_view { /// A document containing set of options used to create the index. Only the name field will /// be used from here, and if it is not included, a name based on they keys will be used. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception - /// Throws bsoncxx::exception if "name" key is present in options but is not a string. + /// Throws bsoncxx::v_noabi::exception if "name" key is present in options but is not a + /// string. /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms /// option is present and the operation exceeds the time limit. @@ -326,8 +329,8 @@ class index_view { /// @see https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/ /// void drop_one(const client_session& session, - const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options = {}, + 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{}); /// @@ -342,10 +345,11 @@ class index_view { /// @param index /// An index model describing the index being dropped. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception - /// Throws bsoncxx::exception if "name" key is present in options but is not a string. + /// Throws bsoncxx::v_noabi::exception if "name" key is present in options but is not a + /// string. /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms /// option is present and the operation exceeds the time limit. @@ -361,14 +365,15 @@ class index_view { /// Attempts to drop a single index from the collection given an index model. /// /// @param session - /// The mongocxx::client_session with which to perform the drop. + /// The mongocxx::v_noabi::client_session with which to perform the drop. /// @param index /// An index model describing the index being dropped. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception - /// Throws bsoncxx::exception if "name" key is present in options but is not a string. + /// Throws bsoncxx::v_noabi::exception if "name" key is present in options but is not a + /// string. /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms /// option is present and the operation exceeds the time limit. @@ -391,7 +396,7 @@ class index_view { /// Drops all indexes in the collection. /// /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms @@ -405,9 +410,9 @@ class index_view { /// Drops all indexes in the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the drop. + /// The mongocxx::v_noabi::client_session with which to perform the drop. /// @param options - /// Optional arguments for the overall operation, see mongocxx::options::index_view. + /// Optional arguments for the overall operation, see mongocxx::v_noabi::options::index_view. /// /// @exception /// Throws operation_exception for any errors encountered by the server or if max_time_ms diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance-fwd.hpp index 776c5055b8..45a1dd776d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API instance; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API instance; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::instance; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance.hpp index 678241c1bd..d2ab8afcd6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/instance.hpp @@ -22,7 +22,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing an instance of the MongoDB driver. /// @@ -44,8 +45,8 @@ inline namespace v_noabi { /// #include /// /// int main() { -/// mongocxx::instance inst{}; -/// mongocxx::client conn{mongocxx::uri{}}; +/// mongocxx::v_noabi::instance inst{}; +/// mongocxx::v_noabi::client conn{mongocxx::v_noabi::uri{}}; /// ... /// } /// @@ -60,14 +61,14 @@ inline namespace v_noabi { /// #include /// /// client get_client() { -/// mongocxx::instance inst{}; -/// mongocxx::client conn{mongocxx::uri{}}; +/// mongocxx::v_noabi::instance inst{}; +/// mongocxx::v_noabi::client conn{mongocxx::v_noabi::uri{}}; /// /// return client; /// } // ERROR! The instance is no longer alive after this function returns. /// /// int main() { -/// mongocxx::client conn = get_client(); +/// mongocxx::v_noabi::client conn = get_client(); /// ... /// } /// @@ -87,7 +88,7 @@ class instance { /// Creates an instance of the driver with a user provided log handler. /// @param logger The logger that the driver will direct log messages to. /// - /// @throws mongocxx::logic_error if an instance already exists. + /// @throws mongocxx::v_noabi::logic_error if an instance already exists. /// instance(std::unique_ptr logger); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger-fwd.hpp index 50b3370c37..96ab9546ad 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger-fwd.hpp @@ -17,7 +17,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + enum class log_level; class MONGOCXX_API logger; @@ -25,4 +26,12 @@ class MONGOCXX_API logger; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { + +using ::mongocxx::v_noabi::log_level; + +using ::mongocxx::v_noabi::logger; + +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp index 7632c9ac96..76ed853c68 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/logger.hpp @@ -24,9 +24,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// -/// The log level of a message passed to a mongocxx::logger. +/// The log level of a message passed to a mongocxx::v_noabi::logger. /// enum class log_level { k_error, @@ -79,4 +80,10 @@ class logger { } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { + +using ::mongocxx::v_noabi::to_string; + +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many-fwd.hpp index a6e5f5f078..e11f60b6f2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_many-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API delete_many; @@ -26,4 +26,12 @@ class MONGOCXX_API delete_many; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::delete_many; + +} // namespace model +} // namespace mongocxx + #include 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 f87f431959..04204ddc0e 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// @@ -38,14 +38,14 @@ class delete_many { /// @param filter /// Document representing the criteria for deletion. /// - explicit delete_many(bsoncxx::document::view_or_value filter); + explicit delete_many(bsoncxx::v_noabi::document::view_or_value filter); /// /// Gets the filter for this delete operation. /// /// @return The filter to be used for the delete operation. /// - const bsoncxx::document::view_or_value& filter() const; + const bsoncxx::v_noabi::document::view_or_value& filter() const; /// /// Sets the collation for this delete operation. @@ -60,7 +60,7 @@ class delete_many { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - delete_many& collation(bsoncxx::document::view_or_value collation); + delete_many& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Gets the collation option for this delete operation. @@ -71,7 +71,7 @@ class delete_many { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// Sets the index to use for this operation. /// @@ -85,20 +85,20 @@ class delete_many { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - delete_many& hint(mongocxx::hint index_hint); + delete_many& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; private: - bsoncxx::document::view_or_value _filter; + bsoncxx::v_noabi::document::view_or_value _filter; - stdx::optional _collation; - stdx::optional _hint; + stdx::optional _collation; + stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one-fwd.hpp index dd33ef151f..571b1b5eb6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/delete_one-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API delete_one; @@ -26,4 +26,12 @@ class MONGOCXX_API delete_one; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::delete_one; + +} // namespace model +} // namespace mongocxx + #include 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 b22582ce61..50cbd61e35 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// @@ -38,14 +38,14 @@ class delete_one { /// @param filter /// Document representing the criteria for deletion. /// - delete_one(bsoncxx::document::view_or_value filter); + delete_one(bsoncxx::v_noabi::document::view_or_value filter); /// /// Gets the filter on this delete operation. /// /// @return The filter to be used for the delete operation. /// - const bsoncxx::document::view_or_value& filter() const; + const bsoncxx::v_noabi::document::view_or_value& filter() const; /// /// Sets the collation for this delete operation. @@ -56,7 +56,7 @@ class delete_one { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - delete_one& collation(bsoncxx::document::view_or_value collation); + delete_one& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Gets the collation option for this delete operation. @@ -67,7 +67,7 @@ class delete_one { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the index to use for this operation. @@ -82,20 +82,20 @@ class delete_one { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - delete_one& hint(mongocxx::hint index_hint); + delete_one& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; private: - bsoncxx::document::view_or_value _filter; + bsoncxx::v_noabi::document::view_or_value _filter; - stdx::optional _collation; - stdx::optional _hint; + stdx::optional _collation; + stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one-fwd.hpp index 3f2265d801..d91ca07394 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API insert_one; @@ -26,4 +26,12 @@ class MONGOCXX_API insert_one; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::insert_one; + +} // namespace model +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one.hpp index 2aeb6a5b51..e5056e148e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/insert_one.hpp @@ -21,7 +21,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// @@ -35,17 +35,17 @@ class insert_one { /// @param document /// The document to insert. /// - insert_one(bsoncxx::document::view_or_value document); + insert_one(bsoncxx::v_noabi::document::view_or_value document); /// /// Gets the document to be inserted. /// /// @return The document to be inserted. /// - const bsoncxx::document::view_or_value& document() const; + const bsoncxx::v_noabi::document::view_or_value& document() const; private: - bsoncxx::document::view_or_value _document; + bsoncxx::v_noabi::document::view_or_value _document; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one-fwd.hpp index 2d7942d786..f07e2df544 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/replace_one-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API replace_one; @@ -26,4 +26,12 @@ class MONGOCXX_API replace_one; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::replace_one; + +} // namespace model +} // namespace mongocxx + #include 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 2bc47abc3b..9a0880849c 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// @@ -40,22 +40,22 @@ class replace_one { /// @param replacement /// Document that will serve as the replacement. /// - replace_one(bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement); + replace_one(bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement); /// /// Gets the filter for replacement. /// /// @return The filter to be used for the replacement operation. /// - const bsoncxx::document::view_or_value& filter() const; + const bsoncxx::v_noabi::document::view_or_value& filter() const; /// /// Gets the replacement document. /// /// @return The document that will replace the original selected document. /// - const bsoncxx::document::view_or_value& replacement() const; + const bsoncxx::v_noabi::document::view_or_value& replacement() const; /// /// Sets the collation for this replacement operation. @@ -66,7 +66,7 @@ class replace_one { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - replace_one& collation(bsoncxx::document::view_or_value collation); + replace_one& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Gets the collation option for this replacement operation. @@ -77,7 +77,7 @@ class replace_one { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the upsert option. @@ -114,22 +114,22 @@ class replace_one { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - replace_one& hint(mongocxx::hint index_hint); + replace_one& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; private: - bsoncxx::document::view_or_value _filter; - bsoncxx::document::view_or_value _replacement; + bsoncxx::v_noabi::document::view_or_value _filter; + bsoncxx::v_noabi::document::view_or_value _replacement; - stdx::optional _collation; + stdx::optional _collation; stdx::optional _upsert; - stdx::optional _hint; + stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many-fwd.hpp index 3706a5bdd3..bdde22721d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API update_many; @@ -26,4 +26,12 @@ class MONGOCXX_API update_many; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::update_many; + +} // namespace model +} // namespace mongocxx + #include 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 b4ac89fa1a..57d97e2849 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 @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// @@ -34,12 +34,12 @@ namespace model { /// class update_many { // - // Utility class supporting the convenience of {} meaning an empty bsoncxx::document. + // Utility class supporting the convenience of {} meaning an empty bsoncxx::v_noabi::document. // // Users may not use this class directly. // // In places where driver methods take this class as a parameter, passing {} will - // translate to a default-constructed bsoncxx::document::view_or_value, + // translate to a default-constructed bsoncxx::v_noabi::document::view_or_value, // regardless of other overloads taking other default-constructible types // for that parameter. This class avoids compiler ambiguity with such overloads. // @@ -60,7 +60,8 @@ class update_many { /// @param update /// Document representing the modifications to be applied to matching documents. /// - update_many(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update); + update_many(bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update); /// /// Constructs an update operation that will modify all documents matching the filter. @@ -70,7 +71,7 @@ class update_many { /// @param update /// Pipeline representing the modifications to be applied to matching documents. /// - update_many(bsoncxx::document::view_or_value filter, const pipeline& update); + update_many(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update); /// /// Constructs an update operation that will modify all documents matching the filter. @@ -80,7 +81,7 @@ class update_many { /// @param update /// Supports the empty update {}. /// - update_many(bsoncxx::document::view_or_value filter, + update_many(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update); /// @@ -92,14 +93,14 @@ class update_many { /// /// @return The filter to be used for the update operation. /// - const bsoncxx::document::view_or_value& filter() const; + const bsoncxx::v_noabi::document::view_or_value& filter() const; /// /// Gets the update document. /// /// @return The modifications to be applied as part of the update. /// - const bsoncxx::document::view_or_value& update() const; + const bsoncxx::v_noabi::document::view_or_value& update() const; /// /// Sets the collation for this update operation. @@ -110,7 +111,7 @@ class update_many { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - update_many& collation(bsoncxx::document::view_or_value collation); + update_many& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Gets the collation option for this update operation. @@ -121,7 +122,7 @@ class update_many { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// Sets the index to use for this operation. /// @@ -135,14 +136,14 @@ class update_many { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - update_many& hint(mongocxx::hint index_hint); + update_many& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Sets the upsert option. @@ -174,7 +175,7 @@ class update_many { /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - update_many& array_filters(bsoncxx::array::view_or_value array_filters); + update_many& array_filters(bsoncxx::v_noabi::array::view_or_value array_filters); /// /// Get array filters for this operation. @@ -184,16 +185,16 @@ class update_many { /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - const stdx::optional& array_filters() const; + const stdx::optional& array_filters() const; private: - bsoncxx::document::view_or_value _filter; - bsoncxx::document::view_or_value _update; + 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 _collation; + stdx::optional _array_filters; stdx::optional _upsert; - stdx::optional _hint; + stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one-fwd.hpp index c4d24e7dbc..dfb885d8e2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API update_one; @@ -26,4 +26,12 @@ class MONGOCXX_API update_one; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::update_one; + +} // namespace model +} // namespace mongocxx + #include 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 95ebd0abe2..5f67dfb6f5 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 @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// @@ -34,12 +34,12 @@ namespace model { /// class update_one { // - // Utility class supporting the convenience of {} meaning an empty bsoncxx::document. + // Utility class supporting the convenience of {} meaning an empty bsoncxx::v_noabi::document. // // Users may not use this class directly. // // In places where driver methods take this class as a parameter, passing {} will - // translate to a default-constructed bsoncxx::document::view_or_value, + // translate to a default-constructed bsoncxx::v_noabi::document::view_or_value, // regardless of other overloads taking other default-constructible types // for that parameter. This class avoids compiler ambiguity with such overloads. // @@ -60,7 +60,8 @@ class update_one { /// @param update /// Document representing the modifications to be applied to the matching document. /// - update_one(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update); + update_one(bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update); /// /// Constructs an update operation that will modify a single document matching the filter. @@ -70,7 +71,7 @@ class update_one { /// @param update /// Pipeline representing the modifications to be applied to the matching document. /// - update_one(bsoncxx::document::view_or_value filter, const pipeline& update); + update_one(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update); /// /// Constructs an update operation that will modify a single document matching the filter. @@ -80,7 +81,7 @@ class update_one { /// @param update /// Supports the empty update {}. /// - update_one(bsoncxx::document::view_or_value filter, + update_one(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update); /// @@ -92,14 +93,14 @@ class update_one { /// /// @return The filter to be used for the update operation. /// - const bsoncxx::document::view_or_value& filter() const; + const bsoncxx::v_noabi::document::view_or_value& filter() const; /// /// Gets the update document. /// /// @return The modifications to be applied as part of the update. /// - const bsoncxx::document::view_or_value& update() const; + const bsoncxx::v_noabi::document::view_or_value& update() const; /// /// Sets the collation for this update operation. @@ -110,7 +111,7 @@ class update_one { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - update_one& collation(bsoncxx::document::view_or_value collation); + update_one& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Gets the collation option for this update operation. @@ -121,7 +122,7 @@ class update_one { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the index to use for this operation. @@ -136,14 +137,14 @@ class update_one { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - update_one& hint(mongocxx::hint index_hint); + update_one& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Sets the upsert option. @@ -175,7 +176,7 @@ class update_one { /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - update_one& array_filters(bsoncxx::array::view_or_value array_filters); + update_one& array_filters(bsoncxx::v_noabi::array::view_or_value array_filters); /// /// Get array filters for this operation. @@ -185,16 +186,16 @@ class update_one { /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - const stdx::optional& array_filters() const; + const stdx::optional& array_filters() const; private: - bsoncxx::document::view_or_value _filter; - bsoncxx::document::view_or_value _update; + 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 _collation; + stdx::optional _array_filters; stdx::optional _upsert; - stdx::optional _hint; + stdx::optional _hint; }; } // namespace model diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write-fwd.hpp index b0022416a2..93b868dd2e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { class MONGOCXX_API write; @@ -26,4 +26,12 @@ class MONGOCXX_API write; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace model { + +using ::mongocxx::v_noabi::model::write; + +} // namespace model +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp index 89faba5ab6..d8c4d60180 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp @@ -30,11 +30,11 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { /// -/// Models a single write operation within a mongocxx::bulk_write. +/// Models a single write operation within a mongocxx::v_noabi::bulk_write. /// class write { public: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate-fwd.hpp index 113f1f0bf7..0b570194c5 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API aggregate; @@ -26,4 +26,12 @@ class MONGOCXX_API aggregate; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::aggregate; + +} // namespace options +} // namespace mongocxx + #include 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 8c8f761b12..f19368cc87 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp @@ -34,7 +34,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -101,7 +101,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - aggregate& collation(bsoncxx::document::view_or_value collation); + aggregate& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -111,7 +111,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the variable mapping for this operation. @@ -125,7 +125,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - aggregate& let(bsoncxx::document::view_or_value let); + aggregate& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Retrieves the current variable mapping for this operation. @@ -135,7 +135,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& let() const; + const stdx::optional& let() const; /// /// Sets the maximum amount of time for this operation to run server-side in milliseconds. @@ -172,7 +172,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - aggregate& read_preference(mongocxx::read_preference rp); + aggregate& read_preference(mongocxx::v_noabi::read_preference rp); /// /// The current read_preference for this operation. @@ -181,7 +181,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& read_preference() const; + const stdx::optional& read_preference() const; /// /// Sets whether the $out stage should bypass document validation. @@ -218,7 +218,7 @@ class aggregate { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - aggregate& hint(mongocxx::hint index_hint); + aggregate& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. @@ -227,7 +227,7 @@ class aggregate { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Sets the write concern to use for this operation. Only has an effect if $out is a part of @@ -243,7 +243,7 @@ class aggregate { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - aggregate& write_concern(mongocxx::write_concern write_concern); + aggregate& write_concern(mongocxx::v_noabi::write_concern write_concern); /// /// Gets the current write concern. @@ -254,7 +254,7 @@ class aggregate { /// @see /// https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Sets the read concern to use for this operation. @@ -268,7 +268,7 @@ class aggregate { /// @return /// A reference to the object on which this member function is being called. /// - aggregate& read_concern(mongocxx::read_concern read_concern); + aggregate& read_concern(mongocxx::v_noabi::read_concern read_concern); /// /// Gets the current read concern. @@ -279,7 +279,7 @@ class aggregate { /// @see /// https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& read_concern() const; + const stdx::optional& read_concern() const; /// /// Sets the comment to use for this operation. @@ -293,7 +293,7 @@ class aggregate { /// @return /// A reference to the object on which this member function is being called. /// - aggregate& comment(bsoncxx::types::bson_value::view_or_value comment); + aggregate& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current comment. @@ -304,25 +304,25 @@ class aggregate { /// @see /// https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& comment() const; + const stdx::optional& comment() const; private: friend ::mongocxx::v_noabi::collection; friend ::mongocxx::v_noabi::database; - void append(bsoncxx::builder::basic::document& builder) const; + 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 _collation; + stdx::optional _let; stdx::optional _max_time; - stdx::optional _read_preference; + stdx::optional _read_preference; stdx::optional _bypass_document_validation; - stdx::optional _hint; - stdx::optional _write_concern; - stdx::optional _read_concern; - stdx::optional _comment; + stdx::optional _hint; + stdx::optional _write_concern; + stdx::optional _read_concern; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm-fwd.hpp index 9b1128a2ed..3dbf855789 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API apm; @@ -26,4 +26,12 @@ class MONGOCXX_API apm; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::apm; + +} // namespace options +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm.hpp index 8405bd6d7d..854717c8c9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/apm.hpp @@ -34,7 +34,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -57,15 +57,14 @@ class apm { /// method chaining. /// apm& on_command_started( - std::function command_started); + std::function command_started); /// /// Retrieves the command started monitoring callback. /// /// @return The command started monitoring callback. /// - const std::function& command_started() - const; + const std::function& command_started() const; /// /// Set the command failed monitoring callback. The callback takes a reference to a @@ -81,16 +80,14 @@ class apm { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - apm& on_command_failed( - std::function command_failed); + apm& on_command_failed(std::function command_failed); /// /// Retrieves the command failed monitoring callback. /// /// @return The command failed monitoring callback. /// - const std::function& command_failed() - const; + const std::function& command_failed() const; /// /// Set the command succeeded monitoring callback. The callback takes a reference to a @@ -107,15 +104,14 @@ class apm { /// method chaining. /// apm& on_command_succeeded( - std::function command_succeeded); + std::function command_succeeded); /// /// Retrieves the command succeeded monitoring callback. /// /// @return The command succeeded monitoring callback. /// - const std::function& command_succeeded() - const; + const std::function& command_succeeded() const; /// /// Set the server opening monitoring callback. The callback takes a reference to a @@ -131,16 +127,14 @@ class apm { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - apm& on_server_opening( - std::function server_opening); + apm& on_server_opening(std::function server_opening); /// /// Retrieves the server opening monitoring callback. /// /// @return The server opening monitoring callback. /// - const std::function& server_opening() - const; + const std::function& server_opening() const; /// /// Set the server closed monitoring callback. The callback takes a reference to a @@ -156,15 +150,14 @@ class apm { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - apm& on_server_closed( - std::function server_closed); + apm& on_server_closed(std::function server_closed); /// /// Retrieves the server closed monitoring callback. /// /// @return The server closed monitoring callback. /// - const std::function& server_closed() const; + const std::function& server_closed() const; /// /// Set the server description changed monitoring callback. The callback takes a reference to a @@ -181,16 +174,14 @@ class apm { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - apm& on_server_changed( - std::function server_changed); + apm& on_server_changed(std::function server_changed); /// /// Retrieves the server description changed monitoring callback. /// /// @return The server description changed monitoring callback. /// - const std::function& server_changed() - const; + const std::function& server_changed() const; /// /// Set the topology_opening monitoring callback. The callback takes a reference to a @@ -207,15 +198,14 @@ class apm { /// method chaining. /// apm& on_topology_opening( - std::function topology_opening); + std::function topology_opening); /// /// Retrieves the topology_opening monitoring callback. /// /// @return The topology_opening monitoring callback. /// - const std::function& topology_opening() - const; + const std::function& topology_opening() const; /// /// Set the topology closed monitoring callback. The callback takes a reference to a @@ -232,15 +222,14 @@ class apm { /// method chaining. /// apm& on_topology_closed( - std::function topology_closed); + std::function topology_closed); /// /// Retrieves the topology closed monitoring callback. /// /// @return The topology closed monitoring callback. /// - const std::function& topology_closed() - const; + const std::function& topology_closed() const; /// /// Set the topology description changed monitoring callback. The callback takes a reference to @@ -258,15 +247,14 @@ class apm { /// method chaining. /// apm& on_topology_changed( - std::function topology_changed); + std::function topology_changed); /// /// Retrieves the topology description changed monitoring callback. /// /// @return The topology description changed monitoring callback. /// - const std::function& topology_changed() - const; + const std::function& topology_changed() const; /// /// Set the heartbeat started monitoring callback. The callback takes a reference to a @@ -283,15 +271,14 @@ class apm { /// method chaining. /// apm& on_heartbeat_started( - std::function heartbeat_started); + std::function heartbeat_started); /// /// Retrieves the heartbeat started monitoring callback. /// /// @return The heartbeat started monitoring callback. /// - const std::function& heartbeat_started() - const; + const std::function& heartbeat_started() const; /// /// Set the heartbeat failed monitoring callback. The callback takes a reference to a @@ -308,15 +295,14 @@ class apm { /// method chaining. /// apm& on_heartbeat_failed( - std::function heartbeat_failed); + std::function heartbeat_failed); /// /// Retrieves the heartbeat failed monitoring callback. /// /// @return The heartbeat failed monitoring callback. /// - const std::function& heartbeat_failed() - const; + const std::function& heartbeat_failed() const; /// /// Set the heartbeat succeeded monitoring callback. The callback takes a reference to a @@ -334,30 +320,29 @@ class apm { /// method chaining. /// apm& on_heartbeat_succeeded( - std::function - heartbeat_succeeded); + std::function heartbeat_succeeded); /// /// Retrieves the heartbeat succeeded monitoring callback. /// /// @return The heartbeat succeeded monitoring callback. /// - const std::function& - heartbeat_succeeded() const; + const std::function& heartbeat_succeeded() + const; private: - std::function _command_started; - std::function _command_failed; - std::function _command_succeeded; - std::function _server_closed; - std::function _server_changed; - std::function _server_opening; - std::function _topology_closed; - std::function _topology_changed; - std::function _topology_opening; - std::function _heartbeat_started; - std::function _heartbeat_failed; - std::function _heartbeat_succeeded; + std::function _command_started; + std::function _command_failed; + std::function _command_succeeded; + std::function _server_closed; + std::function _server_changed; + std::function _server_opening; + std::function _topology_closed; + std::function _topology_changed; + std::function _topology_opening; + std::function _heartbeat_started; + std::function _heartbeat_failed; + std::function _heartbeat_succeeded; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption-fwd.hpp index 7e71110498..e62516d412 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API auto_encryption; @@ -26,4 +26,12 @@ class MONGOCXX_API auto_encryption; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::auto_encryption; + +} // namespace options +} // namespace mongocxx + #include 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 86175698e1..ed863865a7 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 @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -56,7 +56,7 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& key_vault_client(mongocxx::client* client); + auto_encryption& key_vault_client(mongocxx::v_noabi::client* client); /// /// Gets the key vault client. @@ -64,7 +64,7 @@ class auto_encryption { /// @return /// An optional pointer to the key vault client. /// - const stdx::optional& key_vault_client() const; + const stdx::optional& key_vault_client() const; /// /// When the key vault collection is on a separate MongoDB cluster, @@ -86,7 +86,7 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& key_vault_pool(mongocxx::pool* pool); + auto_encryption& key_vault_pool(mongocxx::v_noabi::pool* pool); /// /// Gets the key vault pool. @@ -94,7 +94,7 @@ class auto_encryption { /// @return /// An optional pointer to the key vault pool. /// - const stdx::optional& key_vault_pool() const; + const stdx::optional& key_vault_pool() const; /// /// Sets the namespace to use to access the key vault collection, which @@ -167,7 +167,7 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& kms_providers(bsoncxx::document::view_or_value kms_providers); + auto_encryption& kms_providers(bsoncxx::v_noabi::document::view_or_value kms_providers); /// /// Gets the KMS providers. @@ -175,7 +175,7 @@ class auto_encryption { /// @return /// An optional document containing the KMS providers. /// - const stdx::optional& kms_providers() const; + const stdx::optional& kms_providers() const; /// /// Sets the TLS options to use for client side encryption with a given KMS provider. @@ -199,7 +199,7 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& tls_opts(bsoncxx::document::view_or_value tls_opts); + auto_encryption& tls_opts(bsoncxx::v_noabi::document::view_or_value tls_opts); /// /// Gets the TLS options. @@ -207,7 +207,7 @@ class auto_encryption { /// @return /// An optional document containing the TLS options. /// - const stdx::optional& tls_opts() const; + const stdx::optional& tls_opts() const; /// /// Sets a local JSON schema. @@ -231,7 +231,7 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& schema_map(bsoncxx::document::view_or_value schema_map); + auto_encryption& schema_map(bsoncxx::v_noabi::document::view_or_value schema_map); /// /// Gets the schema map. @@ -239,7 +239,7 @@ class auto_encryption { /// @return /// An optional document containing the schema map. /// - const stdx::optional& schema_map() const; + const stdx::optional& schema_map() const; /// /// Sets the local encrypted fields map. @@ -258,7 +258,8 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& encrypted_fields_map(bsoncxx::document::view_or_value encrypted_fields_map); + auto_encryption& encrypted_fields_map( + bsoncxx::v_noabi::document::view_or_value encrypted_fields_map); /// /// Get encrypted fields map @@ -266,7 +267,7 @@ class auto_encryption { /// @return /// An optional document containing the encrypted fields map /// - const stdx::optional& encrypted_fields_map() const; + const stdx::optional& encrypted_fields_map() const; /// /// Automatic encryption is disabled when the 'bypassAutoEncryption' @@ -361,7 +362,7 @@ class auto_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - auto_encryption& extra_options(bsoncxx::document::view_or_value extra); + auto_encryption& extra_options(bsoncxx::v_noabi::document::view_or_value extra); /// /// Gets extra options related to the mongocryptd process. @@ -369,7 +370,7 @@ class auto_encryption { /// @return /// An optional document containing the extra options. /// - const stdx::optional& extra_options() const; + const stdx::optional& extra_options() const; private: friend ::mongocxx::v_noabi::client; @@ -379,14 +380,14 @@ class auto_encryption { bool _bypass; bool _bypass_query_analysis; - stdx::optional _key_vault_client; - stdx::optional _key_vault_pool; + 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; + stdx::optional _kms_providers; + stdx::optional _tls_opts; + stdx::optional _schema_map; + stdx::optional _encrypted_fields_map; + stdx::optional _extra_options; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write-fwd.hpp index 34dbae4606..7c52172405 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/bulk_write-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API bulk_write; @@ -26,4 +26,12 @@ class MONGOCXX_API bulk_write; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::bulk_write; + +} // namespace options +} // namespace mongocxx + #include 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 c2c3c9284c..d858d8178c 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -75,7 +75,7 @@ class bulk_write { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - bulk_write& write_concern(mongocxx::write_concern wc); + bulk_write& write_concern(mongocxx::v_noabi::write_concern wc); /// /// The current write_concern for this operation. @@ -85,7 +85,7 @@ class bulk_write { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Set whether or not to bypass document validation for this operation. @@ -117,7 +117,7 @@ class bulk_write { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - bulk_write& let(bsoncxx::document::view_or_value let); + bulk_write& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -125,7 +125,7 @@ class bulk_write { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -137,7 +137,7 @@ class bulk_write { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - bulk_write& comment(bsoncxx::types::bson_value::view_or_value comment); + bulk_write& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -145,14 +145,14 @@ class bulk_write { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; private: bool _ordered; - stdx::optional _write_concern; + stdx::optional _write_concern; stdx::optional _bypass_document_validation; - stdx::optional _let; - stdx::optional _comment; + stdx::optional _let; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream-fwd.hpp index 59e97bba65..65cb0ab88b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/change_stream-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API change_stream; @@ -26,4 +26,12 @@ class MONGOCXX_API change_stream; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::change_stream; + +} // namespace options +} // namespace mongocxx + #include 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 3b485f4bfd..4debf259a0 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 @@ -30,7 +30,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -67,7 +67,7 @@ class change_stream { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - change_stream& full_document(bsoncxx::string::view_or_value full_doc); + change_stream& full_document(bsoncxx::v_noabi::string::view_or_value full_doc); /// /// Gets the current fullDocument option. @@ -75,7 +75,8 @@ class change_stream { /// @return /// The current fullDocument option. /// - const bsoncxx::stdx::optional& full_document() const; + const bsoncxx::v_noabi::stdx::optional& full_document() + const; /// /// Sets the fullDocumentBeforeChange option for the $changeStream. @@ -97,7 +98,7 @@ class change_stream { /// method chaining. /// change_stream& full_document_before_change( - bsoncxx::string::view_or_value full_doc_before_change); + bsoncxx::v_noabi::string::view_or_value full_doc_before_change); /// /// Gets the current fullDocumentBeforeChange option. @@ -105,8 +106,8 @@ class change_stream { /// @return /// The current fullDocumentBeforeChange option. /// - const bsoncxx::stdx::optional& full_document_before_change() - const; + const bsoncxx::v_noabi::stdx::optional& + full_document_before_change() const; /// /// Sets the number of documents to return per batch. @@ -138,7 +139,7 @@ class change_stream { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - change_stream& comment(bsoncxx::types::bson_value::view_or_value comment); + change_stream& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -146,7 +147,7 @@ class change_stream { /// @return /// The current comment option. /// - const stdx::optional& comment() const; + const stdx::optional& comment() const; /// /// Specifies the logical starting point for the new change stream. @@ -163,7 +164,7 @@ class change_stream { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - change_stream& resume_after(bsoncxx::document::view_or_value resume_after); + change_stream& resume_after(bsoncxx::v_noabi::document::view_or_value resume_after); /// /// Retrieves the current resumeToken for this change stream. @@ -171,7 +172,7 @@ class change_stream { /// @return /// The current resumeToken. /// - const stdx::optional& resume_after() const; + const stdx::optional& resume_after() const; /// /// Specifies the logical starting point of the new change stream. The new stream will @@ -190,7 +191,7 @@ class change_stream { /// @return /// A reference to the object on which this function is being called. /// - change_stream& start_after(bsoncxx::document::view_or_value token); + change_stream& start_after(bsoncxx::v_noabi::document::view_or_value token); /// /// Retrieves the current startAfter token for this change stream. @@ -198,7 +199,7 @@ class change_stream { /// @return /// The current startAfter token. /// - const stdx::optional& start_after() const; + const stdx::optional& start_after() const; /// /// Sets the collation for this operation. @@ -210,7 +211,7 @@ class change_stream { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - change_stream& collation(bsoncxx::document::view_or_value collation); + change_stream& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -218,7 +219,7 @@ class change_stream { /// @return /// The current collation. /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the maximum amount of time for for the server to wait on new documents to satisfy a @@ -255,28 +256,29 @@ class change_stream { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - change_stream& start_at_operation_time(bsoncxx::types::b_timestamp timestamp); + change_stream& start_at_operation_time(bsoncxx::v_noabi::types::b_timestamp timestamp); private: friend ::mongocxx::v_noabi::client; friend ::mongocxx::v_noabi::collection; friend ::mongocxx::v_noabi::database; - bsoncxx::document::value as_bson() const; - stdx::optional _full_document; - stdx::optional _full_document_before_change; + 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 _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::types::b_timestamp _start_at_operation_time = {}; + bsoncxx::v_noabi::types::b_timestamp _start_at_operation_time = {}; bool _start_at_operation_time_set = false; }; + } // namespace options } // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client-fwd.hpp index f1c82b3ff4..cebb0b6039 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API client; @@ -26,4 +26,12 @@ class MONGOCXX_API client; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::client; + +} // namespace options +} // namespace mongocxx + #include 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 0df49b986a..b87859da54 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client.hpp @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { // NOTE: client options interface still evolving diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption-fwd.hpp index 521f5586ae..bedb408f2e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API client_encryption; @@ -26,4 +26,12 @@ class MONGOCXX_API client_encryption; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::client_encryption; + +} // namespace options +} // namespace mongocxx + #include 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 f81cb3fdd6..1f1f1ec671 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 @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -48,7 +48,7 @@ class client_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - client_encryption& key_vault_client(mongocxx::client* client); + client_encryption& key_vault_client(mongocxx::v_noabi::client* client); /// /// Gets the key vault client. @@ -56,7 +56,7 @@ class client_encryption { /// @return /// An optional pointer to the key vault client. /// - const stdx::optional& key_vault_client() const; + const stdx::optional& key_vault_client() const; /// /// Sets the namespace to use to access the key vault collection, which @@ -129,7 +129,7 @@ class client_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - client_encryption& kms_providers(bsoncxx::document::view_or_value kms_providers); + client_encryption& kms_providers(bsoncxx::v_noabi::document::view_or_value kms_providers); /// /// Gets the KMS providers. @@ -137,7 +137,7 @@ class client_encryption { /// @return /// An optional document containing the KMS providers. /// - const stdx::optional& kms_providers() const; + const stdx::optional& kms_providers() const; /// /// Sets the TLS options to use for client side encryption with a given KMS provider. @@ -161,7 +161,7 @@ class client_encryption { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - client_encryption& tls_opts(bsoncxx::document::view_or_value tls_opts); + client_encryption& tls_opts(bsoncxx::v_noabi::document::view_or_value tls_opts); /// /// Gets the TLS options. @@ -169,17 +169,17 @@ class client_encryption { /// @return /// An optional document containing the TLS options. /// - const stdx::optional& tls_opts() const; + const stdx::optional& tls_opts() const; private: friend ::mongocxx::v_noabi::client_encryption; MONGOCXX_PRIVATE void* convert() const; - stdx::optional _key_vault_client; + stdx::optional _key_vault_client; stdx::optional _key_vault_namespace; - stdx::optional _kms_providers; - stdx::optional _tls_opts; + stdx::optional _kms_providers; + stdx::optional _tls_opts; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session-fwd.hpp index 89fbc448c9..00c99ab802 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_session-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API client_session; @@ -26,4 +26,12 @@ class MONGOCXX_API client_session; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::client_session; + +} // namespace options +} // namespace mongocxx + #include 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 e05cad93f8..762aec602e 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 @@ -24,11 +24,11 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// -/// Class representing the optional arguments to mongocxx::client::start_session. +/// Class representing the optional arguments to mongocxx::v_noabi::client::start_session. /// class client_session { public: @@ -39,9 +39,9 @@ class client_session { /// previous read or write operation. Set to false to disable causal consistency. /// /// Unacknowledged writes are not causally consistent. If you execute a write operation with an - /// unacknowledged write concern (a mongocxx::write_concern with - /// mongocxx::write_concern::acknowledge_level of @c k_unacknowledged), the write does not - /// participate in causal consistency. + /// unacknowledged write concern (a mongocxx::v_noabi::write_concern with + /// mongocxx::v_noabi::write_concern::acknowledge_level of @c k_unacknowledged), the write does + /// not participate in causal consistency. /// /// @return /// A reference to the object on which this member function is being called. This facilitates @@ -70,7 +70,7 @@ class client_session { /// /// @note Snapshot reads and causal consistency are mutually exclusive: only one or the /// other may be active at a time. Attempting to do so will result in an error being thrown - /// by mongocxx::client::start_session. + /// by mongocxx::v_noabi::client::start_session. /// client_session& snapshot(bool enable_snapshot_reads) noexcept; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count-fwd.hpp index 3477816580..6f17c398f9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API count; @@ -26,4 +26,12 @@ class MONGOCXX_API count; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::count; + +} // namespace options +} // namespace mongocxx + #include 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 e43f6e2c69..e84408cc21 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/count.hpp @@ -29,11 +29,11 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// -/// Class representing the optional arguments to mongocxx::collection::count_documents +/// Class representing the optional arguments to mongocxx::v_noabi::collection::count_documents /// class count { public: @@ -49,7 +49,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - count& collation(bsoncxx::document::view_or_value collation); + count& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -59,7 +59,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the index to use for this operation. @@ -73,7 +73,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - count& hint(mongocxx::hint index_hint); + count& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. @@ -82,7 +82,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the comment option. @@ -96,7 +96,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - count& comment(bsoncxx::types::bson_value::view_or_value comment); + count& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -105,7 +105,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& comment() const; + const stdx::optional& comment() const; /// /// Sets the maximum number of documents to count. @@ -188,7 +188,7 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - count& read_preference(mongocxx::read_preference rp); + count& read_preference(mongocxx::v_noabi::read_preference rp); /// /// The current read_preference for this operation. @@ -197,16 +197,16 @@ class count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ /// - const stdx::optional& read_preference() const; + const stdx::optional& read_preference() const; private: - stdx::optional _collation; - stdx::optional _hint; - stdx::optional _comment; + stdx::optional _collation; + stdx::optional _hint; + stdx::optional _comment; stdx::optional _limit; stdx::optional _max_time; stdx::optional _skip; - stdx::optional _read_preference; + 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 d462fa4983..6d89a9583c 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 @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -73,7 +73,7 @@ class MONGOCXX_API create_collection_deprecated { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - create_collection_deprecated& collation(bsoncxx::document::view_or_value collation); + create_collection_deprecated& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Gets the default collation for this collection. @@ -84,7 +84,7 @@ class MONGOCXX_API create_collection_deprecated { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// The maximum number of documents allowed in the capped collection. @@ -173,7 +173,7 @@ class MONGOCXX_API create_collection_deprecated { /// method chaining. /// create_collection_deprecated& storage_engine( - bsoncxx::document::view_or_value storage_engine_opts); + bsoncxx::v_noabi::document::view_or_value storage_engine_opts); /// /// Gets the current storage engine configuration for this collection. @@ -181,7 +181,7 @@ class MONGOCXX_API create_collection_deprecated { /// @return /// Configuration options specific to the storage engine. /// - const stdx::optional& storage_engine() const; + const stdx::optional& storage_engine() const; /// /// Specify validation criteria for this collection. @@ -195,7 +195,8 @@ class MONGOCXX_API create_collection_deprecated { /// /// @see https://www.mongodb.com/docs/manual/core/document-validation/ /// - create_collection_deprecated& validation_criteria(mongocxx::validation_criteria validation); + create_collection_deprecated& validation_criteria( + mongocxx::v_noabi::validation_criteria validation); /// /// Gets the current validation criteria for this collection. @@ -205,7 +206,7 @@ class MONGOCXX_API create_collection_deprecated { /// /// @see https://www.mongodb.com/docs/manual/core/document-validation/ /// - const stdx::optional& validation_criteria() const; + const stdx::optional& validation_criteria() const; /// /// Return a bson document representing the options set on this object. @@ -216,29 +217,29 @@ class MONGOCXX_API create_collection_deprecated { /// /// @return Options, as a document. /// - MONGOCXX_DEPRECATED bsoncxx::document::value to_document() const; - bsoncxx::document::value to_document_deprecated() const; + MONGOCXX_DEPRECATED bsoncxx::v_noabi::document::value to_document() const; + bsoncxx::v_noabi::document::value to_document_deprecated() const; /// /// @deprecated /// This method is deprecated. To determine which options are set on this object, use the /// provided accessors instead. /// - MONGOCXX_DEPRECATED MONGOCXX_INLINE operator bsoncxx::document::value() const; + MONGOCXX_DEPRECATED MONGOCXX_INLINE operator bsoncxx::v_noabi::document::value() const; private: stdx::optional _capped; - stdx::optional _collation; + stdx::optional _collation; stdx::optional _max_documents; stdx::optional _max_size; stdx::optional _no_padding; - stdx::optional _storage_engine_opts; - stdx::optional _validation; + stdx::optional _storage_engine_opts; + stdx::optional _validation; }; MONGOCXX_DEPRECATED typedef create_collection_deprecated create_collection; -MONGOCXX_INLINE create_collection_deprecated::operator bsoncxx::document::value() const { +MONGOCXX_INLINE create_collection_deprecated::operator bsoncxx::v_noabi::document::value() const { return to_document_deprecated(); } @@ -246,4 +247,13 @@ MONGOCXX_INLINE create_collection_deprecated::operator bsoncxx::document::value( } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::create_collection; +using ::mongocxx::v_noabi::options::create_collection_deprecated; + +} // namespace options +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key-fwd.hpp index e09b69008b..2923d57649 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API data_key; @@ -26,4 +26,12 @@ class MONGOCXX_API data_key; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::data_key; + +} // namespace options +} // namespace mongocxx + #include 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 ade85f269a..2ff320ce93 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 @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -89,7 +89,7 @@ class data_key { /// @see /// https://www.mongodb.com/docs/manual/core/security-client-side-encryption-key-management/ /// - data_key& master_key(bsoncxx::document::view_or_value master_key); + data_key& master_key(bsoncxx::v_noabi::document::view_or_value master_key); /// /// Gets the master key. @@ -97,7 +97,7 @@ class data_key { /// @return /// An optional document containing the master key. /// - const stdx::optional& master_key() const; + const stdx::optional& master_key() const; /// /// Sets an optional list of string alternate names used to reference the key. @@ -158,7 +158,7 @@ class data_key { MONGOCXX_PRIVATE void* convert() const; - stdx::optional _master_key; + stdx::optional _master_key; std::vector _key_alt_names; stdx::optional _key_material; }; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete-fwd.hpp index cb96665d6d..aeb542de77 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API delete_options; @@ -26,4 +26,12 @@ class MONGOCXX_API delete_options; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::delete_options; + +} // namespace options +} // namespace mongocxx + #include 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 8fa0304279..af3cc2bf2f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/delete.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -46,7 +46,7 @@ class delete_options { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - delete_options& collation(bsoncxx::document::view_or_value collation); + delete_options& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -57,7 +57,7 @@ class delete_options { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the write_concern for this operation. @@ -82,7 +82,7 @@ class delete_options { /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Sets the index to use for this operation. @@ -97,14 +97,14 @@ class delete_options { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - delete_options& hint(mongocxx::hint index_hint); + delete_options& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -116,7 +116,7 @@ class delete_options { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - delete_options& let(bsoncxx::document::view_or_value let); + delete_options& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -124,7 +124,7 @@ class delete_options { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -136,7 +136,7 @@ class delete_options { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - delete_options& comment(bsoncxx::types::bson_value::view_or_value comment); + delete_options& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -144,14 +144,14 @@ class delete_options { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; private: - stdx::optional _collation; - stdx::optional _write_concern; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + stdx::optional _collation; + stdx::optional _write_concern; + stdx::optional _hint; + stdx::optional _let; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct-fwd.hpp index f9492e5995..8f079ee05c 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API distinct; @@ -26,4 +26,12 @@ class MONGOCXX_API distinct; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::distinct; + +} // namespace options +} // namespace mongocxx + #include 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 de34c0373f..718370b41a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp @@ -28,7 +28,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -48,7 +48,7 @@ class distinct { /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - distinct& collation(bsoncxx::document::view_or_value collation); + distinct& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -58,7 +58,7 @@ class distinct { /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the maximum amount of time for this operation to run (server-side) in milliseconds. @@ -95,7 +95,7 @@ class distinct { /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - distinct& comment(bsoncxx::types::bson_value::view_or_value comment); + distinct& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// The current comment for this operation. @@ -104,7 +104,7 @@ class distinct { /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - const stdx::optional& comment() const; + const stdx::optional& comment() const; /// /// Sets the read_preference for this operation. @@ -118,7 +118,7 @@ class distinct { /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - distinct& read_preference(mongocxx::read_preference rp); + distinct& read_preference(mongocxx::v_noabi::read_preference rp); /// /// The current read_preference for this operation. @@ -127,13 +127,13 @@ class distinct { /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// - const stdx::optional& read_preference() const; + const stdx::optional& read_preference() const; private: - stdx::optional _collation; + stdx::optional _collation; stdx::optional _max_time; - stdx::optional _comment; - stdx::optional _read_preference; + stdx::optional _comment; + stdx::optional _read_preference; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt-fwd.hpp index 628977e441..be647130d9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API encrypt; @@ -26,4 +26,12 @@ class MONGOCXX_API encrypt; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::encrypt; + +} // namespace options +} // namespace mongocxx + #include 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 66ffb79497..b8c7eb7925 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/encrypt.hpp @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -50,7 +50,7 @@ class encrypt { /// /// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/ /// - encrypt& key_id(bsoncxx::types::bson_value::view_or_value key_id); + encrypt& key_id(bsoncxx::v_noabi::types::bson_value::view_or_value key_id); /// /// Gets the key_id. @@ -58,7 +58,7 @@ class encrypt { /// @return /// An optional owning bson_value containing the key_id. /// - const stdx::optional& key_id() const; + const stdx::optional& key_id() const; /// /// Sets a name by which to lookup a key from the key vault collection to use @@ -138,10 +138,10 @@ class encrypt { /// @param algorithm /// An algorithm, either deterministic, random, indexed, or unindexed to use for encryption. /// - /// @note To insert or query with an indexed encrypted payload, use a mongocxx::client - /// configured with mongocxx::options::auto_encryption. - /// mongocxx::options::auto_encryption::bypass_query_analysis may be true. - /// mongocxx::options::auto_encryption::bypass_auto_encryption must be false. + /// @note To insert or query with an indexed encrypted payload, use a mongocxx::v_noabi::client + /// configured with mongocxx::v_noabi::options::auto_encryption. + /// mongocxx::v_noabi::options::auto_encryption::bypass_query_analysis may be true. + /// mongocxx::v_noabi::options::auto_encryption::bypass_auto_encryption must be false. /// /// @see /// https://www.mongodb.com/docs/manual/core/security-client-side-encryption/#encryption-algorithms @@ -222,7 +222,7 @@ class encrypt { MONGOCXX_PRIVATE void* convert() const; - stdx::optional _key_id; + stdx::optional _key_id; stdx::optional _key_alt_name; stdx::optional _algorithm; stdx::optional _contention_factor; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count-fwd.hpp index cc42cd83e0..96bf103e9e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API estimated_document_count; @@ -26,4 +26,12 @@ class MONGOCXX_API estimated_document_count; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::estimated_document_count; + +} // namespace options +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count.hpp index df45a7725f..7ecee9f2f7 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/estimated_document_count.hpp @@ -25,11 +25,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// -/// Class representing the optional arguments to mongocxx::collection::estimated_document_count +/// Class representing the optional arguments to +/// mongocxx::v_noabi::collection::estimated_document_count /// class estimated_document_count { public: @@ -54,7 +55,7 @@ class estimated_document_count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/count/ /// - const bsoncxx::stdx::optional& max_time() const; + const bsoncxx::v_noabi::stdx::optional& max_time() const; /// /// Sets the comment for this operation. @@ -68,7 +69,7 @@ class estimated_document_count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/count/ /// - estimated_document_count& comment(bsoncxx::types::bson_value::view_or_value comment); + estimated_document_count& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// The current comment for this operation. @@ -77,7 +78,8 @@ class estimated_document_count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/count/ /// - const bsoncxx::stdx::optional& comment() const; + const bsoncxx::v_noabi::stdx::optional& + comment() const; /// /// Sets the read_preference for this operation. @@ -91,7 +93,7 @@ class estimated_document_count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/count/ /// - estimated_document_count& read_preference(mongocxx::read_preference rp); + estimated_document_count& read_preference(mongocxx::v_noabi::read_preference rp); /// /// The current read_preference for this operation. @@ -100,12 +102,13 @@ class estimated_document_count { /// /// @see https://www.mongodb.com/docs/manual/reference/command/count/ /// - const bsoncxx::stdx::optional& read_preference() const; + const bsoncxx::v_noabi::stdx::optional& read_preference() + const; private: - bsoncxx::stdx::optional _max_time; - bsoncxx::stdx::optional _comment; - bsoncxx::stdx::optional _read_preference; + 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/find-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find-fwd.hpp index fc1a8ae5d8..83cf668a61 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API find; @@ -26,4 +26,12 @@ class MONGOCXX_API find; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::find; + +} // namespace options +} // namespace mongocxx + #include 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 fbce3f92a1..ecbca63ddb 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find.hpp @@ -30,7 +30,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -125,7 +125,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& collation(bsoncxx::document::view_or_value collation); + find& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -135,7 +135,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Attaches a comment to the query. If $comment also exists in the modifiers document then @@ -152,7 +152,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& comment(bsoncxx::string::view_or_value comment); + find& comment(bsoncxx::v_noabi::string::view_or_value comment); /// /// Gets the current comment attached to this query. @@ -163,7 +163,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& comment() const; + const stdx::optional& comment() const; /// /// Indicates the type of cursor to use for this query. @@ -203,7 +203,7 @@ class find { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find& hint(mongocxx::hint index_hint); + find& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. @@ -212,7 +212,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -226,7 +226,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& let(bsoncxx::document::view_or_value let); + find& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -236,7 +236,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -252,7 +252,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& comment_option(bsoncxx::types::bson_value::view_or_value comment); + find& comment_option(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -264,7 +264,8 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& comment_option() const; + const stdx::optional& comment_option() + const; /// /// Sets maximum number of documents to return. @@ -300,7 +301,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& max(bsoncxx::document::view_or_value max); + find& max(bsoncxx::v_noabi::document::view_or_value max); /// /// Sets the current exclusive upper bound for a specific index. @@ -309,7 +310,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& max() const; + const stdx::optional& max() const; /// /// The maximum amount of time for the server to wait on new documents to satisfy a tailable @@ -375,7 +376,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& min(bsoncxx::document::view_or_value min); + find& min(bsoncxx::v_noabi::document::view_or_value min); /// /// Sets the current inclusive lower bound for a specific index. @@ -384,7 +385,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& min() const; + const stdx::optional& min() const; /// /// Sets the cursor flag to prevent cursor from timing out server-side due to a period of @@ -422,7 +423,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& projection(bsoncxx::document::view_or_value projection); + find& projection(bsoncxx::v_noabi::document::view_or_value projection); /// /// Gets the current projection set on this query. @@ -431,7 +432,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& projection() const; + const stdx::optional& projection() const; /// /// Sets the read_preference for this operation. @@ -445,7 +446,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& read_preference(mongocxx::read_preference rp); + find& read_preference(mongocxx::v_noabi::read_preference rp); /// /// The current read_preference for this operation. @@ -455,7 +456,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& read_preference() const; + const stdx::optional& read_preference() const; /// /// Sets whether to return the index keys associated with the query results, instead of the @@ -546,7 +547,7 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - find& sort(bsoncxx::document::view_or_value ordering); + find& sort(bsoncxx::v_noabi::document::view_or_value ordering); /// /// Gets the current sort ordering for this query. @@ -555,30 +556,30 @@ class find { /// /// @see https://www.mongodb.com/docs/manual/reference/command/find/ /// - const stdx::optional& sort() const; + const 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 _collation; + stdx::optional _comment; stdx::optional _cursor_type; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment_option; + stdx::optional _hint; + stdx::optional _let; + stdx::optional _comment_option; stdx::optional _limit; - stdx::optional _max; + stdx::optional _max; stdx::optional _max_await_time; stdx::optional _max_time; - stdx::optional _min; + stdx::optional _min; stdx::optional _no_cursor_timeout; - stdx::optional _projection; - stdx::optional _read_preference; + stdx::optional _projection; + stdx::optional _read_preference; stdx::optional _return_key; stdx::optional _show_record_id; stdx::optional _skip; - stdx::optional _ordering; + stdx::optional _ordering; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete-fwd.hpp index 36712d4bf0..3edcb3df40 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API find_one_and_delete; @@ -26,4 +26,12 @@ class MONGOCXX_API find_one_and_delete; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::find_one_and_delete; + +} // namespace options +} // namespace mongocxx + #include 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 b233ea287a..924b73c622 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 @@ -28,7 +28,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -47,7 +47,7 @@ class find_one_and_delete { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_delete& collation(bsoncxx::document::view_or_value collation); + find_one_and_delete& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -57,7 +57,7 @@ class find_one_and_delete { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the maximum amount of time for this operation to run (server-side) in milliseconds. @@ -94,7 +94,7 @@ class find_one_and_delete { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_delete& projection(bsoncxx::document::view_or_value projection); + find_one_and_delete& projection(bsoncxx::v_noabi::document::view_or_value projection); /// /// Gets the current projection set on this operation. @@ -103,7 +103,7 @@ class find_one_and_delete { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& projection() const; + const stdx::optional& projection() const; /// /// Sets the order to search for a matching document. @@ -120,7 +120,7 @@ class find_one_and_delete { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_delete& sort(bsoncxx::document::view_or_value ordering); + find_one_and_delete& sort(bsoncxx::v_noabi::document::view_or_value ordering); /// /// Gets the current sort ordering. @@ -129,7 +129,7 @@ class find_one_and_delete { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& sort() const; + const stdx::optional& sort() const; /// /// Sets the write concern for this operation. @@ -144,7 +144,7 @@ class find_one_and_delete { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_delete& write_concern(mongocxx::write_concern write_concern); + find_one_and_delete& write_concern(mongocxx::v_noabi::write_concern write_concern); /// /// Gets the current write concern. @@ -155,7 +155,7 @@ class find_one_and_delete { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Sets the index to use for this operation. @@ -170,14 +170,14 @@ class find_one_and_delete { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_delete& hint(mongocxx::hint index_hint); + find_one_and_delete& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -189,7 +189,7 @@ class find_one_and_delete { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_delete& let(bsoncxx::document::view_or_value let); + find_one_and_delete& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -197,7 +197,7 @@ class find_one_and_delete { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -209,7 +209,7 @@ class find_one_and_delete { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_delete& comment(bsoncxx::types::bson_value::view_or_value comment); + find_one_and_delete& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -217,17 +217,17 @@ class find_one_and_delete { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; private: - stdx::optional _collation; + 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; + stdx::optional _projection; + stdx::optional _ordering; + stdx::optional _write_concern; + stdx::optional _hint; + stdx::optional _let; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace-fwd.hpp index fe14b4c2ee..ed2dd73483 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API find_one_and_replace; @@ -26,4 +26,12 @@ class MONGOCXX_API find_one_and_replace; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::find_one_and_replace; + +} // namespace options +} // namespace mongocxx + #include 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 ce43e9ea57..b4975973b3 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 @@ -30,7 +30,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -49,7 +49,7 @@ class find_one_and_replace { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_replace& collation(bsoncxx::document::view_or_value collation); + find_one_and_replace& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -59,7 +59,7 @@ class find_one_and_replace { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Whether or not to bypass document validation for this operation. @@ -101,14 +101,14 @@ class find_one_and_replace { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_replace& hint(mongocxx::hint index_hint); + find_one_and_replace& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -120,7 +120,7 @@ class find_one_and_replace { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_replace& let(bsoncxx::document::view_or_value let); + find_one_and_replace& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -128,7 +128,7 @@ class find_one_and_replace { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -140,7 +140,7 @@ class find_one_and_replace { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_replace& comment(bsoncxx::types::bson_value::view_or_value comment); + find_one_and_replace& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -148,7 +148,7 @@ class find_one_and_replace { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; /// /// Sets the maximum amount of time for this operation to run (server-side) in milliseconds. @@ -185,7 +185,7 @@ class find_one_and_replace { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_replace& projection(bsoncxx::document::view_or_value projection); + find_one_and_replace& projection(bsoncxx::v_noabi::document::view_or_value projection); /// /// Gets the current projection for this operation. @@ -194,7 +194,7 @@ class find_one_and_replace { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& projection() const; + const stdx::optional& projection() const; /// /// Set the desired version of the replaced document to return, either the original @@ -208,7 +208,7 @@ class find_one_and_replace { /// method chaining. /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ - /// @see mongocxx::options::return_document + /// @see mongocxx::v_noabi::options::return_document /// find_one_and_replace& return_document(return_document return_document); @@ -218,9 +218,9 @@ class find_one_and_replace { /// @return Version of document to return, either original or replacement. /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ - /// @see mongocxx::options::return_document + /// @see mongocxx::v_noabi::options::return_document /// - const stdx::optional& return_document() const; + const stdx::optional& return_document() const; /// /// Sets the order by which to search the collection for a matching document. @@ -237,7 +237,7 @@ class find_one_and_replace { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_replace& sort(bsoncxx::document::view_or_value ordering); + find_one_and_replace& sort(bsoncxx::v_noabi::document::view_or_value ordering); /// /// Gets the current sort ordering. @@ -246,7 +246,7 @@ class find_one_and_replace { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& sort() const; + const stdx::optional& sort() const; /// /// Sets the upsert flag on the operation. When @c true, the operation creates a new document if @@ -286,7 +286,7 @@ class find_one_and_replace { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_replace& write_concern(mongocxx::write_concern write_concern); + find_one_and_replace& write_concern(mongocxx::v_noabi::write_concern write_concern); /// /// Gets the current write concern. @@ -297,20 +297,20 @@ class find_one_and_replace { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& write_concern() const; + const 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 _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 _projection; + stdx::optional _return_document; + stdx::optional _ordering; stdx::optional _upsert; - stdx::optional _write_concern; + stdx::optional _write_concern; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update-fwd.hpp index 9376e6e240..76851421f1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API find_one_and_update; @@ -26,4 +26,12 @@ class MONGOCXX_API find_one_and_update; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::find_one_and_update; + +} // namespace options +} // namespace mongocxx + #include 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 f89ac58d4f..a6aeaecab0 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 @@ -31,7 +31,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -50,7 +50,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_update& collation(bsoncxx::document::view_or_value collation); + find_one_and_update& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -60,7 +60,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Whether or not to bypass document validation for this operation. @@ -103,14 +103,14 @@ class find_one_and_update { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_update& hint(mongocxx::hint index_hint); + find_one_and_update& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -122,7 +122,7 @@ class find_one_and_update { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_update& let(bsoncxx::document::view_or_value let); + find_one_and_update& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -130,7 +130,7 @@ class find_one_and_update { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -142,7 +142,7 @@ class find_one_and_update { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - find_one_and_update& comment(bsoncxx::types::bson_value::view_or_value comment); + find_one_and_update& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -150,7 +150,7 @@ class find_one_and_update { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; /// /// Sets the maximum amount of time for this operation to run (server-side) in milliseconds. @@ -187,7 +187,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_update& projection(bsoncxx::document::view_or_value projection); + find_one_and_update& projection(bsoncxx::v_noabi::document::view_or_value projection); /// /// Gets the current projection for this operation. @@ -196,7 +196,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& projection() const; + const stdx::optional& projection() const; /// /// Set the desired version of the updated document to return, either the original @@ -210,7 +210,7 @@ class find_one_and_update { /// method chaining. /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ - /// @see mongocxx::options::return_document + /// @see mongocxx::v_noabi::options::return_document /// find_one_and_update& return_document(return_document return_document); @@ -220,9 +220,9 @@ class find_one_and_update { /// @return Version of document to return, either original or updated. /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ - /// @see mongocxx::options::return_document + /// @see mongocxx::v_noabi::options::return_document /// - const stdx::optional& return_document() const; + const stdx::optional& return_document() const; /// /// Sets the order by which to search the collection for a matching document. @@ -239,7 +239,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_update& sort(bsoncxx::document::view_or_value ordering); + find_one_and_update& sort(bsoncxx::v_noabi::document::view_or_value ordering); /// /// Gets the current sort ordering. @@ -248,7 +248,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& sort() const; + const stdx::optional& sort() const; /// /// Sets the upsert flag on the operation. When @c true, the operation creates a new document if @@ -288,7 +288,7 @@ class find_one_and_update { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_update& write_concern(mongocxx::write_concern write_concern); + find_one_and_update& write_concern(mongocxx::v_noabi::write_concern write_concern); /// /// Gets the current write concern. @@ -299,7 +299,7 @@ class find_one_and_update { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Set array filters for this operation. @@ -313,7 +313,7 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - find_one_and_update& array_filters(bsoncxx::array::view_or_value array_filters); + find_one_and_update& array_filters(bsoncxx::v_noabi::array::view_or_value array_filters); /// /// Get array filters for this operation. @@ -323,21 +323,21 @@ class find_one_and_update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const stdx::optional& array_filters() const; + const 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 _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 _projection; + stdx::optional _return_document; + stdx::optional _ordering; stdx::optional _upsert; - stdx::optional _write_concern; - stdx::optional _array_filters; + stdx::optional _write_concern; + stdx::optional _array_filters; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options-fwd.hpp index b6c71296eb..916cb397c4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { enum class return_document; @@ -26,4 +26,12 @@ enum class return_document; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::return_document; + +} // namespace options +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options.hpp index bc196e0628..cf1ddbefaf 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options.hpp @@ -19,7 +19,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket-fwd.hpp index 3666468b6d..102eb187d9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/bucket-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { namespace gridfs { @@ -28,4 +28,14 @@ class MONGOCXX_API bucket; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { +namespace gridfs { + +using ::mongocxx::v_noabi::options::gridfs::bucket; + +} // namespace gridfs +} // namespace options +} // namespace mongocxx + #include 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 cf098a77ed..cde3de683d 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 @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { namespace gridfs { @@ -88,7 +88,7 @@ class bucket { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - bucket& read_concern(mongocxx::read_concern read_concern); + bucket& read_concern(mongocxx::v_noabi::read_concern read_concern); /// /// Gets the read concern of the bucket. @@ -96,7 +96,7 @@ class bucket { /// @return /// The read concern of the bucket. /// - const stdx::optional& read_concern() const; + const stdx::optional& read_concern() const; /// /// Sets the read preference to be used when reading from the GridFS bucket. Defaults to the @@ -115,7 +115,7 @@ class bucket { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - bucket& read_preference(mongocxx::read_preference read_preference); + bucket& read_preference(mongocxx::v_noabi::read_preference read_preference); /// /// Gets the read preference of the bucket. @@ -123,7 +123,7 @@ class bucket { /// @return /// The read preference of the bucket. /// - const stdx::optional& read_preference() const; + const stdx::optional& read_preference() const; /// /// Sets the write concern to be used when writing to the GridFS bucket. Defaults to the write @@ -136,7 +136,7 @@ class bucket { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - bucket& write_concern(mongocxx::write_concern write_concern); + bucket& write_concern(mongocxx::v_noabi::write_concern write_concern); /// /// Gets the write concern of the bucket. @@ -144,14 +144,14 @@ class bucket { /// @return /// The write concern of the bucket. /// - const stdx::optional& write_concern() const; + const 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; + stdx::optional _read_concern; + stdx::optional _read_preference; + stdx::optional _write_concern; }; } // namespace gridfs diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload-fwd.hpp index e3499689e0..dd33362226 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/gridfs/upload-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { namespace gridfs { @@ -28,4 +28,14 @@ class MONGOCXX_API upload; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { +namespace gridfs { + +using ::mongocxx::v_noabi::options::gridfs::upload; + +} // namespace gridfs +} // namespace options +} // namespace mongocxx + #include 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 818e678732..0de7c4cbe3 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 @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { namespace gridfs { @@ -64,7 +64,7 @@ class upload { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - upload& metadata(bsoncxx::document::view_or_value metadata); + upload& metadata(bsoncxx::v_noabi::document::view_or_value metadata); /// /// Gets the metadata of the GridFS file being uploaded. @@ -72,11 +72,11 @@ class upload { /// @return /// The metadata document of the GridFS file. /// - const stdx::optional& metadata() const; + const stdx::optional& metadata() const; private: stdx::optional _chunk_size_bytes; - stdx::optional _metadata; + stdx::optional _metadata; }; } // namespace gridfs diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index-fwd.hpp index b5a06929e0..181978d966 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API index; @@ -26,4 +26,12 @@ class MONGOCXX_API index; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::index; + +} // namespace options +} // namespace mongocxx + #include 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 d07d44776c..709368f8c1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index.hpp @@ -30,7 +30,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -66,21 +66,21 @@ class index { /// @param config_string /// The WiredTiger configuration string. /// - void config_string(bsoncxx::string::view_or_value config_string); + void config_string(bsoncxx::v_noabi::string::view_or_value config_string); /// /// The current config_string setting. /// /// @return The current config_string. /// - const stdx::optional& config_string() const; + const stdx::optional& config_string() const; private: friend ::mongocxx::v_noabi::collection; MONGOCXX_PRIVATE int type() const override; - stdx::optional _config_string; + stdx::optional _config_string; }; index(); @@ -161,14 +161,14 @@ class index { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - index& name(bsoncxx::string::view_or_value name); + index& name(bsoncxx::v_noabi::string::view_or_value name); /// /// The current name setting. /// /// @return The current name. /// - const stdx::optional& name() const; + const stdx::optional& name() const; /// /// Sets the collation for this index. @@ -183,7 +183,7 @@ class index { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - index& collation(bsoncxx::document::view collation); + index& collation(bsoncxx::v_noabi::document::view collation); /// /// Retrieves the current collation for this index. @@ -194,7 +194,7 @@ class index { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Whether or not to create a sparse index. Sparse indexes only reference documents with the @@ -292,14 +292,14 @@ class index { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - index& weights(bsoncxx::document::view weights); + index& weights(bsoncxx::v_noabi::document::view weights); /// /// The current weights setting. /// /// @return The current weights. /// - const stdx::optional& weights() const; + const stdx::optional& weights() const; /// /// For text indexes, the language that determines the list of stop words and the rules for the @@ -312,14 +312,14 @@ class index { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - index& default_language(bsoncxx::string::view_or_value default_language); + index& default_language(bsoncxx::v_noabi::string::view_or_value default_language); /// /// The current default_language setting. /// /// @return The current default_language. /// - const stdx::optional& default_language() const; + const stdx::optional& default_language() const; /// /// For text indexes, the name of the field, in the collection’s documents, that contains the @@ -332,14 +332,14 @@ class index { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - index& language_override(bsoncxx::string::view_or_value language_override); + index& language_override(bsoncxx::v_noabi::string::view_or_value language_override); /// /// The current name of the field that contains the override language for text indexes. /// /// @return The name of the field that contains the override language for text indexes. /// - const stdx::optional& language_override() const; + const stdx::optional& language_override() const; /// /// Sets the document for the partial filter expression for partial indexes. @@ -351,14 +351,14 @@ class index { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - index& partial_filter_expression(bsoncxx::document::view partial_filter_expression); + index& partial_filter_expression(bsoncxx::v_noabi::document::view partial_filter_expression); /// /// The current partial_filter_expression setting. /// /// @return The current partial_filter_expression. /// - const stdx::optional& partial_filter_expression() const; + const stdx::optional& partial_filter_expression() const; /// /// For 2dsphere indexes, the 2dsphere index version number. Version can be either 1 or 2. @@ -470,11 +470,12 @@ class index { /// /// Conversion operator that provides a view of the options in document form. /// - /// @exception mongocxx::logic_error if an invalid expireAfterSeconds field is provided. + /// @exception mongocxx::v_noabi::logic_error if an invalid expireAfterSeconds field is + /// provided. /// /// @return A view of the current builder contents. /// - operator bsoncxx::document::view_or_value(); + operator bsoncxx::v_noabi::document::view_or_value(); private: friend ::mongocxx::v_noabi::collection; @@ -482,16 +483,16 @@ class index { stdx::optional _background; stdx::optional _unique; stdx::optional _hidden; - stdx::optional _name; - stdx::optional _collation; + stdx::optional _name; + stdx::optional _collation; 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 _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; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view-fwd.hpp index 534172d4e1..4ced86a1c2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/index_view-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API index_view; @@ -26,4 +26,12 @@ class MONGOCXX_API index_view; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::index_view; + +} // namespace options +} // namespace mongocxx + #include 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 55865188ef..ae768ce465 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -58,7 +58,7 @@ class index_view { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const bsoncxx::stdx::optional& max_time() const; + const bsoncxx::v_noabi::stdx::optional& max_time() const; /// /// Sets the write concern for this operation. @@ -73,7 +73,7 @@ class index_view { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - index_view& write_concern(mongocxx::write_concern write_concern); + index_view& write_concern(mongocxx::v_noabi::write_concern write_concern); /// /// Gets the current write concern. @@ -84,7 +84,7 @@ class index_view { /// @see /// https://www.mongodb.com/docs/manual/reference/command/findAndModify/ /// - const bsoncxx::stdx::optional& write_concern() const; + const bsoncxx::v_noabi::stdx::optional& write_concern() const; /// /// Sets the commit quorum for this operation. @@ -135,12 +135,12 @@ class index_view { /// @see /// https://www.mongodb.com/docs/manual/reference/command/createIndexes /// - const stdx::optional commit_quorum() const; + const stdx::optional commit_quorum() const; private: - bsoncxx::stdx::optional _max_time; - bsoncxx::stdx::optional _write_concern; - bsoncxx::stdx::optional _commit_quorum; + bsoncxx::v_noabi::stdx::optional _max_time; + bsoncxx::v_noabi::stdx::optional _write_concern; + bsoncxx::v_noabi::stdx::optional _commit_quorum; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert-fwd.hpp index 7e030374d8..789f7c142d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API insert; @@ -26,4 +26,12 @@ class MONGOCXX_API insert; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::insert; + +} // namespace options +} // namespace mongocxx + #include 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 d8c4c50d06..9f62038a03 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/insert.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -69,7 +69,7 @@ class insert { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - insert& write_concern(mongocxx::write_concern wc); + insert& write_concern(mongocxx::v_noabi::write_concern wc); /// /// The current write_concern for this operation. @@ -78,7 +78,7 @@ class insert { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// @note: This applies only to insert_many and is ignored for insert_one. @@ -120,7 +120,7 @@ class insert { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - insert& comment(bsoncxx::types::bson_value::view_or_value comment); + insert& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// The current comment for this operation. @@ -129,13 +129,13 @@ class insert { /// /// @see https://www.mongodb.com/docs/manual/reference/command/insert/ /// - const stdx::optional& comment() const; + const stdx::optional& comment() const; private: - stdx::optional _write_concern; + stdx::optional _write_concern; stdx::optional _ordered; stdx::optional _bypass_document_validation; - stdx::optional _comment; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool-fwd.hpp index f0977a5223..ecf396f348 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API pool; @@ -26,4 +26,12 @@ class MONGOCXX_API pool; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::pool; + +} // namespace options +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool.hpp index b31de38c88..41435e287c 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/pool.hpp @@ -21,7 +21,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range-fwd.hpp index 93aa63258e..a5f12d1158 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API range; @@ -26,4 +26,12 @@ class MONGOCXX_API range; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::range; + +} // namespace options +} // namespace mongocxx + #include 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 968c423a5e..6bdecede35 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/range.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -44,19 +44,19 @@ class range { public: /// @brief Sets `RangeOpts.min`. /// @note Required if @ref precision is set. - range& min(bsoncxx::types::bson_value::view_or_value value); + range& min(bsoncxx::v_noabi::types::bson_value::view_or_value value); /// @brief Gets `RangeOpts.min`. /// @note Required if @ref precision is set. - const stdx::optional& min() const; + const stdx::optional& min() const; /// @brief Sets `RangeOpts.max`. /// @note Required if @ref precision is set. - range& max(bsoncxx::types::bson_value::view_or_value value); + range& max(bsoncxx::v_noabi::types::bson_value::view_or_value value); /// @brief Gets `RangeOpts.max`. /// @note Required if @ref precision is set. - const stdx::optional& max() const; + const stdx::optional& max() const; /// @brief Sets `RangeOpts.sparsity`. range& sparsity(std::int64_t value); @@ -73,8 +73,8 @@ class range { const stdx::optional& precision() const; private: - stdx::optional _min; - stdx::optional _max; + stdx::optional _min; + stdx::optional _max; stdx::optional _sparsity; stdx::optional _precision; }; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace-fwd.hpp index 17a7b17954..88ceaa2e08 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API replace; @@ -26,4 +26,12 @@ class MONGOCXX_API replace; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::replace; + +} // namespace options +} // namespace mongocxx + #include 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 50dc3b3bde..265b674df6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/replace.hpp @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -72,7 +72,7 @@ class replace { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - replace& collation(bsoncxx::document::view_or_value collation); + replace& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -83,7 +83,7 @@ class replace { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the upsert option. @@ -122,7 +122,7 @@ class replace { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - replace& write_concern(mongocxx::write_concern wc); + replace& write_concern(mongocxx::v_noabi::write_concern wc); /// /// The current write_concern for this operation. @@ -132,7 +132,7 @@ class replace { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Sets the index to use for this operation. @@ -147,14 +147,14 @@ class replace { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - replace& hint(mongocxx::hint index_hint); + replace& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -166,7 +166,7 @@ class replace { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - replace& let(bsoncxx::document::view_or_value let); + replace& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -174,7 +174,7 @@ class replace { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -186,7 +186,7 @@ class replace { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - replace& comment(bsoncxx::types::bson_value::view_or_value comment); + replace& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -194,16 +194,16 @@ class replace { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; private: stdx::optional _bypass_document_validation; - stdx::optional _collation; + stdx::optional _collation; stdx::optional _upsert; - stdx::optional _write_concern; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + stdx::optional _write_concern; + stdx::optional _hint; + stdx::optional _let; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey-fwd.hpp index 62bb61c557..e7eb5619a0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/rewrap_many_datakey-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API rewrap_many_datakey; @@ -26,4 +26,12 @@ class MONGOCXX_API rewrap_many_datakey; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::rewrap_many_datakey; + +} // namespace options +} // namespace mongocxx + #include 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 a7c4810183..ee6c3946f3 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 @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -50,7 +50,7 @@ class rewrap_many_datakey { /// @see /// https://www.mongodb.com/docs/manual/core/csfle/reference/kms-providers/#std-label-csfle-reference-kms-providers /// - rewrap_many_datakey& provider(bsoncxx::string::view_or_value provider); + rewrap_many_datakey& provider(bsoncxx::v_noabi::string::view_or_value provider); /// /// Get the KMS provider @@ -65,7 +65,7 @@ class rewrap_many_datakey { /// @see /// https://www.mongodb.com/docs/manual/core/csfle/reference/kms-providers/#std-label-csfle-reference-kms-providers /// - bsoncxx::string::view_or_value provider() const; + bsoncxx::v_noabi::string::view_or_value provider() const; /// /// Set the masterKey option. @@ -82,7 +82,7 @@ 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 /// - rewrap_many_datakey& master_key(bsoncxx::document::view_or_value master_key); + rewrap_many_datakey& master_key(bsoncxx::v_noabi::document::view_or_value master_key); /// /// Get the masterKey option. @@ -97,13 +97,13 @@ 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 /// - const stdx::optional& master_key() const; + const stdx::optional& master_key() const; private: friend ::mongocxx::v_noabi::client_encryption; - bsoncxx::string::view_or_value _provider; - stdx::optional _master_key; + bsoncxx::v_noabi::string::view_or_value _provider; + stdx::optional _master_key; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api-fwd.hpp index 396a9c2275..7f723584ae 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/server_api-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API server_api; @@ -26,4 +26,12 @@ class MONGOCXX_API server_api; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::server_api; + +} // namespace options +} // namespace mongocxx + #include 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 10932dcb62..ebafa18ded 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 @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -59,7 +59,7 @@ class server_api { /// @param version /// The enum value to convert to a string. /// - /// @throws mongocxx::logic_error on an invalid argument + /// @throws mongocxx::v_noabi::logic_error on an invalid argument /// /// @return /// The string value of the given enum value. @@ -72,7 +72,7 @@ class server_api { /// @param version /// The string to convert to an enum value. /// - /// @throws mongocxx::logic_error on an invalid argument + /// @throws mongocxx::v_noabi::logic_error on an invalid argument /// /// @return /// The enum value of the given string. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/ssl.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/ssl.hpp index 568b4ab885..e1f393c68f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/ssl.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/ssl.hpp @@ -21,7 +21,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls-fwd.hpp index cac0e9d7b5..02a5fdb2d9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API tls; @@ -26,4 +26,12 @@ class MONGOCXX_API tls; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::tls; + +} // namespace options +} // namespace mongocxx + #include 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 64e87076c9..0a470985f9 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/tls.hpp @@ -25,7 +25,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -44,14 +44,14 @@ class tls { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - tls& pem_file(bsoncxx::string::view_or_value pem_file); + tls& pem_file(bsoncxx::v_noabi::string::view_or_value pem_file); /// /// Retrieves the current path to the .pem file. /// /// @return The path to the .pem file. /// - const stdx::optional& pem_file() const; + const stdx::optional& pem_file() const; /// /// The pass phrase used to decrypt an encrypted PEM file. @@ -63,14 +63,14 @@ class tls { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - tls& pem_password(bsoncxx::string::view_or_value pem_password); + tls& pem_password(bsoncxx::v_noabi::string::view_or_value pem_password); /// /// Retrieves the current decryption pass phrase. /// /// @return The pass phrase. /// - const stdx::optional& pem_password() const; + const stdx::optional& pem_password() const; /// /// The path to the .pem file that contains the root certificate chain from the Certificate @@ -83,14 +83,14 @@ class tls { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - tls& ca_file(bsoncxx::string::view_or_value ca_file); + tls& ca_file(bsoncxx::v_noabi::string::view_or_value ca_file); /// /// Retrieves the current path to the CA file. /// /// @return The path to the CA file. /// - const stdx::optional& ca_file() const; + const stdx::optional& ca_file() const; /// /// The path to the Certificate Authority directory. @@ -102,14 +102,14 @@ class tls { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - tls& ca_dir(bsoncxx::string::view_or_value ca_dir); + tls& ca_dir(bsoncxx::v_noabi::string::view_or_value ca_dir); /// /// Retrieves the current path to the CA directory. /// /// @return The path to the CA directory. /// - const stdx::optional& ca_dir() const; + const stdx::optional& ca_dir() const; /// /// The path to the .pem file that contains revoked certificates. @@ -121,14 +121,14 @@ class tls { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - tls& crl_file(bsoncxx::string::view_or_value crl_file); + tls& crl_file(bsoncxx::v_noabi::string::view_or_value crl_file); /// /// Retrieves the current path to the .pem file that contains revoked certificates. /// /// @return The path to the revoked certificates file. /// - const stdx::optional& crl_file() const; + const stdx::optional& crl_file() const; /// /// If true, the driver will not verify the server's CA file. @@ -150,11 +150,11 @@ class tls { const 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 _pem_file; + stdx::optional _pem_password; + stdx::optional _ca_file; + stdx::optional _ca_dir; + stdx::optional _crl_file; stdx::optional _allow_invalid_certificates; }; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction-fwd.hpp index 5d3964669b..917cfc2b13 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API transaction; @@ -26,4 +26,12 @@ class MONGOCXX_API transaction; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::transaction; + +} // namespace options +} // namespace mongocxx + #include 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 4528bcdd7c..f2b2e4885e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/transaction.hpp @@ -29,7 +29,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -74,7 +74,7 @@ class transaction { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - transaction& read_concern(const mongocxx::read_concern& rc); + transaction& read_concern(const mongocxx::v_noabi::read_concern& rc); /// /// Gets the current transaction read concern. @@ -82,7 +82,7 @@ class transaction { /// @return /// An optional containing the read concern. If the read concern has not been set, a /// disengaged optional is returned. - stdx::optional read_concern() const; + stdx::optional read_concern() const; /// /// Sets the transaction write concern. @@ -94,7 +94,7 @@ class transaction { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - transaction& write_concern(const mongocxx::write_concern& wc); + transaction& write_concern(const mongocxx::v_noabi::write_concern& wc); /// /// Gets the current transaction write concern. @@ -104,7 +104,7 @@ class transaction { /// @return /// An optional containing the write concern. If the write concern has not been set, a /// disengaged optional is returned. - stdx::optional write_concern() const; + stdx::optional write_concern() const; /// /// Sets the transaction read preference. @@ -116,7 +116,7 @@ class transaction { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - transaction& read_preference(const mongocxx::read_preference& rp); + transaction& read_preference(const mongocxx::v_noabi::read_preference& rp); /// /// Gets the current transaction read preference. @@ -124,7 +124,7 @@ class transaction { /// @return /// An optional containing the read preference. If the read preference has not been set, a /// disengaged optional is returned. - stdx::optional read_preference() const; + stdx::optional read_preference() const; /// /// Sets the transaction's max commit time, in milliseconds. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update-fwd.hpp index 037c35db16..5b5a23034d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class MONGOCXX_API update; @@ -26,4 +26,12 @@ class MONGOCXX_API update; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace options { + +using ::mongocxx::v_noabi::options::update; + +} // namespace options +} // namespace mongocxx + #include 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 cd1ef2efd2..e790cb2b9c 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/update.hpp @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { /// @@ -72,7 +72,7 @@ class update { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - update& collation(bsoncxx::document::view_or_value collation); + update& collation(bsoncxx::v_noabi::document::view_or_value collation); /// /// Retrieves the current collation for this operation. @@ -83,7 +83,7 @@ class update { /// @see /// https://www.mongodb.com/docs/manual/reference/collation/ /// - const stdx::optional& collation() const; + const stdx::optional& collation() const; /// /// Sets the index to use for this operation. @@ -98,14 +98,14 @@ class update { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - update& hint(mongocxx::hint index_hint); + update& hint(mongocxx::v_noabi::hint index_hint); /// /// Gets the current hint. /// /// @return The current hint, if one is set. /// - const stdx::optional& hint() const; + const stdx::optional& hint() const; /// /// Set the value of the let option. @@ -117,7 +117,7 @@ class update { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - update& let(bsoncxx::document::view_or_value let); + update& let(bsoncxx::v_noabi::document::view_or_value let); /// /// Gets the current value of the let option. @@ -125,7 +125,7 @@ class update { /// @return /// The current let option. /// - const stdx::optional let() const; + const stdx::optional let() const; /// /// Set the value of the comment option. @@ -137,7 +137,7 @@ class update { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - update& comment(bsoncxx::types::bson_value::view_or_value comment); + update& comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment); /// /// Gets the current value of the comment option. @@ -145,7 +145,7 @@ class update { /// @return /// The current comment option. /// - const stdx::optional comment() const; + const stdx::optional comment() const; /// /// Sets the upsert option. @@ -184,7 +184,7 @@ class update { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - update& write_concern(mongocxx::write_concern wc); + update& write_concern(mongocxx::v_noabi::write_concern wc); /// /// The current write_concern for this operation. @@ -194,7 +194,7 @@ class update { /// /// @see https://www.mongodb.com/docs/manual/core/write-concern/ /// - const stdx::optional& write_concern() const; + const stdx::optional& write_concern() const; /// /// Set array filters for this operation. @@ -208,7 +208,7 @@ class update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - update& array_filters(bsoncxx::array::view_or_value array_filters); + update& array_filters(bsoncxx::v_noabi::array::view_or_value array_filters); /// /// Get array filters for this operation. @@ -218,17 +218,17 @@ class update { /// /// @see https://www.mongodb.com/docs/manual/reference/command/update/ /// - const stdx::optional& array_filters() const; + const stdx::optional& array_filters() const; private: stdx::optional _bypass_document_validation; - stdx::optional _collation; + stdx::optional _collation; stdx::optional _upsert; - stdx::optional _write_concern; - stdx::optional _array_filters; - stdx::optional _hint; - stdx::optional _let; - stdx::optional _comment; + stdx::optional _write_concern; + stdx::optional _array_filters; + stdx::optional _hint; + stdx::optional _let; + stdx::optional _comment; }; } // namespace options diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline-fwd.hpp index 8cab87d0cb..82d54b3622 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API pipeline; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API pipeline; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::pipeline; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline.hpp index 0d6b9b102e..95612086a8 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pipeline.hpp @@ -31,7 +31,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a MongoDB aggregation pipeline. /// @@ -73,7 +74,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& add_fields(bsoncxx::document::view_or_value fields_to_add); + pipeline& add_fields(bsoncxx::v_noabi::document::view_or_value fields_to_add); /// /// Categorizes documents into groups, called buckets, based on a specified expression and @@ -89,7 +90,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& bucket(bsoncxx::document::view_or_value bucket_args); + pipeline& bucket(bsoncxx::v_noabi::document::view_or_value bucket_args); /// /// Categorizes documents into a specific number of groups, called buckets, based on a @@ -106,7 +107,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& bucket_auto(bsoncxx::document::view_or_value bucket_auto_args); + pipeline& bucket_auto(bsoncxx::v_noabi::document::view_or_value bucket_auto_args); /// /// Returns statistics regarding a collection or view. @@ -121,8 +122,8 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& coll_stats( - bsoncxx::document::view_or_value coll_stats_args = bsoncxx::document::view{}); + pipeline& coll_stats(bsoncxx::v_noabi::document::view_or_value coll_stats_args = + bsoncxx::v_noabi::document::view{}); /// /// Returns a document containing a count of the number of documents input to the stage. @@ -153,7 +154,7 @@ class pipeline { /// @return /// A reference to the object on which this method is being called. /// - pipeline& current_op(bsoncxx::document::view_or_value current_op_args); + pipeline& current_op(bsoncxx::v_noabi::document::view_or_value current_op_args); /// /// Processes multiple aggregation pipelines within a single stage on the same set of input @@ -169,7 +170,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& facet(bsoncxx::document::view_or_value facet_args); + pipeline& facet(bsoncxx::v_noabi::document::view_or_value facet_args); /// /// Appends a stage to this pipeline object. @@ -186,7 +187,7 @@ class pipeline { /// @return /// A reference to this object on which this member function is being called. /// - pipeline& append_stage(bsoncxx::document::view_or_value stage); + pipeline& append_stage(bsoncxx::v_noabi::document::view_or_value stage); /// /// Appends stages to this pipeline object from the given bson array. @@ -203,7 +204,7 @@ class pipeline { /// @return /// A reference to the object on which this member function is being called. /// - pipeline& append_stages(bsoncxx::array::view_or_value stages); + pipeline& append_stages(bsoncxx::v_noabi::array::view_or_value stages); /// /// Outputs documents in order of nearest to farthest from a specified point. @@ -218,7 +219,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& geo_near(bsoncxx::document::view_or_value geo_near_args); + pipeline& geo_near(bsoncxx::v_noabi::document::view_or_value geo_near_args); /// /// Performs a recursive search on a collection. @@ -233,7 +234,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& graph_lookup(bsoncxx::document::view_or_value graph_lookup_args); + pipeline& graph_lookup(bsoncxx::v_noabi::document::view_or_value graph_lookup_args); /// /// Groups documents by some specified expression and outputs to the next stage a @@ -253,7 +254,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& group(bsoncxx::document::view_or_value group_args); + pipeline& group(bsoncxx::v_noabi::document::view_or_value group_args); /// /// Returns statistics regarding the use of each index for the collection. @@ -293,7 +294,8 @@ class pipeline { /// @return /// A reference to the object on which this method is being called. /// - pipeline& list_local_sessions(bsoncxx::document::view_or_value list_local_sessions_args); + pipeline& list_local_sessions( + bsoncxx::v_noabi::document::view_or_value list_local_sessions_args); /// /// Lists all sessions stored in the system.sessions collection in the config database. @@ -307,7 +309,7 @@ class pipeline { /// @return /// A reference to the object on which this method is being called. /// - pipeline& list_sessions(bsoncxx::document::view_or_value list_sessions_args); + pipeline& list_sessions(bsoncxx::v_noabi::document::view_or_value list_sessions_args); /// /// Performs a left outer join to an unsharded collection in the same database to filter in @@ -323,7 +325,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& lookup(bsoncxx::document::view_or_value lookup_args); + pipeline& lookup(bsoncxx::v_noabi::document::view_or_value lookup_args); /// /// Filters the documents. Only the documents that match the condition(s) specified by the @@ -338,7 +340,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& match(bsoncxx::document::view_or_value filter); + pipeline& match(bsoncxx::v_noabi::document::view_or_value filter); /// /// Outputs the aggregation results to a collection. @@ -353,7 +355,7 @@ class pipeline { /// @return /// A reference to the object on which this member function is being called. /// - pipeline& merge(bsoncxx::document::view_or_value merge_args); + pipeline& merge(bsoncxx::v_noabi::document::view_or_value merge_args); /// /// Takes documents returned by the aggregation pipeline and writes them to a specified @@ -383,7 +385,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& project(bsoncxx::document::view_or_value projection); + pipeline& project(bsoncxx::v_noabi::document::view_or_value projection); /// /// Restricts the contents of the documents based on information stored in the documents @@ -398,7 +400,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& redact(bsoncxx::document::view_or_value restrictions); + pipeline& redact(bsoncxx::v_noabi::document::view_or_value restrictions); /// /// Promotes a specified document to the top level and replaces all other fields. @@ -413,7 +415,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& replace_root(bsoncxx::document::view_or_value replace_root_args); + pipeline& replace_root(bsoncxx::v_noabi::document::view_or_value replace_root_args); /// /// Randomly selects the specified number of documents that pass into the stage and passes the @@ -457,7 +459,7 @@ class pipeline { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - pipeline& sort(bsoncxx::document::view_or_value ordering); + pipeline& sort(bsoncxx::v_noabi::document::view_or_value ordering); /// /// Groups incoming documents based on the value of a specified expression, then computes the @@ -476,7 +478,7 @@ class pipeline { /// This overload of sort_by_count() is intended to be used when the desired sort is over a /// grouping of the result of a complex expression computed from the input documents. /// - pipeline& sort_by_count(bsoncxx::document::view_or_value field_expression); + pipeline& sort_by_count(bsoncxx::v_noabi::document::view_or_value field_expression); /// /// Groups incoming documents based on the value of a specified expression, then computes the @@ -516,7 +518,7 @@ class pipeline { /// This overload of unwind() is intended to be used when additional options other than the /// field name need to be specified. /// - pipeline& unwind(bsoncxx::document::view_or_value unwind_args); + pipeline& unwind(bsoncxx::v_noabi::document::view_or_value unwind_args); /// /// Deconstructs an array field from the input documents to output a document for each element. @@ -541,7 +543,7 @@ class pipeline { /// /// @return A view of the underlying BSON array this pipeline represents. /// - bsoncxx::array::view view_array() const; + bsoncxx::v_noabi::array::view view_array() const; private: friend ::mongocxx::v_noabi::client; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool-fwd.hpp index b7d2cb21a7..1ada98aae3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API pool; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API pool; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::pool; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp index 2ba9864286..86515b7ee7 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/pool.hpp @@ -29,7 +29,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// A pool of @c client objects associated with a MongoDB deployment. /// @@ -55,9 +56,10 @@ class pool { /// @param options /// Options to use when connecting to the MongoDB deployment. /// - /// @throws mongocxx::exception if invalid options are provided (whether from the URI or + /// @throws mongocxx::v_noabi::exception if invalid options are provided (whether from the URI + /// or /// provided client options). - explicit pool(const uri& mongodb_uri = mongocxx::uri(), + explicit pool(const uri& mongodb_uri = mongocxx::v_noabi::uri(), const options::pool& options = options::pool()); /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern-fwd.hpp index bbd71bb048..e30353d7dd 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API read_concern; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API read_concern; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::read_concern; + } // namespace mongocxx #include 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 8cf7f0e5d3..321331934b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp @@ -32,7 +32,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// A class to represent the read concern. Read concern can be set at the client, database, or /// collection level. The read concern can also be provided via connection string, and will be @@ -110,7 +111,7 @@ class read_concern { /// Either k_local, k_majority, k_linearizable, or k_server_default. /// /// @throws - /// mongocxx::exception if rc_level is not k_local, k_majority, k_linearizable, or + /// mongocxx::v_noabi::exception if rc_level is not k_local, k_majority, k_linearizable, or /// k_server_default. /// void acknowledge_level(level rc_level); @@ -152,7 +153,7 @@ class read_concern { /// @return /// Document representation of this read_concern. /// - bsoncxx::document::value to_document() const; + bsoncxx::v_noabi::document::value to_document() const; private: friend ::mongocxx::v_noabi::client; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference-fwd.hpp index 7dfba9544a..4afbc3a7bf 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API read_preference; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API read_preference; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::read_preference; + } // namespace mongocxx #include 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 800d447c0b..fa317b7a9a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp @@ -37,7 +37,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a preference for how the driver routes read operations to members of a /// replica set or to a sharded cluster. @@ -129,8 +130,9 @@ class read_preference { /// /// @deprecated The tags() method should be used instead. /// - MONGOCXX_DEPRECATED read_preference(read_mode mode, bsoncxx::document::view_or_value tags); - read_preference(read_mode mode, bsoncxx::document::view_or_value tags, deprecated_tag); + MONGOCXX_DEPRECATED read_preference(read_mode mode, + bsoncxx::v_noabi::document::view_or_value tags); + read_preference(read_mode mode, bsoncxx::v_noabi::document::view_or_value tags, deprecated_tag); /// /// Copy constructs a read_preference. @@ -188,7 +190,7 @@ class read_preference { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - read_preference& tags(bsoncxx::document::view_or_value tag_set_list); + read_preference& tags(bsoncxx::v_noabi::document::view_or_value tag_set_list); /// /// Sets or updates the tag set list for this read_preference. @@ -202,7 +204,7 @@ class read_preference { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - read_preference& tags(bsoncxx::array::view_or_value tag_set_list); + read_preference& tags(bsoncxx::v_noabi::array::view_or_value tag_set_list); /// /// Sets or updates the tag set list for this read_preference. @@ -211,7 +213,7 @@ class read_preference { /// /// @see https://www.mongodb.com/docs/manual/core/read-preference-tags/ /// - stdx::optional tags() const; + stdx::optional tags() const; /// /// Sets the max staleness setting for this read_preference. Secondary @@ -241,7 +243,7 @@ class read_preference { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - /// @throws mongocxx::logic_error if the argument is invalid. + /// @throws mongocxx::v_noabi::logic_error if the argument is invalid. /// read_preference& max_staleness(std::chrono::seconds max_staleness); @@ -270,14 +272,14 @@ class read_preference { /// @return A reference to the object on which this member function is being called. This /// facilitates method chaining. /// - read_preference& hedge(bsoncxx::document::view_or_value hedge); + read_preference& hedge(bsoncxx::v_noabi::document::view_or_value hedge); /// /// Gets the current hedge document to be used for the read preference. /// /// @return A hedge document if one was set. /// - const stdx::optional hedge() const; + const stdx::optional hedge() const; private: friend ::mongocxx::v_noabi::client; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write-fwd.hpp index 9d130c1141..9f1a6be770 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API bulk_write; @@ -26,4 +26,12 @@ class MONGOCXX_API bulk_write; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::bulk_write; + +} // namespace result +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write.hpp index f44d380b09..d14c896a2b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/bulk_write.hpp @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// @@ -35,10 +35,10 @@ namespace result { /// class bulk_write { public: - using id_map = std::map; + using id_map = std::map; // This constructor is public for testing purposes only - explicit bulk_write(bsoncxx::document::value raw_response); + explicit bulk_write(bsoncxx::v_noabi::document::value raw_response); /// /// Gets the number of documents that were inserted during this operation. @@ -86,9 +86,9 @@ class bulk_write { id_map upserted_ids() const; private: - MONGOCXX_PRIVATE bsoncxx::document::view view() const; + MONGOCXX_PRIVATE bsoncxx::v_noabi::document::view view() const; - bsoncxx::document::value _response; + bsoncxx::v_noabi::document::value _response; friend MONGOCXX_API bool MONGOCXX_CALL operator==(const bulk_write&, const bulk_write&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const bulk_write&, const bulk_write&); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete-fwd.hpp index 865ab085be..a24df6598d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API delete_result; @@ -26,4 +26,12 @@ class MONGOCXX_API delete_result; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::delete_result; + +} // namespace result +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete.hpp index e204dc0620..71d15ef052 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/delete.hpp @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload-fwd.hpp index 19f16ec758..e24c5cdf68 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { namespace gridfs { @@ -28,4 +28,14 @@ class MONGOCXX_API upload; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { +namespace gridfs { + +using ::mongocxx::v_noabi::result::gridfs::upload; + +} // namespace gridfs +} // namespace result +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload.hpp index 1f1d2720c4..7ea2841fe3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/gridfs/upload.hpp @@ -22,29 +22,29 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { namespace gridfs { /// Class representing the result of a GridFS upload operation. class upload { public: - upload(bsoncxx::types::bson_value::view id); + upload(bsoncxx::v_noabi::types::bson_value::view id); /// /// Gets the id of the uploaded GridFS file. /// /// @return The id of the uploaded file. /// - const bsoncxx::types::bson_value::view& id() const; + const bsoncxx::v_noabi::types::bson_value::view& id() const; private: // Array with a single element, containing the value of the _id field for the inserted files // collection document. - bsoncxx::array::value _id_owned; + bsoncxx::v_noabi::array::value _id_owned; // Points into _id_owned. - bsoncxx::types::bson_value::view _id; + bsoncxx::v_noabi::types::bson_value::view _id; friend MONGOCXX_API bool MONGOCXX_CALL operator==(const upload&, const upload&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const upload&, const upload&); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many-fwd.hpp index 0a4cb654b9..9fe1dfbf82 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API insert_many; @@ -26,4 +26,12 @@ class MONGOCXX_API insert_many; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::insert_many; + +} // namespace result +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many.hpp index 4ffb88c5a5..525e14133d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_many.hpp @@ -27,7 +27,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// @@ -36,9 +36,9 @@ namespace result { /// class insert_many { public: - using id_map = std::map; + using id_map = std::map; - insert_many(result::bulk_write result, bsoncxx::array::value inserted_ids); + insert_many(result::bulk_write result, bsoncxx::v_noabi::array::value inserted_ids); insert_many(const insert_many&); insert_many(insert_many&&) = default; @@ -79,7 +79,7 @@ class insert_many { // Array containing documents with the values of the _id field for the inserted documents. This // array is in the following format: [{"_id": ...}, {"_id": ...}, ...]. - bsoncxx::array::value _inserted_ids_owned; + bsoncxx::v_noabi::array::value _inserted_ids_owned; // Points into _inserted_ids_owned. id_map _inserted_ids; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one-fwd.hpp index 1deb2ba729..04ac181b75 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API insert_one; @@ -26,4 +26,12 @@ class MONGOCXX_API insert_one; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::insert_one; + +} // namespace result +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one.hpp index 9a562e289b..a855f14be6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/insert_one.hpp @@ -24,14 +24,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// Class representing the result of a MongoDB insert operation. class insert_one { public: // This constructor is public for testing purposes only - insert_one(result::bulk_write result, bsoncxx::types::bson_value::view inserted_id); + insert_one(result::bulk_write result, bsoncxx::v_noabi::types::bson_value::view inserted_id); /// /// Returns the bulk write result for this insert operation. @@ -45,16 +45,16 @@ class insert_one { /// /// @return The value of the _id field for the inserted document. /// - const bsoncxx::types::bson_value::view& inserted_id() const; + const bsoncxx::v_noabi::types::bson_value::view& inserted_id() const; private: result::bulk_write _result; // Array with a single element, containing the value of the _id field for the inserted document. - bsoncxx::array::value _inserted_id_owned; + bsoncxx::v_noabi::array::value _inserted_id_owned; // Points into _inserted_id_owned. - bsoncxx::types::bson_value::view _inserted_id; + bsoncxx::v_noabi::types::bson_value::view _inserted_id; friend MONGOCXX_API bool MONGOCXX_CALL operator==(const insert_one&, const insert_one&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const insert_one&, const insert_one&); diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one-fwd.hpp index e7271785d5..110b043e3f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/replace_one-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API replace_one; @@ -26,4 +26,12 @@ class MONGOCXX_API replace_one; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::replace_one; + +} // namespace result +} // namespace mongocxx + #include 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 d14528870c..6ecc4af91d 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 @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// Class representing the result of a MongoDB replace_one operation. @@ -61,7 +61,7 @@ class replace_one { /// /// @return The value of the _id field for upserted document. /// - stdx::optional upserted_id() const; + stdx::optional upserted_id() const; private: result::bulk_write _result; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey-fwd.hpp index 865d188c25..b1cd5b5358 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API rewrap_many_datakey; @@ -26,4 +26,12 @@ class MONGOCXX_API rewrap_many_datakey; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::rewrap_many_datakey; + +} // namespace result +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.hpp index fae4967605..b0a4a809b3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.hpp @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// Class representing the result of a MongoDB rewrap_many_datakey operation. @@ -31,17 +31,17 @@ class rewrap_many_datakey { public: rewrap_many_datakey() = default; - explicit rewrap_many_datakey(mongocxx::result::bulk_write bulk_write_result_doc); + explicit rewrap_many_datakey(mongocxx::v_noabi::result::bulk_write bulk_write_result_doc); /// /// Returns the bulk write result for this rewrap_many_datakey operation. /// /// @return The raw bulk write result. /// - const bsoncxx::stdx::optional& result(); + const bsoncxx::v_noabi::stdx::optional& result(); private: - bsoncxx::stdx::optional _result; + bsoncxx::v_noabi::stdx::optional _result; }; } // namespace result diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update-fwd.hpp index 15f5a2ca02..3af54a7863 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update-fwd.hpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { class MONGOCXX_API update; @@ -26,4 +26,12 @@ class MONGOCXX_API update; } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { +namespace result { + +using ::mongocxx::v_noabi::result::update; + +} // namespace result +} // namespace mongocxx + #include 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 4c4dda1289..6880f8cf0f 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/result/update.hpp @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { /// Class representing the result of a MongoDB update operation. @@ -66,7 +66,7 @@ class update { /// /// @return The value of the _id field for upserted document. /// - stdx::optional upserted_id() const; + stdx::optional upserted_id() const; private: result::bulk_write _result; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model-fwd.hpp index 5f5b80de28..f44937f2d0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API search_index_model; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API search_index_model; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::search_index_model; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model.hpp index 5852836892..7d6e8b1c2d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_model.hpp @@ -12,18 +12,19 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a search index on a MongoDB server. /// class search_index_model { public: /// - /// Initializes a new search_index_model over a mongocxx::collection. + /// Initializes a new search_index_model over a mongocxx::v_noabi::collection. /// - search_index_model(bsoncxx::document::view_or_value definition); - search_index_model(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition); + search_index_model(bsoncxx::v_noabi::document::view_or_value definition); + search_index_model(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition); search_index_model() = delete; @@ -55,12 +56,12 @@ class search_index_model { /// /// Retrieves name of a search_index_model. /// - bsoncxx::stdx::optional name() const; + bsoncxx::v_noabi::stdx::optional name() const; /// /// Retrieves definition of a search_index_model. /// - bsoncxx::document::view definition() const; + bsoncxx::v_noabi::document::view definition() const; private: class MONGOCXX_PRIVATE impl; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view-fwd.hpp index 77839c4cf0..8203a02d8c 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API search_index_view; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API search_index_view; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::search_index_view; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp index cc59725705..9f2d989607 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp @@ -15,7 +15,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a MongoDB search index view. /// @@ -45,7 +46,7 @@ class search_index_view { /// Returns a cursor over all the search indexes. /// /// @param session - /// The mongocxx::client_session with which to perform the list operation. + /// The mongocxx::v_noabi::client_session with which to perform the list operation. /// @param options /// Options included in the aggregate operation. /// @@ -64,14 +65,14 @@ class search_index_view { /// /// @return A cursor to the list of the search indexes returned. /// - cursor list(bsoncxx::string::view_or_value name, + cursor list(bsoncxx::v_noabi::string::view_or_value name, const options::aggregate& options = options::aggregate()); /// /// Returns a cursor over all the search indexes. /// /// @param session - /// The mongocxx::client_session with which to perform the list operation. + /// The mongocxx::v_noabi::client_session with which to perform the list operation. /// @param name /// The name of the search index to find. /// @param options @@ -80,7 +81,7 @@ class search_index_view { /// @return A cursor to the list of the search indexes returned. /// cursor list(const client_session& session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::aggregate& options = options::aggregate()); /// @@ -97,20 +98,20 @@ class search_index_view { /// /// @return The name of the created search index. /// - std::string create_one(bsoncxx::document::view_or_value definition); + std::string create_one(bsoncxx::v_noabi::document::view_or_value definition); /// /// This is a convenience method for creating a single search index with a default name. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param definition /// The document describing the search index to be created. /// /// @return The name of the created search index. /// std::string create_one(const client_session& session, - bsoncxx::document::view_or_value definition); + bsoncxx::v_noabi::document::view_or_value definition); /// /// This is a convenience method for creating a single search index. @@ -122,14 +123,14 @@ class search_index_view { /// /// @return The name of the created search index. /// - std::string create_one(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition); + std::string create_one(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition); /// /// This is a convenience method for creating a single search index. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param name /// The name of the search index to create. /// @param definition @@ -138,8 +139,8 @@ class search_index_view { /// @return The name of the created search index. /// std::string create_one(const client_session& session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition); + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition); /// /// This is a convenience method for creating a single search index. @@ -155,7 +156,7 @@ class search_index_view { /// This is a convenience method for creating a single search index. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param model /// The search index model to create. /// @@ -183,7 +184,7 @@ class search_index_view { /// Creates multiple search indexes in the collection. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param models /// The search index models to create. /// @@ -204,17 +205,17 @@ class search_index_view { /// @param name /// The name of the search index to drop. /// - void drop_one(bsoncxx::string::view_or_value name); + void drop_one(bsoncxx::v_noabi::string::view_or_value name); /// /// Drops a single search index from the collection by the index name. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param name /// The name of the search index to drop. /// - void drop_one(const client_session& session, bsoncxx::string::view_or_value name); + void drop_one(const client_session& session, bsoncxx::v_noabi::string::view_or_value name); /// /// @} @@ -230,22 +231,22 @@ class search_index_view { /// @param definition /// The definition to update the search index to. /// - void update_one(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition); + void update_one(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition); /// /// Updates a single search index from the collection by the search index name. /// /// @param session - /// The mongocxx::client_session with which to perform the operation. + /// The mongocxx::v_noabi::client_session with which to perform the operation. /// @param name /// The name of the search index to update. /// @param definition /// The definition to update the search index to. /// void update_one(const client_session& session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition); + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition); /// /// @} @@ -259,7 +260,7 @@ class search_index_view { MONGOCXX_PRIVATE search_index_view(void* coll, void* client); MONGOCXX_PRIVATE std::vector _create_many_helper( - bsoncxx::array::view created_indexes); + bsoncxx::v_noabi::array::view created_indexes); MONGOCXX_PRIVATE const impl& _get_impl() const; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp index a87ba483c0..9a042fd117 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/stdx.hpp @@ -16,20 +16,29 @@ #include -// "Forward-declare" the `bsoncxx::stdx` namespace to permit the using-declaration below. +// "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 { -inline namespace v_noabi { +namespace v_noabi { namespace stdx { -// We adopt all the bsoncxx polyfills -using namespace bsoncxx::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 diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri-fwd.hpp index 9f0e27dca0..7378f5d085 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API uri; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API uri; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::uri; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp index 7033af3f1f..ee95899e41 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/uri.hpp @@ -31,7 +31,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing a MongoDB connection string URI. /// @@ -65,7 +66,7 @@ class uri { /// @param uri_string /// String representing a MongoDB connection string URI, defaults to k_default_uri. /// - uri(bsoncxx::string::view_or_value uri_string = k_default_uri); + uri(bsoncxx::v_noabi::string::view_or_value uri_string = k_default_uri); /// /// Move constructs a uri. @@ -119,7 +120,7 @@ class uri { /// /// @return A document view containing other options. /// - bsoncxx::document::view options() const; + bsoncxx::v_noabi::document::view options() const; /// /// Returns the password from the uri. @@ -133,14 +134,14 @@ class uri { /// /// @return A read_concern that represents what was specified in the uri. /// - mongocxx::read_concern read_concern() const; + mongocxx::v_noabi::read_concern read_concern() const; /// /// Returns the read preference from the uri. /// /// @return A read_preference that represents what was specified in the uri. /// - mongocxx::read_preference read_preference() const; + mongocxx::v_noabi::read_preference read_preference() const; /// /// Returns the replica set specified in the uri. @@ -184,7 +185,7 @@ class uri { /// /// @return A write_concern that represents what was specified in the uri. /// - mongocxx::write_concern write_concern() const; + mongocxx::v_noabi::write_concern write_concern() const; /// /// Returns the value of the option "appname" if present in the uri. @@ -196,16 +197,16 @@ class uri { /// /// Returns the value of the option "authMechanismProperties" if present in the uri. /// - /// @return An optional bsoncxx::document::view + /// @return An optional bsoncxx::v_noabi::document::view /// - stdx::optional auth_mechanism_properties() const; + stdx::optional auth_mechanism_properties() const; /// /// Returns the value of the option credentials if present in the uri. /// - /// @return An optional bsoncxx::document::view + /// @return An optional bsoncxx::v_noabi::document::view /// - stdx::optional credentials(); + stdx::optional credentials(); /// /// Returns the value of the option "srvMaxHosts" if present in the uri. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria-fwd.hpp index ab8169ad88..493b60cd91 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API validation_criteria; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API validation_criteria; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::validation_criteria; + } // namespace mongocxx #include 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 ccd37cca23..66f41a1fc1 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp @@ -23,7 +23,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing criteria for document validation, to be applied to a collection. /// @@ -41,7 +42,7 @@ class validation_criteria { /// A reference to the object on which this member function is being called. This facilitates /// method chaining. /// - validation_criteria& rule(bsoncxx::document::view_or_value rule); + validation_criteria& rule(bsoncxx::v_noabi::document::view_or_value rule); /// /// Gets the validation rule for this validation object. @@ -49,7 +50,7 @@ class validation_criteria { /// @return /// Document representing a validation rule. /// - const stdx::optional& rule() const; + const stdx::optional& rule() const; /// /// A class to represent the different validation level options. @@ -127,18 +128,18 @@ class validation_criteria { /// /// @return Validation criteria, as a document. /// - MONGOCXX_DEPRECATED bsoncxx::document::value to_document() const; - bsoncxx::document::value to_document_deprecated() const; + MONGOCXX_DEPRECATED bsoncxx::v_noabi::document::value to_document() const; + bsoncxx::v_noabi::document::value to_document_deprecated() const; /// /// @deprecated /// This method is deprecated. To determine which options are set on this object, use the /// provided accessors instead. /// - MONGOCXX_DEPRECATED MONGOCXX_INLINE operator bsoncxx::document::value() const; + MONGOCXX_DEPRECATED MONGOCXX_INLINE operator bsoncxx::v_noabi::document::value() const; private: - stdx::optional _rule; + stdx::optional _rule; stdx::optional _level; stdx::optional _action; }; @@ -148,11 +149,18 @@ MONGOCXX_API bool MONGOCXX_CALL operator==(const validation_criteria& lhs, MONGOCXX_API bool MONGOCXX_CALL operator!=(const validation_criteria& lhs, const validation_criteria& rhs); -MONGOCXX_INLINE validation_criteria::operator bsoncxx::document::value() const { +MONGOCXX_INLINE validation_criteria::operator bsoncxx::v_noabi::document::value() const { return to_document_deprecated(); } } // namespace v_noabi } // namespace mongocxx +namespace mongocxx { + +using ::mongocxx::v_noabi::operator==; +using ::mongocxx::v_noabi::operator!=; + +} // namespace mongocxx + #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern-fwd.hpp index e18d468a9b..4a127ea08e 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { class MONGOCXX_API write_concern; } // namespace v_noabi +namespace v_noabi { + +class MONGOCXX_API write_concern; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::write_concern; + } // namespace mongocxx #include 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 fc847871f5..a4d2387a03 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp @@ -36,7 +36,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Class representing the server-side requirement for reporting the success of a write /// operation. The strength of the write concern setting determines the level of guarantees @@ -139,7 +140,8 @@ class write_concern { /// pre-5.0 servers. /// /// @exception - /// Throws mongocxx::exception for setting a tag acknowledge level. Use tag() instead. + /// Throws mongocxx::v_noabi::exception for setting a tag acknowledge level. Use tag() + /// instead. /// void acknowledge_level(level confirm_level); @@ -151,7 +153,7 @@ class write_concern { /// The amount of time to wait before the write operation times out if it cannot reach /// the majority of nodes in the replica set. If the value is zero, then no timeout is set. /// - /// @throws mongocxx::logic_error for an invalid timeout value. + /// @throws mongocxx::v_noabi::logic_error for an invalid timeout value. /// void majority(std::chrono::milliseconds timeout); @@ -174,7 +176,7 @@ class write_concern { /// The timeout (in milliseconds) for this write concern. If the value is zero, then no /// timeout is set. /// - /// @throws mongocxx::logic_error for an invalid timeout value. + /// @throws mongocxx::v_noabi::logic_error for an invalid timeout value. /// void timeout(std::chrono::milliseconds timeout); @@ -240,7 +242,7 @@ class write_concern { /// @return /// Document representation of this write_concern. /// - bsoncxx::document::value to_document() const; + bsoncxx::v_noabi::document::value to_document() const; private: friend ::mongocxx::v_noabi::bulk_write; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type-fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type-fwd.hpp index cafdaf904d..bba86832bf 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type-fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type-fwd.hpp @@ -17,7 +17,17 @@ #include namespace mongocxx { -inline namespace v_noabi { enum class write_type; } // namespace v_noabi +namespace v_noabi { + +enum class write_type; + +} // namespace v_noabi +} // namespace mongocxx + +namespace mongocxx { + +using ::mongocxx::v_noabi::write_type; + } // namespace mongocxx #include diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type.hpp index 2dddaafdc9..da96159402 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_type.hpp @@ -19,7 +19,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + /// /// Enum representing the the types of write operations that can be performed. /// 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 19f7ea9182..99f52a597b 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp @@ -30,9 +30,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + using namespace libbson; -using bsoncxx::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::kvp; bulk_write::bulk_write(bulk_write&&) noexcept = default; bulk_write& bulk_write::operator=(bulk_write&&) noexcept = default; @@ -55,7 +56,7 @@ bulk_write& bulk_write::append(const model::write& operation) { scoped_bson_t filter(operation.get_update_one().filter()); scoped_bson_t update(operation.get_update_one().update()); - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (const auto collation = operation.get_update_one().collation()) { options_builder.append(kvp("collation", *collation)); } @@ -82,7 +83,7 @@ bulk_write& bulk_write::append(const model::write& operation) { scoped_bson_t filter(operation.get_update_many().filter()); scoped_bson_t update(operation.get_update_many().update()); - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (const auto collation = operation.get_update_many().collation()) { options_builder.append(kvp("collation", *collation)); } @@ -108,7 +109,7 @@ bulk_write& bulk_write::append(const model::write& operation) { case write_type::k_delete_one: { scoped_bson_t filter(operation.get_delete_one().filter()); - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (const auto collation = operation.get_delete_one().collation()) { options_builder.append(kvp("collation", *collation)); } @@ -128,7 +129,7 @@ bulk_write& bulk_write::append(const model::write& operation) { case write_type::k_delete_many: { scoped_bson_t filter(operation.get_delete_many().filter()); - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (const auto collation = operation.get_delete_many().collation()) { options_builder.append(kvp("collation", *collation)); } @@ -149,7 +150,7 @@ bulk_write& bulk_write::append(const model::write& operation) { scoped_bson_t filter(operation.get_replace_one().filter()); scoped_bson_t replace(operation.get_replace_one().replacement()); - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (const auto collation = operation.get_replace_one().collation()) { options_builder.append(kvp("collation", *collation)); } @@ -197,7 +198,7 @@ bulk_write::bulk_write(const collection& coll, const options::bulk_write& options, const client_session* session) : _created_from_collection{true} { - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (!options.ordered()) { // ordered is true by default. Only append it if set to false. options_builder.append(kvp("ordered", false)); @@ -213,7 +214,7 @@ bulk_write::bulk_write(const collection& coll, } if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t bson_options(options_builder.extract()); 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 3da974b41a..449e44387e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp @@ -22,7 +22,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + // Requirements for concept Iterator: // https://en.cppreference.com/w/cpp/named_req/Iterator static_assert(std::is_copy_constructible::value, ""); @@ -53,7 +54,7 @@ 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 { +stdx::optional change_stream::get_resume_token() const { return _impl->get_resume_token(); } @@ -64,11 +65,11 @@ change_stream::change_stream(void* change_stream_ptr) change_stream::iterator::iterator() : change_stream::iterator::iterator{iter_type::k_default_constructed, nullptr} {} -const bsoncxx::document::view& change_stream::iterator::operator*() const { +const bsoncxx::v_noabi::document::view& change_stream::iterator::operator*() const { return _change_stream->_impl->doc(); } -const bsoncxx::document::view* change_stream::iterator::operator->() const { +const bsoncxx::v_noabi::document::view* change_stream::iterator::operator->() const { return std::addressof(_change_stream->_impl->doc()); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp index 5ce52f726b..a38e0d28a8 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp @@ -35,9 +35,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + using namespace libbson; -using bsoncxx::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::kvp; namespace { class database_names { @@ -70,7 +71,7 @@ class database_names { client::client() noexcept = default; -client::client(const mongocxx::uri& uri, const options::client& options) { +client::client(const mongocxx::v_noabi::uri& uri, const options::client& options) { #if defined(MONGOCXX_ENABLE_SSL) && defined(MONGOC_ENABLE_SSL) if (options.tls_opts()) { if (!uri.tls()) @@ -149,56 +150,56 @@ client::operator bool() const noexcept { return static_cast(_impl); } -void client::read_concern_deprecated(mongocxx::read_concern rc) { +void client::read_concern_deprecated(mongocxx::v_noabi::read_concern rc) { auto client_t = _get_impl().client_t; libmongoc::client_set_read_concern(client_t, rc._impl->read_concern_t); } -void client::read_concern(mongocxx::read_concern rc) { +void client::read_concern(mongocxx::v_noabi::read_concern rc) { return read_concern_deprecated(std::move(rc)); } -mongocxx::read_concern client::read_concern() const { +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))}; } -void client::read_preference_deprecated(mongocxx::read_preference rp) { +void client::read_preference_deprecated(mongocxx::v_noabi::read_preference rp) { libmongoc::client_set_read_prefs(_get_impl().client_t, rp._impl->read_preference_t); } -void client::read_preference(mongocxx::read_preference rp) { +void client::read_preference(mongocxx::v_noabi::read_preference rp) { return read_preference_deprecated(std::move(rp)); } -mongocxx::read_preference client::read_preference() const { - mongocxx::read_preference rp(stdx::make_unique( +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)))); return rp; } -mongocxx::uri client::uri() const { - mongocxx::uri connection_string(stdx::make_unique( +mongocxx::v_noabi::uri client::uri() const { + mongocxx::v_noabi::uri connection_string(stdx::make_unique( libmongoc::uri_copy(libmongoc::client_get_uri(_get_impl().client_t)))); return connection_string; } -void client::write_concern_deprecated(mongocxx::write_concern wc) { +void client::write_concern_deprecated(mongocxx::v_noabi::write_concern wc) { libmongoc::client_set_write_concern(_get_impl().client_t, wc._impl->write_concern_t); } -void client::write_concern(mongocxx::write_concern wc) { +void client::write_concern(mongocxx::v_noabi::write_concern wc) { return write_concern_deprecated(std::move(wc)); } -mongocxx::write_concern client::write_concern() const { - mongocxx::write_concern wc(stdx::make_unique( +mongocxx::v_noabi::write_concern client::write_concern() const { + mongocxx::v_noabi::write_concern wc(stdx::make_unique( libmongoc::write_concern_copy(libmongoc::client_get_write_concern(_get_impl().client_t)))); return wc; } -mongocxx::database client::database(bsoncxx::string::view_or_value name) const& { - return mongocxx::database(*this, std::move(name)); +mongocxx::v_noabi::database client::database(bsoncxx::v_noabi::string::view_or_value name) const& { + return mongocxx::v_noabi::database(*this, std::move(name)); } cursor client::list_databases() const { @@ -206,29 +207,31 @@ cursor client::list_databases() const { } cursor client::list_databases(const client_session& session) const { - bsoncxx::builder::basic::document options_doc; - options_doc.append(bsoncxx::builder::concatenate_doc{session._get_impl().to_document()}); + bsoncxx::v_noabi::builder::basic::document options_doc; + options_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session._get_impl().to_document()}); scoped_bson_t options_bson(options_doc.extract()); return libmongoc::client_find_databases_with_opts(_get_impl().client_t, options_bson.bson()); } -cursor client::list_databases(const bsoncxx::document::view_or_value opts) const { +cursor client::list_databases(const bsoncxx::v_noabi::document::view_or_value opts) const { scoped_bson_t opts_bson{opts.view()}; return libmongoc::client_find_databases_with_opts(_get_impl().client_t, opts_bson.bson()); } cursor client::list_databases(const client_session& session, - const bsoncxx::document::view_or_value opts) const { - bsoncxx::builder::basic::document options_doc; - options_doc.append(bsoncxx::builder::concatenate_doc{session._get_impl().to_document()}); - options_doc.append(bsoncxx::builder::concatenate_doc{opts}); - mongocxx::scoped_bson_t opts_bson(options_doc.extract()); + const bsoncxx::v_noabi::document::view_or_value opts) const { + bsoncxx::v_noabi::builder::basic::document options_doc; + options_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session._get_impl().to_document()}); + options_doc.append(bsoncxx::v_noabi::builder::concatenate_doc{opts}); + mongocxx::libbson::scoped_bson_t opts_bson(options_doc.extract()); return libmongoc::client_find_databases_with_opts(_get_impl().client_t, opts_bson.bson()); } std::vector client::list_database_names( - bsoncxx::document::view_or_value filter) const { - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::document::view_or_value filter) const { + bsoncxx::v_noabi::builder::basic::document options_builder; options_builder.append(kvp("filter", filter)); @@ -251,13 +254,14 @@ std::vector client::list_database_names( } std::vector client::list_database_names( - const client_session& session, const bsoncxx::document::view_or_value filter) const { - bsoncxx::builder::basic::document options_builder; + const client_session& session, const bsoncxx::v_noabi::document::view_or_value filter) const { + bsoncxx::v_noabi::builder::basic::document options_builder; - options_builder.append(bsoncxx::builder::concatenate_doc{session._get_impl().to_document()}); + options_builder.append( + bsoncxx::v_noabi::builder::concatenate_doc{session._get_impl().to_document()}); options_builder.append(kvp("filter", filter)); - mongocxx::scoped_bson_t opts_bson(options_builder.extract()); + mongocxx::libbson::scoped_bson_t opts_bson(options_builder.extract()); bson_error_t error; const database_names names(libmongoc::client_get_database_names_with_opts( @@ -275,7 +279,8 @@ std::vector client::list_database_names( return res; } -mongocxx::client_session client::start_session(const mongocxx::options::client_session& options) { +mongocxx::v_noabi::client_session client::start_session( + const mongocxx::v_noabi::options::client_session& options) { return client_session(this, options); } @@ -304,15 +309,15 @@ change_stream client::watch(const client_session& session, change_stream client::_watch(const client_session* session, const pipeline& pipe, const options::change_stream& options) { - bsoncxx::builder::basic::document container; - container.append(bsoncxx::builder::basic::kvp("pipeline", pipe._impl->view_array())); + bsoncxx::v_noabi::builder::basic::document container; + container.append(bsoncxx::v_noabi::builder::basic::kvp("pipeline", pipe._impl->view_array())); scoped_bson_t pipeline_bson{container.view()}; - bsoncxx::builder::basic::document options_builder; - options_builder.append(bsoncxx::builder::concatenate(options.as_bson())); + bsoncxx::v_noabi::builder::basic::document options_builder; + options_builder.append(bsoncxx::v_noabi::builder::concatenate(options.as_bson())); if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson{options_builder.extract()}; 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 037b5a2abe..62291097dd 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp @@ -20,7 +20,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + using mongocxx::libbson::scoped_bson_t; client_encryption::client_encryption(options::client_encryption opts) @@ -30,68 +31,71 @@ client_encryption::~client_encryption() noexcept = default; client_encryption::client_encryption(client_encryption&&) = default; client_encryption& client_encryption::operator=(client_encryption&&) = default; -bsoncxx::types::bson_value::value client_encryption::create_data_key( +bsoncxx::v_noabi::types::bson_value::value client_encryption::create_data_key( std::string kms_provider, const options::data_key& opts) { return _impl->create_data_key(kms_provider, opts); } -bsoncxx::types::bson_value::value client_encryption::encrypt(bsoncxx::types::bson_value::view value, - const options::encrypt& opts) { +bsoncxx::v_noabi::types::bson_value::value client_encryption::encrypt( + bsoncxx::v_noabi::types::bson_value::view value, const options::encrypt& opts) { return _impl->encrypt(value, opts); } -bsoncxx::document::value client_encryption::encrypt_expression( - bsoncxx::document::view_or_value expr, const options::encrypt& opts) { +bsoncxx::v_noabi::document::value client_encryption::encrypt_expression( + bsoncxx::v_noabi::document::view_or_value expr, const options::encrypt& opts) { return _impl->encrypt_expression(expr, opts); } -bsoncxx::types::bson_value::value client_encryption::decrypt( - bsoncxx::types::bson_value::view value) { +bsoncxx::v_noabi::types::bson_value::value client_encryption::decrypt( + bsoncxx::v_noabi::types::bson_value::view value) { return _impl->decrypt(value); } collection client_encryption::create_encrypted_collection( const database& db, const std::string& coll_name, - const bsoncxx::document::view& options, - bsoncxx::document::value& out_options, + const bsoncxx::v_noabi::document::view& options, + bsoncxx::v_noabi::document::value& out_options, const std::string& kms_provider, - const stdx::optional& masterkey) { + const 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); } result::rewrap_many_datakey client_encryption::rewrap_many_datakey( - bsoncxx::document::view_or_value filter, const options::rewrap_many_datakey& opts) { + bsoncxx::v_noabi::document::view_or_value filter, const options::rewrap_many_datakey& opts) { return _impl->rewrap_many_datakey(filter, opts); } -result::delete_result client_encryption::delete_key(bsoncxx::types::bson_value::view_or_value id) { +result::delete_result client_encryption::delete_key( + bsoncxx::v_noabi::types::bson_value::view_or_value id) { return _impl->delete_key(id); } -stdx::optional client_encryption::get_key( - bsoncxx::types::bson_value::view_or_value id) { +stdx::optional client_encryption::get_key( + bsoncxx::v_noabi::types::bson_value::view_or_value id) { return _impl->get_key(id); } -mongocxx::cursor client_encryption::get_keys() { +mongocxx::v_noabi::cursor client_encryption::get_keys() { return _impl->get_keys(); } -stdx::optional client_encryption::add_key_alt_name( - bsoncxx::types::bson_value::view_or_value id, bsoncxx::string::view_or_value key_alt_name) { +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::string::view_or_value key_alt_name) { +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::types::bson_value::view_or_value id, bsoncxx::string::view_or_value 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) { 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 fe785192b4..f9a3ef789c 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp @@ -21,10 +21,11 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + // Private constructors. -client_session::client_session(const mongocxx::client* client, - const mongocxx::options::client_session& options) +client_session::client_session(const mongocxx::v_noabi::client* client, + const mongocxx::v_noabi::options::client_session& options) : _impl(stdx::make_unique(client, options)) {} client_session::client_session(client_session&&) noexcept = default; @@ -33,11 +34,11 @@ client_session& client_session::operator=(client_session&&) noexcept = default; client_session::~client_session() noexcept = default; -const mongocxx::client& client_session::client() const noexcept { +const mongocxx::v_noabi::client& client_session::client() const noexcept { return _impl->client(); } -const mongocxx::options::client_session& client_session::options() const noexcept { +const mongocxx::v_noabi::options::client_session& client_session::options() const noexcept { return _impl->options(); } @@ -45,23 +46,24 @@ std::uint32_t client_session::server_id() const noexcept { return _impl->server_id(); } -bsoncxx::document::view client_session::id() const noexcept { +bsoncxx::v_noabi::document::view client_session::id() const noexcept { return _impl->id(); } -bsoncxx::document::view client_session::cluster_time() const noexcept { +bsoncxx::v_noabi::document::view client_session::cluster_time() const noexcept { return _impl->cluster_time(); } -bsoncxx::types::b_timestamp client_session::operation_time() const noexcept { +bsoncxx::v_noabi::types::b_timestamp client_session::operation_time() const noexcept { return _impl->operation_time(); } -void client_session::advance_cluster_time(const bsoncxx::document::view& cluster_time) { +void client_session::advance_cluster_time(const bsoncxx::v_noabi::document::view& cluster_time) { _impl->advance_cluster_time(cluster_time); } -void client_session::advance_operation_time(const bsoncxx::types::b_timestamp& operation_time) { +void client_session::advance_operation_time( + const bsoncxx::v_noabi::types::b_timestamp& operation_time) { _impl->advance_operation_time(operation_time); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp index b4ca5c8007..951884fcaf 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp @@ -59,17 +59,17 @@ #include -using bsoncxx::builder::concatenate; -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::make_array; -using bsoncxx::builder::basic::make_document; -using bsoncxx::builder::basic::sub_array; -using bsoncxx::builder::basic::sub_document; -using bsoncxx::document::view_or_value; +using bsoncxx::v_noabi::builder::concatenate; +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::make_array; +using bsoncxx::v_noabi::builder::basic::make_document; +using bsoncxx::v_noabi::builder::basic::sub_array; +using bsoncxx::v_noabi::builder::basic::sub_document; +using bsoncxx::v_noabi::document::view_or_value; namespace { -using bsoncxx::stdx::make_unique; +using bsoncxx::v_noabi::stdx::make_unique; using mongocxx::libbson::scoped_bson_t; const char* get_collection_name(mongoc_collection_t* collection) { @@ -81,14 +81,14 @@ void destroy_fam_opts(mongoc_find_and_modify_opts_t* opts) { } template -mongocxx::stdx::optional find_and_modify( +mongocxx::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::stdx::optional array_filters, + mongocxx::v_noabi::stdx::optional array_filters, const T& options) { using unique_opts = std::unique_ptr find_and_modify( auto opts = unique_opts(mongocxx::libmongoc::find_and_modify_opts_new(), destroy_fam_opts); - bsoncxx::builder::basic::document extra; + bsoncxx::v_noabi::builder::basic::document extra; ::bson_error_t error; // Write concern, collation, and session are passed in "extra". if (const auto& wc = options.write_concern()) { if (!wc->is_acknowledged() && options.collation()) { - throw mongocxx::logic_error{mongocxx::error_code::k_invalid_parameter}; + throw mongocxx::v_noabi::logic_error{ + mongocxx::v_noabi::error_code::k_invalid_parameter}; } extra.append(kvp("writeConcern", wc->to_document())); } @@ -111,11 +112,12 @@ mongocxx::stdx::optional find_and_modify( bson_t bson = BSON_INITIALIZER; if (!mongocxx::libmongoc::client_session_append(session_t, &bson, &error)) { bson_destroy(&bson); - throw mongocxx::logic_error{mongocxx::error_code::k_invalid_session, error.message}; + throw mongocxx::v_noabi::logic_error{mongocxx::v_noabi::error_code::k_invalid_session, + error.message}; } // document::value takes ownership of the bson buffer. - bsoncxx::document::value session_id{bsoncxx::helpers::value_from_bson_t(&bson)}; + bsoncxx::v_noabi::document::value session_id{bsoncxx::helpers::value_from_bson_t(&bson)}; extra.append(concatenate(session_id.view())); } @@ -178,26 +180,28 @@ mongocxx::stdx::optional find_and_modify( if (!result) { if (!reply.view().empty()) { - mongocxx::throw_exception(reply.steal(), error); + mongocxx::v_noabi::throw_exception(reply.steal(), + error); } - mongocxx::throw_exception(error); + mongocxx::v_noabi::throw_exception(error); } - bsoncxx::document::view reply_view = reply.view(); + bsoncxx::v_noabi::document::view reply_view = reply.view(); const auto value = reply_view["value"]; - if (!value || value.type() == bsoncxx::type::k_null) { - return mongocxx::stdx::optional{}; + if (!value || value.type() == bsoncxx::v_noabi::type::k_null) { + return mongocxx::v_noabi::stdx::optional{}; } - return bsoncxx::document::value{reply_view["value"].get_document().view()}; + return bsoncxx::v_noabi::document::value{reply_view["value"].get_document().view()}; } } // namespace namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + using namespace libbson; collection::collection() noexcept = default; @@ -213,19 +217,21 @@ stdx::string_view collection::name() const { return {get_collection_name(_get_impl().collection_t)}; } -void collection::_rename(const client_session* session, - bsoncxx::string::view_or_value new_name, - bool drop_target_before_rename, - const bsoncxx::stdx::optional& wc) { +void collection::_rename( + const client_session* session, + bsoncxx::v_noabi::string::view_or_value new_name, + bool drop_target_before_rename, + const bsoncxx::v_noabi::stdx::optional& wc) { bson_error_t error; - bsoncxx::builder::basic::document opts_doc; + bsoncxx::v_noabi::builder::basic::document opts_doc; if (wc) { opts_doc.append(kvp("writeConcern", wc->to_document())); } if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t opts_bson{opts_doc.view()}; @@ -242,20 +248,23 @@ void collection::_rename(const client_session* session, } } -void collection::rename(bsoncxx::string::view_or_value new_name, - bool drop_target_before_rename, - const bsoncxx::stdx::optional& wc) { +void collection::rename( + bsoncxx::v_noabi::string::view_or_value new_name, + bool drop_target_before_rename, + const bsoncxx::v_noabi::stdx::optional& wc) { return _rename(nullptr, new_name, drop_target_before_rename, wc); } -void collection::rename(const client_session& session, - bsoncxx::string::view_or_value new_name, - bool drop_target_before_rename, - const bsoncxx::stdx::optional& wc) { +void collection::rename( + const client_session& session, + bsoncxx::v_noabi::string::view_or_value new_name, + bool drop_target_before_rename, + const bsoncxx::v_noabi::stdx::optional& wc) { return _rename(&session, new_name, drop_target_before_rename, wc); } -collection::collection(const database& database, bsoncxx::string::view_or_value collection_name) +collection::collection(const database& database, + bsoncxx::v_noabi::string::view_or_value collection_name) : _impl(stdx::make_unique( libmongoc::database_get_collection(database._get_impl().database_t, collection_name.terminated().data()), @@ -285,19 +294,20 @@ collection& collection::operator=(const collection& c) { return *this; } -mongocxx::bulk_write collection::create_bulk_write(const options::bulk_write& options) { - return mongocxx::bulk_write{*this, options}; +mongocxx::v_noabi::bulk_write collection::create_bulk_write(const options::bulk_write& options) { + return mongocxx::v_noabi::bulk_write{*this, options}; } -mongocxx::bulk_write collection::create_bulk_write(const client_session& session, - const options::bulk_write& options) { - return mongocxx::bulk_write{*this, options, &session}; +mongocxx::v_noabi::bulk_write collection::create_bulk_write(const client_session& session, + const options::bulk_write& options) { + return mongocxx::v_noabi::bulk_write{*this, options, &session}; } namespace { -bsoncxx::builder::basic::document build_find_options_document(const options::find& options) { - bsoncxx::builder::basic::document options_builder; +bsoncxx::v_noabi::builder::basic::document build_find_options_document( + const options::find& options) { + bsoncxx::v_noabi::builder::basic::document options_builder; if (const auto& adu = options.allow_disk_use()) { options_builder.append(kvp("allowDiskUse", *adu)); @@ -324,10 +334,10 @@ bsoncxx::builder::basic::document build_find_options_document(const options::fin if (const auto& cursor_type = options.cursor_type()) { if (*cursor_type == cursor::type::k_tailable) { - options_builder.append(kvp("tailable", bsoncxx::types::b_bool{true})); + options_builder.append(kvp("tailable", bsoncxx::v_noabi::types::b_bool{true})); } else if (*cursor_type == cursor::type::k_tailable_await) { - options_builder.append(kvp("tailable", bsoncxx::types::b_bool{true})); - options_builder.append(kvp("awaitData", bsoncxx::types::b_bool{true})); + options_builder.append(kvp("tailable", bsoncxx::v_noabi::types::b_bool{true})); + options_builder.append(kvp("awaitData", bsoncxx::v_noabi::types::b_bool{true})); } else if (*cursor_type == cursor::type::k_non_tailable) { } else { throw logic_error{error_code::k_invalid_parameter}; @@ -351,7 +361,8 @@ bsoncxx::builder::basic::document build_find_options_document(const options::fin } if (const auto& max_time = options.max_time()) { - options_builder.append(kvp("maxTimeMS", bsoncxx::types::b_int64{max_time->count()})); + options_builder.append( + kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{max_time->count()})); } if (const auto& min = options.min()) { @@ -363,7 +374,7 @@ bsoncxx::builder::basic::document build_find_options_document(const options::fin } if (const auto& projection = options.projection()) { - options_builder.append(kvp("projection", bsoncxx::types::b_document{*projection})); + options_builder.append(kvp("projection", bsoncxx::v_noabi::types::b_document{*projection})); } if (const auto& return_key = options.return_key()) { @@ -379,7 +390,7 @@ bsoncxx::builder::basic::document build_find_options_document(const options::fin } if (const auto& sort = options.sort()) { - options_builder.append(kvp("sort", bsoncxx::types::b_document{*sort})); + options_builder.append(kvp("sort", bsoncxx::v_noabi::types::b_document{*sort})); } return options_builder; @@ -397,10 +408,11 @@ cursor collection::_find(const client_session* session, rp_ptr = options.read_preference()->_impl->read_preference_t; } - bsoncxx::builder::basic::document options_builder{build_find_options_document(options)}; + bsoncxx::v_noabi::builder::basic::document options_builder{ + build_find_options_document(options)}; if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson{options_builder.extract()}; @@ -432,9 +444,8 @@ cursor collection::find(const client_session& session, return _find(&session, std::move(filter), options); } -stdx::optional collection::_find_one(const client_session* session, - view_or_value filter, - const options::find& options) { +stdx::optional collection::_find_one( + const client_session* session, view_or_value filter, const options::find& options) { options::find copy(options); copy.limit(1); cursor cursor = @@ -443,31 +454,31 @@ stdx::optional collection::_find_one(const client_sess if (it == cursor.end()) { return stdx::nullopt; } - return stdx::optional(bsoncxx::document::value{*it}); + return stdx::optional( + bsoncxx::v_noabi::document::value{*it}); } -stdx::optional collection::find_one(view_or_value filter, - const options::find& options) { +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(const client_session& session, - view_or_value filter, - const options::find& options) { +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); } cursor collection::_aggregate(const client_session* session, const pipeline& pipeline, const options::aggregate& options) { - scoped_bson_t stages(bsoncxx::document::view(pipeline._impl->view_array())); + scoped_bson_t stages(bsoncxx::v_noabi::document::view(pipeline._impl->view_array())); - bsoncxx::builder::basic::document b; + bsoncxx::v_noabi::builder::basic::document b; options.append(b); if (session) { - b.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + b.append(bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson(b.view()); @@ -518,12 +529,12 @@ stdx::optional collection::_insert_one(const client_session* bulk_opts.comment(*comment); } - mongocxx::bulk_write bulk_op{*this, bulk_opts, session}; - bsoncxx::document::element oid{}; - bsoncxx::builder::basic::document new_document; + mongocxx::v_noabi::bulk_write bulk_op{*this, bulk_opts, session}; + bsoncxx::v_noabi::document::element oid{}; + bsoncxx::v_noabi::builder::basic::document new_document; if (!document.view()["_id"]) { - new_document.append(kvp("_id", bsoncxx::oid())); + new_document.append(kvp("_id", bsoncxx::v_noabi::oid())); new_document.append(concatenate(document)); bulk_op.append(model::insert_one(new_document.view())); oid = new_document.view()["_id"]; @@ -680,13 +691,13 @@ stdx::optional collection::update_many(view_or_value filter, const pipeline& update, const options::update& options) { return _update_many( - nullptr, std::move(filter), bsoncxx::document::view(update.view_array()), options); + 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) { - return _update_many(nullptr, std::move(filter), bsoncxx::document::view{}, options); + return _update_many(nullptr, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } stdx::optional collection::update_many(const client_session& session, @@ -700,15 +711,17 @@ stdx::optional collection::update_many(const client_session& ses view_or_value filter, const pipeline& update, const options::update& options) { - return _update_many( - &session, std::move(filter), bsoncxx::document::view(update.view_array()), 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) { - return _update_many(&session, std::move(filter), bsoncxx::document::view{}, options); + return _update_many(&session, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } stdx::optional collection::_update_one(const client_session* session, @@ -773,13 +786,13 @@ stdx::optional collection::update_one(view_or_value filter, const pipeline& update, const options::update& options) { return _update_one( - nullptr, std::move(filter), bsoncxx::document::view(update.view_array()), options); + 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) { - return _update_one(nullptr, std::move(filter), bsoncxx::document::view{}, options); + return _update_one(nullptr, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } stdx::optional collection::update_one(const client_session& session, @@ -793,15 +806,17 @@ stdx::optional collection::update_one(const client_session& sess view_or_value filter, const pipeline& update, const options::update& options) { - return _update_one( - &session, std::move(filter), bsoncxx::document::view(update.view_array()), 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) { - return _update_one(&session, std::move(filter), bsoncxx::document::view{}, options); + return _update_one(&session, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } stdx::optional collection::_delete_many( @@ -900,7 +915,7 @@ stdx::optional collection::delete_one( return _delete_one(&session, std::move(filter), options); } -stdx::optional collection::_find_one_and_replace( +stdx::optional collection::_find_one_and_replace( const client_session* session, view_or_value filter, view_or_value replacement, @@ -924,12 +939,12 @@ stdx::optional collection::_find_one_and_replace( options); } -stdx::optional collection::find_one_and_replace( +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( +stdx::optional collection::find_one_and_replace( const client_session& session, view_or_value filter, view_or_value replacement, @@ -937,7 +952,7 @@ stdx::optional collection::find_one_and_replace( return _find_one_and_replace(&session, std::move(filter), replacement, options); } -stdx::optional collection::_find_one_and_update( +stdx::optional collection::_find_one_and_update( const client_session* session, view_or_value filter, view_or_value update, @@ -961,25 +976,26 @@ stdx::optional collection::_find_one_and_update( options); } -stdx::optional collection::find_one_and_update( +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( +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::document::view(update.view_array()), options); + nullptr, std::move(filter), bsoncxx::v_noabi::document::view(update.view_array()), options); } -stdx::optional collection::find_one_and_update( +stdx::optional collection::find_one_and_update( view_or_value filter, std::initializer_list<_empty_doc_tag>, const options::find_one_and_update& options) { - return _find_one_and_update(nullptr, std::move(filter), bsoncxx::document::view{}, options); + return _find_one_and_update( + nullptr, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::find_one_and_update( +stdx::optional collection::find_one_and_update( const client_session& session, view_or_value filter, view_or_value update, @@ -987,24 +1003,27 @@ stdx::optional collection::find_one_and_update( return _find_one_and_update(&session, std::move(filter), update, options); } -stdx::optional collection::find_one_and_update( +stdx::optional collection::find_one_and_update( const client_session& session, view_or_value filter, const pipeline& update, const options::find_one_and_update& options) { - return _find_one_and_update( - &session, std::move(filter), bsoncxx::document::view(update.view_array()), options); + return _find_one_and_update(&session, + std::move(filter), + bsoncxx::v_noabi::document::view(update.view_array()), + options); } -stdx::optional collection::find_one_and_update( +stdx::optional collection::find_one_and_update( const client_session& session, view_or_value filter, std::initializer_list<_empty_doc_tag>, const options::find_one_and_update& options) { - return _find_one_and_update(&session, std::move(filter), bsoncxx::document::view{}, options); + return _find_one_and_update( + &session, std::move(filter), bsoncxx::v_noabi::document::view{}, options); } -stdx::optional collection::_find_one_and_delete( +stdx::optional collection::_find_one_and_delete( const client_session* session, view_or_value filter, const options::find_one_and_delete& options) { @@ -1018,12 +1037,12 @@ stdx::optional collection::_find_one_and_delete( options); } -stdx::optional collection::find_one_and_delete( +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( +stdx::optional collection::find_one_and_delete( const client_session& session, view_or_value filter, const options::find_one_and_delete& options) { @@ -1042,14 +1061,14 @@ std::int64_t collection::_count_documents(const client_session* session, read_prefs = rp->_impl->read_preference_t; } - bsoncxx::builder::basic::document opts_builder; + bsoncxx::v_noabi::builder::basic::document opts_builder; if (const auto& collation = options.collation()) { opts_builder.append(kvp("collation", *collation)); } if (const auto& max_time = options.max_time()) { - opts_builder.append(kvp("maxTimeMS", bsoncxx::types::b_int64{max_time->count()})); + opts_builder.append(kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{max_time->count()})); } if (const auto& hint = options.hint()) { @@ -1061,7 +1080,8 @@ std::int64_t collection::_count_documents(const client_session* session, } if (session) { - opts_builder.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_builder.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } if (const auto& skip = options.skip()) { @@ -1106,10 +1126,10 @@ std::int64_t collection::estimated_document_count( read_prefs = rp->_impl->read_preference_t; } - bsoncxx::builder::basic::document opts_builder; + bsoncxx::v_noabi::builder::basic::document opts_builder; if (const auto& max_time = options.max_time()) { - opts_builder.append(kvp("maxTimeMS", bsoncxx::types::b_int64{max_time->count()})); + opts_builder.append(kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{max_time->count()})); } if (const auto& comment = options.comment()) { @@ -1125,10 +1145,11 @@ std::int64_t collection::estimated_document_count( return result; } -bsoncxx::document::value collection::_create_index(const client_session* session, - bsoncxx::document::view_or_value keys, - bsoncxx::document::view_or_value index_opts, - options::index_view operation_options) { +bsoncxx::v_noabi::document::value collection::_create_index( + const client_session* session, + bsoncxx::v_noabi::document::view_or_value keys, + bsoncxx::v_noabi::document::view_or_value index_opts, + options::index_view operation_options) { using namespace bsoncxx; auto name = session ? indexes().create_one(*session, keys, index_opts, operation_options) @@ -1141,36 +1162,39 @@ bsoncxx::document::value collection::_create_index(const client_session* session } } -bsoncxx::document::value collection::create_index(bsoncxx::document::view_or_value keys, - bsoncxx::document::view_or_value index_opts, - options::index_view operation_options) { +bsoncxx::v_noabi::document::value collection::create_index( + bsoncxx::v_noabi::document::view_or_value keys, + bsoncxx::v_noabi::document::view_or_value index_opts, + options::index_view operation_options) { return _create_index(nullptr, keys, index_opts, operation_options); } -bsoncxx::document::value collection::create_index(const client_session& session, - bsoncxx::document::view_or_value keys, - bsoncxx::document::view_or_value index_opts, - options::index_view operation_options) { +bsoncxx::v_noabi::document::value collection::create_index( + const client_session& session, + bsoncxx::v_noabi::document::view_or_value keys, + bsoncxx::v_noabi::document::view_or_value index_opts, + options::index_view operation_options) { return _create_index(&session, keys, index_opts, operation_options); } cursor collection::_distinct(const client_session* session, - bsoncxx::string::view_or_value field_name, + bsoncxx::v_noabi::string::view_or_value field_name, view_or_value query, const options::distinct& options) { // // Construct the distinct command and options. // - bsoncxx::builder::basic::document command_builder; + bsoncxx::v_noabi::builder::basic::document command_builder; command_builder.append(kvp("distinct", name()), kvp("key", field_name.view()), - kvp("query", bsoncxx::types::b_document{query})); + kvp("query", bsoncxx::v_noabi::types::b_document{query})); if (const auto& max_time = options.max_time()) { - command_builder.append(kvp("maxTimeMS", bsoncxx::types::b_int64{max_time->count()})); + command_builder.append( + kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{max_time->count()})); } - bsoncxx::builder::basic::document opts_builder{}; + bsoncxx::v_noabi::builder::basic::document opts_builder{}; if (const auto& collation = options.collation()) { opts_builder.append(kvp("collation", *collation)); } @@ -1180,7 +1204,8 @@ cursor collection::_distinct(const client_session* session, } if (session) { - opts_builder.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_builder.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } const mongoc_read_prefs_t* rp_ptr = NULL; @@ -1221,7 +1246,7 @@ cursor collection::_distinct(const client_session* session, bson_t* reply_bson = bson_new_from_data(fake_db_reply.view().data(), fake_db_reply.view().length()); if (!reply_bson) { - throw bsoncxx::exception{bsoncxx::error_code::k_internal_error}; + throw bsoncxx::v_noabi::exception{bsoncxx::v_noabi::error_code::k_internal_error}; } const bson_t* error_document; @@ -1230,8 +1255,8 @@ cursor collection::_distinct(const client_session* session, _get_impl().client_impl->client_t, reply_bson, nullptr)}; if (libmongoc::cursor_error_document(fake_cursor._impl->cursor_t, &error, &error_document)) { if (error_document) { - bsoncxx::document::value error_doc{ - bsoncxx::document::view{bson_get_data(error_document), error_document->len}}; + bsoncxx::v_noabi::document::value error_doc{bsoncxx::v_noabi::document::view{ + bson_get_data(error_document), error_document->len}}; throw_exception(error_doc, error); } else { throw_exception(error); @@ -1241,14 +1266,14 @@ cursor collection::_distinct(const client_session* session, return fake_cursor; } -cursor collection::distinct(bsoncxx::string::view_or_value field_name, +cursor collection::distinct(bsoncxx::v_noabi::string::view_or_value field_name, view_or_value query, const options::distinct& options) { return _distinct(nullptr, field_name, query, options); } cursor collection::distinct(const client_session& session, - bsoncxx::string::view_or_value field_name, + bsoncxx::v_noabi::string::view_or_value field_name, view_or_value query, const options::distinct& options) { return _distinct(&session, field_name, query, options); @@ -1259,29 +1284,31 @@ cursor collection::list_indexes() const { } cursor collection::list_indexes(const client_session& session) const { - bsoncxx::builder::basic::document options_builder; - options_builder.append(bsoncxx::builder::concatenate_doc{session._get_impl().to_document()}); + bsoncxx::v_noabi::builder::basic::document options_builder; + options_builder.append( + bsoncxx::v_noabi::builder::concatenate_doc{session._get_impl().to_document()}); libbson::scoped_bson_t options_bson{options_builder.extract()}; return libmongoc::collection_find_indexes_with_opts(_get_impl().collection_t, options_bson.bson()); } void collection::_drop(const client_session* session, - const stdx::optional& wc, - bsoncxx::document::view_or_value collection_options) { + const stdx::optional& wc, + bsoncxx::v_noabi::document::view_or_value collection_options) { bson_error_t error; - bsoncxx::builder::basic::document opts_doc; + bsoncxx::v_noabi::builder::basic::document opts_doc; if (wc) { opts_doc.append(kvp("writeConcern", wc->to_document())); } if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } if (!collection_options.view().empty()) { - opts_doc.append(bsoncxx::builder::concatenate_doc{collection_options}); + opts_doc.append(bsoncxx::v_noabi::builder::concatenate_doc{collection_options}); } scoped_bson_t opts_bson{opts_doc.view()}; @@ -1297,44 +1324,45 @@ void collection::_drop(const client_session* session, } } -void collection::drop(const stdx::optional& wc, - bsoncxx::document::view_or_value collection_options) { +void collection::drop(const 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, - bsoncxx::document::view_or_value collection_options) { + const stdx::optional& wc, + bsoncxx::v_noabi::document::view_or_value collection_options) { return _drop(&session, wc, collection_options); } -void collection::read_concern(mongocxx::read_concern rc) { +void collection::read_concern(mongocxx::v_noabi::read_concern rc) { libmongoc::collection_set_read_concern(_get_impl().collection_t, rc._impl->read_concern_t); } -mongocxx::read_concern collection::read_concern() const { +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))}; } -void collection::read_preference(mongocxx::read_preference rp) { +void collection::read_preference(mongocxx::v_noabi::read_preference rp) { libmongoc::collection_set_read_prefs(_get_impl().collection_t, rp._impl->read_preference_t); } -mongocxx::read_preference collection::read_preference() const { - mongocxx::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( libmongoc::collection_get_read_prefs(_get_impl().collection_t)))); return rp; } -void collection::write_concern(mongocxx::write_concern wc) { +void collection::write_concern(mongocxx::v_noabi::write_concern wc) { libmongoc::collection_set_write_concern(_get_impl().collection_t, wc._impl->write_concern_t); } -mongocxx::write_concern collection::write_concern() const { - mongocxx::write_concern wc(stdx::make_unique(libmongoc::write_concern_copy( - libmongoc::collection_get_write_concern(_get_impl().collection_t)))); +mongocxx::v_noabi::write_concern collection::write_concern() const { + mongocxx::v_noabi::write_concern wc( + stdx::make_unique(libmongoc::write_concern_copy( + libmongoc::collection_get_write_concern(_get_impl().collection_t)))); return wc; } @@ -1360,15 +1388,15 @@ change_stream collection::watch(const client_session& session, change_stream collection::_watch(const client_session* session, const pipeline& pipe, const options::change_stream& options) { - bsoncxx::builder::basic::document container; + bsoncxx::v_noabi::builder::basic::document container; container.append(kvp("pipeline", pipe._impl->view_array())); scoped_bson_t pipeline_bson{container.view()}; - bsoncxx::builder::basic::document options_builder; - options_builder.append(bsoncxx::builder::concatenate(options.as_bson())); + bsoncxx::v_noabi::builder::basic::document options_builder; + options_builder.append(bsoncxx::v_noabi::builder::concatenate(options.as_bson())); if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson{options_builder.extract()}; @@ -1386,8 +1414,8 @@ search_index_view collection::search_indexes() { return search_index_view{_get_impl().collection_t, _get_impl().client_impl->client_t}; } -mongocxx::bulk_write collection::_init_insert_many(const options::insert& options, - const client_session* session) { +mongocxx::v_noabi::bulk_write collection::_init_insert_many(const options::insert& options, + const client_session* session) { options::bulk_write bulk_write_options; bulk_write_options.ordered(options.ordered().value_or(true)); @@ -1411,13 +1439,13 @@ mongocxx::bulk_write collection::_init_insert_many(const options::insert& option return create_bulk_write(bulk_write_options); } -void collection::_insert_many_doc_handler(mongocxx::bulk_write& writes, - bsoncxx::builder::basic::array& inserted_ids, - bsoncxx::document::view doc) const { - bsoncxx::builder::basic::document id_doc; +void collection::_insert_many_doc_handler(mongocxx::v_noabi::bulk_write& writes, + bsoncxx::v_noabi::builder::basic::array& inserted_ids, + bsoncxx::v_noabi::document::view doc) const { + bsoncxx::v_noabi::builder::basic::document id_doc; if (!doc["_id"]) { - id_doc.append(kvp("_id", bsoncxx::oid{})); + id_doc.append(kvp("_id", bsoncxx::v_noabi::oid{})); writes.append( model::insert_one{make_document(concatenate(id_doc.view()), concatenate(doc))}); } else { @@ -1429,7 +1457,7 @@ void collection::_insert_many_doc_handler(mongocxx::bulk_write& writes, } stdx::optional collection::_exec_insert_many( - mongocxx::bulk_write& writes, bsoncxx::builder::basic::array& inserted_ids) { + mongocxx::v_noabi::bulk_write& writes, bsoncxx::v_noabi::builder::basic::array& inserted_ids) { auto result = writes.execute(); if (!result) { return stdx::nullopt; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp index 7e138103b0..bf834048a7 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp @@ -23,8 +23,9 @@ #include namespace mongocxx { -inline namespace v_noabi { -cursor::cursor(void* cursor_ptr, bsoncxx::stdx::optional cursor_type) +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)) {} cursor::cursor(cursor&&) noexcept = default; @@ -42,13 +43,13 @@ cursor::iterator& cursor::iterator::operator++() { bson_error_t error; if (libmongoc::cursor_next(_cursor->_impl->cursor_t, &out)) { - _cursor->_impl->doc = bsoncxx::document::view{bson_get_data(out), out->len}; + _cursor->_impl->doc = bsoncxx::v_noabi::document::view{bson_get_data(out), out->len}; } else if (libmongoc::cursor_error_document( _cursor->_impl->cursor_t, &error, &error_document)) { _cursor->_impl->mark_dead(); if (error_document) { - bsoncxx::document::value error_doc{ - bsoncxx::document::view{bson_get_data(error_document), error_document->len}}; + bsoncxx::v_noabi::document::value error_doc{bsoncxx::v_noabi::document::view{ + bson_get_data(error_document), error_document->len}}; throw_exception(error_doc, error); } else { throw_exception(error); @@ -87,11 +88,11 @@ bool cursor::iterator::is_exhausted() const { return !_cursor || _cursor->_impl->is_exhausted(); } -const bsoncxx::document::view& cursor::iterator::operator*() const { +const bsoncxx::v_noabi::document::view& cursor::iterator::operator*() const { return _cursor->_impl->doc; } -const bsoncxx::document::view* cursor::iterator::operator->() const { +const bsoncxx::v_noabi::document::view* cursor::iterator::operator->() const { return &_cursor->_impl->doc; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp index 4bf2f2f3e2..4a7018b123 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp @@ -36,13 +36,15 @@ #include -using bsoncxx::builder::concatenate; -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::make_document; +using bsoncxx::v_noabi::builder::concatenate; +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::make_document; namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + namespace { + class collection_names { public: explicit collection_names(char** names) { @@ -64,6 +66,7 @@ class collection_names { private: char** _names; }; + } // namespace using namespace libbson; @@ -75,7 +78,8 @@ database& database::operator=(database&&) noexcept = default; database::~database() = default; -database::database(const mongocxx::client& client, bsoncxx::string::view_or_value name) +database::database(const mongocxx::v_noabi::client& client, + bsoncxx::v_noabi::string::view_or_value name) : _impl(stdx::make_unique( libmongoc::client_get_database(client._get_impl().client_t, name.terminated().data()), &client._get_impl(), @@ -106,14 +110,14 @@ database::operator bool() const noexcept { cursor database::_aggregate(const client_session* session, const pipeline& pipeline, const options::aggregate& options) { - scoped_bson_t stages(bsoncxx::document::view(pipeline._impl->view_array())); + scoped_bson_t stages(bsoncxx::v_noabi::document::view(pipeline._impl->view_array())); - bsoncxx::builder::basic::document b; + bsoncxx::v_noabi::builder::basic::document b; options.append(b); if (session) { - b.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + b.append(bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson(b.view()); @@ -139,13 +143,13 @@ cursor database::aggregate(const client_session& session, } cursor database::_list_collections(const client_session* session, - bsoncxx::document::view_or_value filter) { - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::document::view_or_value filter) { + bsoncxx::v_noabi::builder::basic::document options_builder; options_builder.append(kvp("filter", filter)); if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson(options_builder.extract()); @@ -154,23 +158,23 @@ cursor database::_list_collections(const client_session* session, options_bson.bson()); } -cursor database::list_collections(bsoncxx::document::view_or_value filter) { +cursor database::list_collections(bsoncxx::v_noabi::document::view_or_value filter) { return _list_collections(nullptr, filter); } cursor database::list_collections(const client_session& session, - bsoncxx::document::view_or_value filter) { + bsoncxx::v_noabi::document::view_or_value filter) { return _list_collections(&session, filter); } -std::vector database::_list_collection_names(const client_session* session, - bsoncxx::document::view_or_value filter) { - bsoncxx::builder::basic::document options_builder; +std::vector database::_list_collection_names( + const client_session* session, bsoncxx::v_noabi::document::view_or_value filter) { + bsoncxx::v_noabi::builder::basic::document options_builder; options_builder.append(kvp("filter", filter)); if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson(options_builder.extract()); @@ -191,12 +195,13 @@ std::vector database::_list_collection_names(const client_session* return _names; } -std::vector database::list_collection_names(bsoncxx::document::view_or_value filter) { +std::vector database::list_collection_names( + bsoncxx::v_noabi::document::view_or_value filter) { return _list_collection_names(nullptr, filter); } -std::vector database::list_collection_names(const client_session& session, - bsoncxx::document::view_or_value filter) { +std::vector database::list_collection_names( + const client_session& session, bsoncxx::v_noabi::document::view_or_value filter) { return _list_collection_names(&session, filter); } @@ -204,16 +209,16 @@ stdx::string_view database::name() const { return _get_impl().name; } -bsoncxx::document::value database::_run_command(const client_session* session, - bsoncxx::document::view_or_value command) { +bsoncxx::v_noabi::document::value database::_run_command( + const client_session* session, bsoncxx::v_noabi::document::view_or_value command) { libbson::scoped_bson_t command_bson{command}; libbson::scoped_bson_t reply_bson; bson_error_t error; - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson(options_builder.extract()); @@ -231,17 +236,18 @@ bsoncxx::document::value database::_run_command(const client_session* session, return reply_bson.steal(); } -bsoncxx::document::value database::run_command(bsoncxx::document::view_or_value command) { +bsoncxx::v_noabi::document::value database::run_command( + bsoncxx::v_noabi::document::view_or_value command) { return _run_command(nullptr, command); } -bsoncxx::document::value database::run_command(const client_session& session, - bsoncxx::document::view_or_value command) { +bsoncxx::v_noabi::document::value database::run_command( + const client_session& session, bsoncxx::v_noabi::document::view_or_value command) { return _run_command(&session, command); } -bsoncxx::document::value database::run_command(bsoncxx::document::view_or_value command, - uint32_t server_id) { +bsoncxx::v_noabi::document::value database::run_command( + bsoncxx::v_noabi::document::view_or_value command, uint32_t server_id) { libbson::scoped_bson_t command_bson{command}; libbson::scoped_bson_t reply_bson; bson_error_t error; @@ -265,12 +271,12 @@ bsoncxx::document::value database::run_command(bsoncxx::document::view_or_value collection database::_create_collection( const client_session* session, stdx::string_view name, - bsoncxx::document::view_or_value collection_options, - const stdx::optional& write_concern) { - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::document::view_or_value collection_options, + const stdx::optional& write_concern) { + bsoncxx::v_noabi::builder::basic::document options_builder; bson_error_t error; - options_builder.append(bsoncxx::builder::concatenate_doc{collection_options}); + options_builder.append(bsoncxx::v_noabi::builder::concatenate_doc{collection_options}); if (write_concern) { options_builder.append(kvp("writeConcern", write_concern->to_document())); @@ -278,26 +284,29 @@ collection database::_create_collection( if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } libbson::scoped_bson_t opts_bson{options_builder.view()}; - auto result = libmongoc::database_create_collection( - _get_impl().database_t, bsoncxx::string::to_string(name).c_str(), opts_bson.bson(), &error); + auto result = + libmongoc::database_create_collection(_get_impl().database_t, + bsoncxx::v_noabi::string::to_string(name).c_str(), + opts_bson.bson(), + &error); if (!result) { throw_exception(error); } - return mongocxx::collection(*this, result); + return mongocxx::v_noabi::collection(*this, result); } collection database::_create_collection_deprecated( const client_session* session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern) { - bsoncxx::builder::basic::document options_builder; + const stdx::optional& write_concern) { + bsoncxx::v_noabi::builder::basic::document options_builder; if (collection_options.capped()) { options_builder.append(kvp("capped", *collection_options.capped())); @@ -366,47 +375,49 @@ collection database::_create_collection_deprecated( return _create_collection(session, name, options_builder.view(), write_concern); } -mongocxx::collection database::create_collection( +mongocxx::v_noabi::collection database::create_collection( stdx::string_view name, - bsoncxx::document::view_or_value collection_options, - const stdx::optional& write_concern) { + bsoncxx::v_noabi::document::view_or_value collection_options, + const stdx::optional& write_concern) { return _create_collection(nullptr, name, collection_options, write_concern); } -mongocxx::collection database::create_collection( +mongocxx::v_noabi::collection database::create_collection( const client_session& session, stdx::string_view name, - bsoncxx::document::view_or_value collection_options, - const stdx::optional& write_concern) { + bsoncxx::v_noabi::document::view_or_value collection_options, + const stdx::optional& write_concern) { return _create_collection(&session, name, collection_options, write_concern); } -mongocxx::collection database::create_collection_deprecated( - bsoncxx::string::view_or_value name, +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 stdx::optional& write_concern) { return _create_collection_deprecated(nullptr, name, collection_options, write_concern); } -mongocxx::collection database::create_collection_deprecated( +mongocxx::v_noabi::collection database::create_collection_deprecated( const client_session& session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated& collection_options, - const stdx::optional& write_concern) { + const stdx::optional& write_concern) { return _create_collection_deprecated(&session, name, collection_options, write_concern); } -void database::_drop(const client_session* session, - const bsoncxx::stdx::optional& write_concern) { +void database::_drop( + const client_session* session, + const bsoncxx::v_noabi::stdx::optional& write_concern) { bson_error_t error; - bsoncxx::builder::basic::document opts_doc; + bsoncxx::v_noabi::builder::basic::document opts_doc; if (write_concern) { opts_doc.append(kvp("writeConcern", write_concern->to_document())); } if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } libbson::scoped_bson_t opts_bson{opts_doc.view()}; @@ -416,29 +427,31 @@ void database::_drop(const client_session* session, } } -void database::drop(const bsoncxx::stdx::optional& write_concern) { +void database::drop( + const bsoncxx::v_noabi::stdx::optional& write_concern) { return _drop(nullptr, write_concern); } -void database::drop(const client_session& session, - const bsoncxx::stdx::optional& write_concern) { +void database::drop( + const client_session& session, + const bsoncxx::v_noabi::stdx::optional& write_concern) { return _drop(&session, write_concern); } -void database::read_concern(mongocxx::read_concern rc) { +void database::read_concern(mongocxx::v_noabi::read_concern rc) { libmongoc::database_set_read_concern(_get_impl().database_t, rc._impl->read_concern_t); } -mongocxx::read_concern database::read_concern() const { +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))}; } -void database::read_preference(mongocxx::read_preference rp) { +void database::read_preference(mongocxx::v_noabi::read_preference rp) { libmongoc::database_set_read_prefs(_get_impl().database_t, rp._impl->read_preference_t); } -bool database::has_collection(bsoncxx::string::view_or_value name) const { +bool database::has_collection(bsoncxx::v_noabi::string::view_or_value name) const { bson_error_t error; auto result = libmongoc::database_has_collection( _get_impl().database_t, name.terminated().data(), &error); @@ -449,28 +462,29 @@ bool database::has_collection(bsoncxx::string::view_or_value name) const { return result; } -mongocxx::read_preference database::read_preference() const { - mongocxx::read_preference rp(stdx::make_unique( +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)))); return rp; } -void database::write_concern(mongocxx::write_concern wc) { +void database::write_concern(mongocxx::v_noabi::write_concern wc) { libmongoc::database_set_write_concern(_get_impl().database_t, wc._impl->write_concern_t); } -mongocxx::write_concern database::write_concern() const { - mongocxx::write_concern wc(stdx::make_unique(libmongoc::write_concern_copy( - libmongoc::database_get_write_concern(_get_impl().database_t)))); +mongocxx::v_noabi::write_concern database::write_concern() const { + mongocxx::v_noabi::write_concern wc( + stdx::make_unique(libmongoc::write_concern_copy( + libmongoc::database_get_write_concern(_get_impl().database_t)))); return wc; } -collection database::collection(bsoncxx::string::view_or_value name) const { - return mongocxx::collection(*this, std::move(name)); +collection database::collection(bsoncxx::v_noabi::string::view_or_value name) const { + return mongocxx::v_noabi::collection(*this, std::move(name)); } -mongocxx::gridfs::bucket database::gridfs_bucket(const options::gridfs::bucket& options) const { - return mongocxx::gridfs::bucket{*this, options}; +gridfs::bucket database::gridfs_bucket(const options::gridfs::bucket& options) const { + return gridfs::bucket{*this, options}; } change_stream database::watch(const options::change_stream& options) { @@ -495,15 +509,15 @@ change_stream database::watch(const client_session& session, change_stream database::_watch(const client_session* session, const pipeline& pipe, const options::change_stream& options) { - bsoncxx::builder::basic::document container; + bsoncxx::v_noabi::builder::basic::document container; container.append(kvp("pipeline", pipe._impl->view_array())); scoped_bson_t pipeline_bson{container.view()}; - bsoncxx::builder::basic::document options_builder; - options_builder.append(bsoncxx::builder::concatenate(options.as_bson())); + bsoncxx::v_noabi::builder::basic::document options_builder; + options_builder.append(bsoncxx::v_noabi::builder::concatenate(options.as_bson())); if (session) { options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } scoped_bson_t options_bson{options_builder.extract()}; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp index 3a63c397ed..951242a605 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp @@ -23,20 +23,20 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { command_failed_event::command_failed_event(const void* event) : _failed_event(event) {} command_failed_event::~command_failed_event() = default; -bsoncxx::document::view command_failed_event::failure() const { +bsoncxx::v_noabi::document::view command_failed_event::failure() const { auto failure = libmongoc::apm_command_failed_get_reply( static_cast(_failed_event)); return {bson_get_data(failure), failure->len}; } -bsoncxx::stdx::string_view command_failed_event::command_name() const { +bsoncxx::v_noabi::stdx::string_view command_failed_event::command_name() const { return libmongoc::apm_command_failed_get_command_name( static_cast(_failed_event)); } @@ -56,17 +56,17 @@ std::int64_t command_failed_event::operation_id() const { static_cast(_failed_event)); } -bsoncxx::stdx::optional command_failed_event::service_id() const { +bsoncxx::v_noabi::stdx::optional command_failed_event::service_id() const { const bson_oid_t* bson_oid = libmongoc::apm_command_failed_get_service_id( static_cast(_failed_event)); if (nullptr == bson_oid) - return {bsoncxx::stdx::nullopt}; + return {bsoncxx::v_noabi::stdx::nullopt}; return {bsoncxx::helpers::make_oid(bson_oid)}; } -bsoncxx::stdx::string_view command_failed_event::host() const { +bsoncxx::v_noabi::stdx::string_view command_failed_event::host() const { return libmongoc::apm_command_failed_get_host( static_cast(_failed_event)) ->host; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp index 90801bb124..651b5a15b3 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp @@ -20,25 +20,25 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { command_started_event::command_started_event(const void* event) : _started_event(event) {} command_started_event::~command_started_event() = default; -bsoncxx::document::view command_started_event::command() const { +bsoncxx::v_noabi::document::view command_started_event::command() const { auto command = libmongoc::apm_command_started_get_command( static_cast(_started_event)); return {bson_get_data(command), command->len}; } -bsoncxx::stdx::string_view command_started_event::database_name() const { +bsoncxx::v_noabi::stdx::string_view command_started_event::database_name() const { return libmongoc::apm_command_started_get_database_name( static_cast(_started_event)); } -bsoncxx::stdx::string_view command_started_event::command_name() const { +bsoncxx::v_noabi::stdx::string_view command_started_event::command_name() const { return libmongoc::apm_command_started_get_command_name( static_cast(_started_event)); } @@ -53,17 +53,17 @@ std::int64_t command_started_event::operation_id() const { static_cast(_started_event)); } -bsoncxx::stdx::optional command_started_event::service_id() const { +bsoncxx::v_noabi::stdx::optional command_started_event::service_id() const { const bson_oid_t* bson_oid = libmongoc::apm_command_started_get_service_id( static_cast(_started_event)); if (nullptr == bson_oid) - return {bsoncxx::stdx::nullopt}; + return {bsoncxx::v_noabi::stdx::nullopt}; return {bsoncxx::helpers::make_oid(bson_oid)}; } -bsoncxx::stdx::string_view command_started_event::host() const { +bsoncxx::v_noabi::stdx::string_view command_started_event::host() const { return libmongoc::apm_command_started_get_host( static_cast(_started_event)) ->host; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp index eb23c1a6b4..611e232332 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp @@ -20,20 +20,20 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { command_succeeded_event::command_succeeded_event(const void* event) : _succeeded_event(event) {} command_succeeded_event::~command_succeeded_event() = default; -bsoncxx::document::view command_succeeded_event::reply() const { +bsoncxx::v_noabi::document::view command_succeeded_event::reply() const { auto reply = libmongoc::apm_command_succeeded_get_reply( static_cast(_succeeded_event)); return {bson_get_data(reply), reply->len}; } -bsoncxx::stdx::string_view command_succeeded_event::command_name() const { +bsoncxx::v_noabi::stdx::string_view command_succeeded_event::command_name() const { return libmongoc::apm_command_succeeded_get_command_name( static_cast(_succeeded_event)); } @@ -53,17 +53,18 @@ std::int64_t command_succeeded_event::operation_id() const { static_cast(_succeeded_event)); } -bsoncxx::stdx::optional command_succeeded_event::service_id() const { +bsoncxx::v_noabi::stdx::optional command_succeeded_event::service_id() + const { const bson_oid_t* bson_oid = libmongoc::apm_command_succeeded_get_service_id( static_cast(_succeeded_event)); if (nullptr == bson_oid) - return {bsoncxx::stdx::nullopt}; + return {bsoncxx::v_noabi::stdx::nullopt}; return {bsoncxx::helpers::make_oid(bson_oid)}; } -bsoncxx::stdx::string_view command_succeeded_event::host() const { +bsoncxx::v_noabi::stdx::string_view command_succeeded_event::host() const { return libmongoc::apm_command_succeeded_get_host( static_cast(_succeeded_event)) ->host; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.cpp index 7ad03a269b..b8dcad2256 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_failed_event.cpp @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { heartbeat_failed_event::heartbeat_failed_event(const void* event) : _failed_event(event) {} @@ -37,7 +37,7 @@ std::int64_t heartbeat_failed_event::duration() const { return libmongoc::apm_server_heartbeat_failed_get_duration(casted); } -bsoncxx::stdx::string_view heartbeat_failed_event::host() const { +bsoncxx::v_noabi::stdx::string_view heartbeat_failed_event::host() const { auto casted = static_cast(_failed_event); return libmongoc::apm_server_heartbeat_failed_get_host(casted)->host; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.cpp index 0f5c8ec7d0..d6ef1dc86c 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_started_event.cpp @@ -18,14 +18,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { heartbeat_started_event::heartbeat_started_event(const void* event) : _started_event(event) {} heartbeat_started_event::~heartbeat_started_event() = default; -bsoncxx::stdx::string_view heartbeat_started_event::host() const { +bsoncxx::v_noabi::stdx::string_view heartbeat_started_event::host() const { auto casted = static_cast(_started_event); return libmongoc::apm_server_heartbeat_started_get_host(casted)->host; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.cpp index 753e880fb5..373893edef 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/heartbeat_succeeded_event.cpp @@ -18,14 +18,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { heartbeat_succeeded_event::heartbeat_succeeded_event(const void* event) : _succeeded_event(event) {} heartbeat_succeeded_event::~heartbeat_succeeded_event() = default; -bsoncxx::document::view heartbeat_succeeded_event::reply() const { +bsoncxx::v_noabi::document::view heartbeat_succeeded_event::reply() const { auto casted = static_cast(_succeeded_event); auto reply = libmongoc::apm_server_heartbeat_succeeded_get_reply(casted); return {bson_get_data(reply), reply->len}; @@ -36,7 +36,7 @@ std::int64_t heartbeat_succeeded_event::duration() const { return libmongoc::apm_server_heartbeat_succeeded_get_duration(casted); } -bsoncxx::stdx::string_view heartbeat_succeeded_event::host() const { +bsoncxx::v_noabi::stdx::string_view heartbeat_succeeded_event::host() const { auto casted = static_cast(_succeeded_event); return libmongoc::apm_server_heartbeat_succeeded_get_host(casted)->host; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_changed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_changed_event.cpp index 0e7e61563b..5f2b7b2573 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_changed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_changed_event.cpp @@ -18,14 +18,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { server_changed_event::server_changed_event(const void* event) : _event(event) {} server_changed_event::~server_changed_event() = default; -bsoncxx::stdx::string_view server_changed_event::host() const { +bsoncxx::v_noabi::stdx::string_view server_changed_event::host() const { return libmongoc::apm_server_changed_get_host( static_cast(_event)) ->host; @@ -37,12 +37,12 @@ std::uint16_t server_changed_event::port() const { ->port; } -const bsoncxx::oid server_changed_event::topology_id() const { +const bsoncxx::v_noabi::oid server_changed_event::topology_id() const { bson_oid_t boid; libmongoc::apm_server_changed_get_topology_id( static_cast(_event), &boid); - return bsoncxx::oid{reinterpret_cast(boid.bytes), sizeof(boid.bytes)}; + return bsoncxx::v_noabi::oid{reinterpret_cast(boid.bytes), sizeof(boid.bytes)}; } const server_description server_changed_event::previous_description() const { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_closed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_closed_event.cpp index 829b9bd8b1..5ffa141a7f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_closed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_closed_event.cpp @@ -18,14 +18,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { server_closed_event::server_closed_event(const void* event) : _event(event) {} server_closed_event::~server_closed_event() = default; -bsoncxx::stdx::string_view server_closed_event::host() const { +bsoncxx::v_noabi::stdx::string_view server_closed_event::host() const { return libmongoc::apm_server_changed_get_host( static_cast(_event)) ->host; @@ -37,12 +37,12 @@ std::uint16_t server_closed_event::port() const { ->port; } -const bsoncxx::oid server_closed_event::topology_id() const { +const bsoncxx::v_noabi::oid server_closed_event::topology_id() const { bson_oid_t boid; libmongoc::apm_server_changed_get_topology_id( static_cast(_event), &boid); - return bsoncxx::oid{reinterpret_cast(boid.bytes), sizeof(boid.bytes)}; + return bsoncxx::v_noabi::oid{reinterpret_cast(boid.bytes), sizeof(boid.bytes)}; } } // namespace events diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_description.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_description.cpp index cc61999e69..54251b3010 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_description.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_description.cpp @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { server_description::server_description(const void* sd) : _sd(sd) {} @@ -34,21 +34,21 @@ std::int64_t server_description::round_trip_time() const { static_cast(_sd)); } -bsoncxx::stdx::string_view server_description::type() const { +bsoncxx::v_noabi::stdx::string_view server_description::type() const { return libmongoc::server_description_type(static_cast(_sd)); } -bsoncxx::document::view server_description::is_master() const { +bsoncxx::v_noabi::document::view server_description::is_master() const { return hello(); } -bsoncxx::document::view server_description::hello() const { +bsoncxx::v_noabi::document::view server_description::hello() const { auto reply = libmongoc::server_description_hello_response( static_cast(_sd)); return {bson_get_data(reply), reply->len}; } -bsoncxx::stdx::string_view server_description::host() const { +bsoncxx::v_noabi::stdx::string_view server_description::host() const { return libmongoc::server_description_host(static_cast(_sd)) ->host; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_opening_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_opening_event.cpp index 5cc6133967..c4076262db 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_opening_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/server_opening_event.cpp @@ -18,14 +18,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { server_opening_event::server_opening_event(const void* event) : _event(event) {} server_opening_event::~server_opening_event() = default; -bsoncxx::stdx::string_view server_opening_event::host() const { +bsoncxx::v_noabi::stdx::string_view server_opening_event::host() const { return libmongoc::apm_server_changed_get_host( static_cast(_event)) ->host; @@ -37,12 +37,12 @@ std::uint16_t server_opening_event::port() const { ->port; } -const bsoncxx::oid server_opening_event::topology_id() const { +const bsoncxx::v_noabi::oid server_opening_event::topology_id() const { bson_oid_t boid; libmongoc::apm_server_changed_get_topology_id( static_cast(_event), &boid); - return bsoncxx::oid{reinterpret_cast(boid.bytes), sizeof(boid.bytes)}; + return bsoncxx::v_noabi::oid{reinterpret_cast(boid.bytes), sizeof(boid.bytes)}; } } // namespace events diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_changed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_changed_event.cpp index 2de3216414..dba683fc3f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_changed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_changed_event.cpp @@ -18,18 +18,18 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { topology_changed_event::topology_changed_event(const void* event) : _event(event) {} topology_changed_event::~topology_changed_event() = default; -bsoncxx::oid topology_changed_event::topology_id() const { +bsoncxx::v_noabi::oid topology_changed_event::topology_id() const { bson_oid_t boid; libmongoc::apm_topology_changed_get_topology_id( static_cast(_event), &boid); - return bsoncxx::oid(reinterpret_cast(boid.bytes), sizeof(boid.bytes)); + return bsoncxx::v_noabi::oid(reinterpret_cast(boid.bytes), sizeof(boid.bytes)); } topology_description topology_changed_event::previous_description() const { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_closed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_closed_event.cpp index d78ad1d1ff..39cf8d4375 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_closed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_closed_event.cpp @@ -18,18 +18,18 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { topology_closed_event::topology_closed_event(const void* event) : _event(event) {} topology_closed_event::~topology_closed_event() = default; -bsoncxx::oid topology_closed_event::topology_id() const { +bsoncxx::v_noabi::oid topology_closed_event::topology_id() const { bson_oid_t boid; libmongoc::apm_topology_closed_get_topology_id( static_cast(_event), &boid); - return bsoncxx::oid(reinterpret_cast(boid.bytes), sizeof(boid.bytes)); + return bsoncxx::v_noabi::oid(reinterpret_cast(boid.bytes), sizeof(boid.bytes)); } } // namespace events diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_description.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_description.cpp index 67d3a5111a..80bbfb3742 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_description.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_description.cpp @@ -19,7 +19,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { topology_description::server_descriptions::server_descriptions( @@ -28,7 +28,7 @@ topology_description::server_descriptions::server_descriptions( } topology_description::server_descriptions& topology_description::server_descriptions::operator=( - mongocxx::events::topology_description::server_descriptions&& other) noexcept { + server_descriptions&& other) noexcept { swap(other); return *this; } @@ -82,11 +82,12 @@ topology_description::topology_description(void* td) : _td(td) {} topology_description::~topology_description() = default; -bsoncxx::stdx::string_view topology_description::type() const { +bsoncxx::v_noabi::stdx::string_view topology_description::type() const { return libmongoc::topology_description_type(static_cast(_td)); } -bool topology_description::has_readable_server(const mongocxx::read_preference& pref) const { +bool topology_description::has_readable_server( + const mongocxx::v_noabi::read_preference& pref) const { return libmongoc::topology_description_has_readable_server( static_cast(_td), pref._impl->read_preference_t); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_opening_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_opening_event.cpp index dd11ed37f5..1354288e61 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_opening_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_opening_event.cpp @@ -18,18 +18,18 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace events { topology_opening_event::topology_opening_event(const void* event) : _event(event) {} topology_opening_event::~topology_opening_event() = default; -bsoncxx::oid topology_opening_event::topology_id() const { +bsoncxx::v_noabi::oid topology_opening_event::topology_id() const { bson_oid_t boid; libmongoc::apm_topology_opening_get_topology_id( static_cast(_event), &boid); - return bsoncxx::oid(reinterpret_cast(boid.bytes), sizeof(boid.bytes)); + return bsoncxx::v_noabi::oid(reinterpret_cast(boid.bytes), sizeof(boid.bytes)); } } // namespace events diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/error_code.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/error_code.cpp index 7ef22a7082..c90cb08a18 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/error_code.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/error_code.cpp @@ -19,7 +19,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + namespace { // 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 2983cfb2f8..bf1b5dd336 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 @@ -23,17 +23,19 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + operation_exception::operation_exception(std::error_code ec, - bsoncxx::document::value&& raw_server_error, + bsoncxx::v_noabi::document::value&& raw_server_error, 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 stdx::optional& operation_exception::raw_server_error() + const { return _raw_server_error; } -stdx::optional& operation_exception::raw_server_error() { +stdx::optional& operation_exception::raw_server_error() { return _raw_server_error; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/private/mongoc_error.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/private/mongoc_error.hh index cdd5c95e8d..adc8c73de2 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/private/mongoc_error.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/private/mongoc_error.hh @@ -22,7 +22,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + inline std::error_code make_error_code(int code, int) { // Domain is ignored. We simply issue the code. return {code, server_error_category()}; @@ -58,7 +59,8 @@ void throw_exception(const ::bson_error_t& error) { } template -void throw_exception(bsoncxx::document::value raw_server_error, const ::bson_error_t& error) { +void throw_exception(bsoncxx::v_noabi::document::value raw_server_error, + const ::bson_error_t& error) { throw exception_type{make_error_code(error), std::move(raw_server_error), error.message}; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/server_error_code.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/server_error_code.cpp index f34fabcf85..c646602102 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/server_error_code.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/exception/server_error_code.cpp @@ -19,7 +19,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + namespace { // 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 e84661aebc..f3dfcf65a5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp @@ -35,11 +35,12 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { namespace { -std::int32_t read_chunk_size_from_files_document(bsoncxx::document::view files_doc) { + +std::int32_t read_chunk_size_from_files_document(bsoncxx::v_noabi::document::view files_doc) { const std::int64_t k_max_document_size = 16 * 1024 * 1024; std::int64_t chunk_size; @@ -51,9 +52,9 @@ std::int32_t read_chunk_size_from_files_document(bsoncxx::document::view files_d "k_int32 or k_int64"}; } - if (chunk_size_ele.type() == bsoncxx::type::k_int64) { + if (chunk_size_ele.type() == bsoncxx::v_noabi::type::k_int64) { chunk_size = chunk_size_ele.get_int64().value; - } else if (chunk_size_ele.type() == bsoncxx::type::k_int32) { + } else if (chunk_size_ele.type() == bsoncxx::v_noabi::type::k_int32) { chunk_size = chunk_size_ele.get_int32().value; } else { throw gridfs_exception{error_code::k_gridfs_file_corrupted, @@ -77,7 +78,7 @@ std::int32_t read_chunk_size_from_files_document(bsoncxx::document::view files_d return static_cast(chunk_size); } -std::int64_t read_length_from_files_document(const bsoncxx::document::view files_doc) { +std::int64_t read_length_from_files_document(const bsoncxx::v_noabi::document::view files_doc) { auto length_ele = files_doc["length"]; std::int64_t length; @@ -87,9 +88,9 @@ std::int64_t read_length_from_files_document(const bsoncxx::document::view files "k_int32 or k_int64"}; } - if (length_ele.type() == bsoncxx::type::k_int64) { + if (length_ele.type() == bsoncxx::v_noabi::type::k_int64) { length = length_ele.get_int64().value; - } else if (length_ele.type() == bsoncxx::type::k_int32) { + } else if (length_ele.type() == bsoncxx::v_noabi::type::k_int32) { length = length_ele.get_int32().value; } else { throw gridfs_exception{error_code::k_gridfs_file_corrupted, @@ -105,6 +106,7 @@ std::int64_t read_length_from_files_document(const bsoncxx::document::view files return length; } + } // namespace bucket::bucket(const database& db, const options::gridfs::bucket& options) { @@ -177,19 +179,19 @@ bucket& bucket::operator=(const bucket& b) { uploader bucket::open_upload_stream(stdx::string_view filename, const options::gridfs::upload& options) { - auto id = bsoncxx::types::bson_value::view{bsoncxx::types::b_oid{}}; + 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, const options::gridfs::upload& options) { - auto id = bsoncxx::types::bson_value::view{bsoncxx::types::b_oid{}}; + 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); } uploader bucket::_open_upload_stream_with_id(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload& options) { std::int32_t chunk_size_bytes = _get_impl().default_chunk_size_bytes; @@ -215,14 +217,14 @@ uploader bucket::_open_upload_stream_with_id(const client_session* session, std::move(options.metadata())}; } -uploader bucket::open_upload_stream_with_id(bsoncxx::types::bson_value::view id, +uploader bucket::open_upload_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, 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::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload& options) { return _open_upload_stream_with_id(&session, id, filename, options); @@ -231,7 +233,7 @@ uploader bucket::open_upload_stream_with_id(const client_session& session, result::gridfs::upload bucket::upload_from_stream(stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { - auto id = bsoncxx::types::bson_value::view{bsoncxx::types::b_oid{}}; + auto id = bsoncxx::v_noabi::types::bson_value::view{bsoncxx::v_noabi::types::b_oid{}}; upload_from_stream_with_id(id, filename, source, options); return id; } @@ -240,13 +242,13 @@ result::gridfs::upload bucket::upload_from_stream(const client_session& session, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { - auto id = bsoncxx::types::bson_value::view{bsoncxx::types::b_oid{}}; + auto id = bsoncxx::v_noabi::types::bson_value::view{bsoncxx::v_noabi::types::b_oid{}}; upload_from_stream_with_id(session, id, filename, source, options); return id; } void bucket::_upload_from_stream_with_id(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { @@ -271,7 +273,7 @@ void bucket::_upload_from_stream_with_id(const client_session* session, upload_stream.close(); } -void bucket::upload_from_stream_with_id(bsoncxx::types::bson_value::view id, +void bucket::upload_from_stream_with_id(bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { @@ -279,7 +281,7 @@ void bucket::upload_from_stream_with_id(bsoncxx::types::bson_value::view id, } void bucket::upload_from_stream_with_id(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, std::istream* source, const options::gridfs::upload& options) { @@ -287,7 +289,7 @@ void bucket::upload_from_stream_with_id(const client_session& session, } downloader bucket::_open_download_stream(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::optional start, stdx::optional end) { using namespace bsoncxx; @@ -385,17 +387,17 @@ downloader bucket::_open_download_stream(const client_session* session, return downloader{std::move(cursor), start_offset, chunk_size, file_len, *files_doc}; } -downloader bucket::open_download_stream(bsoncxx::types::bson_value::view id) { +downloader bucket::open_download_stream(bsoncxx::v_noabi::types::bson_value::view id) { return _open_download_stream(nullptr, id, stdx::nullopt, stdx::nullopt); } downloader bucket::open_download_stream(const client_session& session, - bsoncxx::types::bson_value::view id) { + bsoncxx::v_noabi::types::bson_value::view id) { return _open_download_stream(&session, id, stdx::nullopt, stdx::nullopt); } void bucket::_download_to_stream(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, stdx::optional start, stdx::optional end) { @@ -432,11 +434,12 @@ void bucket::_download_to_stream(const client_session* session, download_stream.close(); } -void bucket::download_to_stream(bsoncxx::types::bson_value::view id, std::ostream* destination) { +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); } -void bucket::download_to_stream(bsoncxx::types::bson_value::view id, +void bucket::download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, std::size_t start, std::size_t end) { @@ -444,20 +447,21 @@ void bucket::download_to_stream(bsoncxx::types::bson_value::view id, } void bucket::download_to_stream(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination) { _download_to_stream(&session, id, destination, stdx::nullopt, stdx::nullopt); } void bucket::download_to_stream(const client_session& session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, std::size_t start, std::size_t end) { _download_to_stream(&session, id, destination, start, end); } -void bucket::_delete_file(const client_session* session, bsoncxx::types::bson_value::view id) { +void bucket::_delete_file(const client_session* session, + bsoncxx::v_noabi::types::bson_value::view id) { using namespace bsoncxx; builder::basic::document files_builder; @@ -482,20 +486,22 @@ void bucket::_delete_file(const client_session* session, bsoncxx::types::bson_va } } -void bucket::delete_file(bsoncxx::types::bson_value::view id) { +void bucket::delete_file(bsoncxx::v_noabi::types::bson_value::view id) { _delete_file(nullptr, id); } -void bucket::delete_file(const client_session& session, bsoncxx::types::bson_value::view id) { +void bucket::delete_file(const client_session& session, + bsoncxx::v_noabi::types::bson_value::view id) { _delete_file(&session, id); } -cursor bucket::find(bsoncxx::document::view_or_value filter, const options::find& options) { +cursor bucket::find(bsoncxx::v_noabi::document::view_or_value filter, + const options::find& options) { return _get_impl().files.find(filter, options); } cursor bucket::find(const client_session& session, - bsoncxx::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value filter, const options::find& options) { return _get_impl().files.find(session, filter, options); } @@ -509,8 +515,8 @@ void bucket::create_indexes_if_nonexistent(const client_session* session) { return; } - bsoncxx::builder::basic::document filter; - filter.append(bsoncxx::builder::basic::kvp("_id", 1)); + bsoncxx::v_noabi::builder::basic::document filter; + filter.append(bsoncxx::v_noabi::builder::basic::kvp("_id", 1)); auto find_options = options::find{}.projection(filter.view()).read_preference(read_preference{}); @@ -523,9 +529,9 @@ void bucket::create_indexes_if_nonexistent(const client_session* session) { return; } - bsoncxx::builder::basic::document files_index; - files_index.append(bsoncxx::builder::basic::kvp("filename", 1)); - files_index.append(bsoncxx::builder::basic::kvp("uploadDate", 1)); + bsoncxx::v_noabi::builder::basic::document files_index; + files_index.append(bsoncxx::v_noabi::builder::basic::kvp("filename", 1)); + files_index.append(bsoncxx::v_noabi::builder::basic::kvp("uploadDate", 1)); if (session) { _get_impl().files.create_index(*session, files_index.extract()); @@ -533,9 +539,9 @@ void bucket::create_indexes_if_nonexistent(const client_session* session) { _get_impl().files.create_index(files_index.extract()); } - bsoncxx::builder::basic::document chunks_index; - chunks_index.append(bsoncxx::builder::basic::kvp("files_id", 1)); - chunks_index.append(bsoncxx::builder::basic::kvp("n", 1)); + bsoncxx::v_noabi::builder::basic::document chunks_index; + chunks_index.append(bsoncxx::v_noabi::builder::basic::kvp("files_id", 1)); + chunks_index.append(bsoncxx::v_noabi::builder::basic::kvp("n", 1)); options::index chunks_index_options; chunks_index_options.unique(true); 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 fe0264be46..49b3390d37 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp @@ -28,14 +28,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { downloader::downloader(stdx::optional chunks, chunks_and_bytes_offset start, std::int32_t chunk_size, std::int64_t file_len, - bsoncxx::document::value files_doc) + bsoncxx::v_noabi::document::value files_doc) : _impl{stdx::make_unique( std::move(chunks), start, chunk_size, file_len, std::move(files_doc))} {} @@ -95,7 +95,7 @@ std::int64_t downloader::file_length() const { return _get_impl().file_len; } -bsoncxx::document::view downloader::files_document() const { +bsoncxx::v_noabi::document::view downloader::files_document() const { return _get_impl().files_doc.view(); } @@ -115,10 +115,10 @@ void downloader::fetch_chunk() { chunks_seen = _get_impl().start.chunks_offset; } - bsoncxx::document::view chunk_doc = **_get_impl().chunks_curr; + bsoncxx::v_noabi::document::view chunk_doc = **_get_impl().chunks_curr; auto chunk_n_ele = chunk_doc["n"]; - if (!chunk_n_ele || chunk_n_ele.type() != bsoncxx::type::k_int32 || + if (!chunk_n_ele || chunk_n_ele.type() != bsoncxx::v_noabi::type::k_int32 || chunk_n_ele.get_int32().value != chunks_seen) { std::ostringstream err; err << "chunk #" << chunks_seen << ": expected to find field \"n\" with k_int32 type"; @@ -130,7 +130,7 @@ void downloader::fetch_chunk() { } auto chunk_data_ele = chunk_doc["data"]; - if (!chunk_data_ele || chunk_data_ele.type() != bsoncxx::type::k_binary) { + if (!chunk_data_ele || chunk_data_ele.type() != bsoncxx::v_noabi::type::k_binary) { std::ostringstream err; err << "chunk #" << chunks_seen << ": expected to find field \"data\" with k_binary type"; throw gridfs_exception{error_code::k_gridfs_file_corrupted, err.str()}; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/bucket.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/bucket.hh index c64dbf5988..a9a2e3cdc2 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/bucket.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/bucket.hh @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { class bucket::impl { 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 87f7d4e4c8..8166f28b62 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { class downloader::impl { @@ -33,7 +33,7 @@ class downloader::impl { chunks_and_bytes_offset start_param, std::int32_t chunk_size_param, std::int64_t file_len_param, - bsoncxx::document::value files_doc_param) + bsoncxx::v_noabi::document::value files_doc_param) : files_doc{std::move(files_doc_param)}, chunk_buffer_len{0}, chunk_buffer_offset{0}, @@ -67,7 +67,7 @@ class downloader::impl { } // The files document for the file being downloaded. - bsoncxx::document::value files_doc; + bsoncxx::v_noabi::document::value files_doc; // The number of bytes in the current chunk. std::size_t chunk_buffer_len; 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 6ddb134978..51739f5875 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { class uploader::impl { @@ -35,7 +35,7 @@ class uploader::impl { collection files, collection chunks, std::int32_t chunk_size, - stdx::optional metadata) + stdx::optional metadata) : session{session}, buffer{stdx::make_unique(static_cast(chunk_size))}, buffer_off{0}, @@ -43,7 +43,7 @@ class uploader::impl { chunk_size{chunk_size}, chunks_written{0}, closed{false}, - filename{bsoncxx::string::to_string(filename)}, + filename{bsoncxx::v_noabi::string::to_string(filename)}, files{std::move(files)}, metadata{std::move(metadata)}, result{std::move(result)} {} @@ -61,7 +61,7 @@ class uploader::impl { collection chunks; // Chunks that have been fully written but not yet uploaded to the server. - std::vector chunks_collection_documents; + std::vector chunks_collection_documents; // The size of a chunk in bytes. std::int32_t chunk_size; @@ -79,7 +79,7 @@ class uploader::impl { collection files; // User-specified metadata for the file. - stdx::optional metadata; + 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 2c6abf883f..17cc33a418 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp @@ -29,33 +29,36 @@ #include namespace { + std::size_t chunks_collection_documents_max_length(std::size_t chunk_size) { // 16 * 1000 * 1000 is used instead of 16 * 1024 * 1024 to ensure that the command document sent // to the server has space for the other fields. return 16 * 1000 * 1000 / chunk_size; } + } // namespace namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace gridfs { uploader::uploader(const client_session* session, - bsoncxx::types::bson_value::view id, + bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, collection files, collection chunks, std::int32_t chunk_size, - stdx::optional metadata) + stdx::optional metadata) : _impl{stdx::make_unique(session, id, filename, files, chunks, chunk_size, - metadata ? stdx::make_optional( - bsoncxx::document::value{metadata->view()}) - : stdx::nullopt)} {} + metadata + ? stdx::make_optional( + bsoncxx::v_noabi::document::value{metadata->view()}) + : stdx::nullopt)} {} uploader::uploader() noexcept = default; uploader::uploader(uploader&&) noexcept = default; @@ -88,7 +91,7 @@ void uploader::write(const std::uint8_t* bytes, std::size_t length) { } result::gridfs::upload uploader::close() { - using bsoncxx::builder::basic::kvp; + using bsoncxx::v_noabi::builder::basic::kvp; if (_get_impl().closed) { throw logic_error{error_code::k_gridfs_stream_not_open}; @@ -96,7 +99,7 @@ result::gridfs::upload uploader::close() { _get_impl().closed = true; - bsoncxx::builder::basic::document file; + bsoncxx::v_noabi::builder::basic::document file; std::int64_t bytes_uploaded = static_cast(_get_impl().chunks_written) * static_cast(_get_impl().chunk_size); @@ -108,7 +111,8 @@ result::gridfs::upload uploader::close() { file.append(kvp("_id", _get_impl().result.id())); file.append(kvp("length", bytes_uploaded + leftover)); file.append(kvp("chunkSize", _get_impl().chunk_size)); - file.append(kvp("uploadDate", bsoncxx::types::b_date{std::chrono::system_clock::now()})); + file.append( + kvp("uploadDate", bsoncxx::v_noabi::types::b_date{std::chrono::system_clock::now()})); file.append(kvp("filename", _get_impl().filename)); if (_get_impl().metadata) { @@ -131,8 +135,8 @@ void uploader::abort() { _get_impl().closed = true; - bsoncxx::builder::basic::document filter; - filter.append(bsoncxx::builder::basic::kvp("files_id", _get_impl().result.id())); + bsoncxx::v_noabi::builder::basic::document filter; + filter.append(bsoncxx::v_noabi::builder::basic::kvp("files_id", _get_impl().result.id())); if (_get_impl().session) { _get_impl().chunks.delete_many(*_get_impl().session, filter.extract()); @@ -146,13 +150,13 @@ std::int32_t uploader::chunk_size() const { } void uploader::finish_chunk() { - using bsoncxx::builder::basic::kvp; + using bsoncxx::v_noabi::builder::basic::kvp; if (!_get_impl().buffer_off) { return; } - bsoncxx::builder::basic::document chunk; + bsoncxx::v_noabi::builder::basic::document chunk; std::size_t bytes_in_chunk = _get_impl().buffer_off; @@ -165,9 +169,9 @@ void uploader::finish_chunk() { ++_get_impl().chunks_written; - bsoncxx::types::b_binary data{bsoncxx::binary_sub_type::k_binary, - static_cast(bytes_in_chunk), - _get_impl().buffer.get()}; + bsoncxx::v_noabi::types::b_binary data{bsoncxx::v_noabi::binary_sub_type::k_binary, + static_cast(bytes_in_chunk), + _get_impl().buffer.get()}; chunk.append(kvp("data", data)); _get_impl().chunks_collection_documents.push_back(chunk.extract()); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/hint.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/hint.cpp index 2a31fbd8f2..987afc9a27 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/hint.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/hint.cpp @@ -19,22 +19,25 @@ #include -using bsoncxx::builder::concatenate; -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::sub_document; +using bsoncxx::v_noabi::builder::concatenate; +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::sub_document; namespace mongocxx { -inline namespace v_noabi { -hint::hint(bsoncxx::document::view_or_value index) : _index_doc(std::move(index)) {} +namespace v_noabi { -hint::hint(bsoncxx::string::view_or_value index) : _index_string(std::move(index)) {} +hint::hint(bsoncxx::v_noabi::document::view_or_value index) : _index_doc(std::move(index)) {} -bsoncxx::types::bson_value::view hint::to_value() const { +hint::hint(bsoncxx::v_noabi::string::view_or_value index) : _index_string(std::move(index)) {} + +bsoncxx::v_noabi::types::bson_value::view hint::to_value() const { if (_index_doc) { - return bsoncxx::types::bson_value::view{bsoncxx::types::b_document{_index_doc->view()}}; + return bsoncxx::v_noabi::types::bson_value::view{ + bsoncxx::v_noabi::types::b_document{_index_doc->view()}}; } - return bsoncxx::types::bson_value::view{bsoncxx::types::b_string{*_index_string}}; + return bsoncxx::v_noabi::types::bson_value::view{ + bsoncxx::v_noabi::types::b_string{*_index_string}}; } bool MONGOCXX_CALL operator==(const hint& index_hint, std::string index) { @@ -53,19 +56,19 @@ bool MONGOCXX_CALL operator!=(std::string index, const hint& index_hint) { return !(index_hint == index); } -bool MONGOCXX_CALL operator==(const hint& index_hint, bsoncxx::document::view index) { +bool MONGOCXX_CALL operator==(const hint& index_hint, bsoncxx::v_noabi::document::view index) { return index_hint._index_doc && index_hint._index_doc->view() == index; } -bool MONGOCXX_CALL operator==(bsoncxx::document::view index, const hint& index_hint) { +bool MONGOCXX_CALL operator==(bsoncxx::v_noabi::document::view index, const hint& index_hint) { return index_hint == index; } -bool MONGOCXX_CALL operator!=(const hint& index_hint, bsoncxx::document::view index) { +bool MONGOCXX_CALL operator!=(const hint& index_hint, bsoncxx::v_noabi::document::view index) { return !(index_hint == index); } -bool MONGOCXX_CALL operator!=(bsoncxx::document::view index, const hint& index_hint) { +bool MONGOCXX_CALL operator!=(bsoncxx::v_noabi::document::view index, const hint& index_hint) { return !(index_hint == index); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_model.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_model.cpp index f31a276d25..efcbb3a4cc 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_model.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_model.cpp @@ -17,9 +17,10 @@ #include namespace mongocxx { -inline namespace v_noabi { -index_model::index_model(const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& options) +namespace v_noabi { + +index_model::index_model(const bsoncxx::v_noabi::document::view_or_value& keys, + const bsoncxx::v_noabi::document::view_or_value& options) : _keys{keys.view()}, _options{options.view()} {} index_model::index_model(index_model&&) noexcept = default; @@ -30,11 +31,11 @@ index_model::index_model(const index_model&) = default; index_model::~index_model() = default; -bsoncxx::document::view index_model::keys() const { +bsoncxx::v_noabi::document::view index_model::keys() const { return _keys.view(); } -bsoncxx::document::view index_model::options() const { +bsoncxx::v_noabi::document::view index_model::options() const { return _options.view(); } 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 eaed7e3ff8..f4a7b29d19 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp @@ -23,7 +23,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + index_view::index_view(void* coll, void* client) : _impl{stdx::make_unique(static_cast(coll), static_cast(client))} {} @@ -40,74 +41,76 @@ cursor index_view::list(const client_session& session) { return _get_impl().list(&session); } -bsoncxx::stdx::optional index_view::create_one( - const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options, +bsoncxx::v_noabi::stdx::optional index_view::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) { return create_one(index_model{keys, index_options}, options); } -bsoncxx::stdx::optional index_view::create_one( +bsoncxx::v_noabi::stdx::optional index_view::create_one( const client_session& session, - const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options, + const bsoncxx::v_noabi::document::view_or_value& keys, + const bsoncxx::v_noabi::document::view_or_value& index_options, const options::index_view& options) { return create_one(session, index_model{keys, index_options}, options); } -bsoncxx::stdx::optional index_view::create_one(const index_model& model, - const options::index_view& options) { +bsoncxx::v_noabi::stdx::optional index_view::create_one( + const index_model& model, const options::index_view& options) { return _get_impl().create_one(nullptr, model, options); } -bsoncxx::stdx::optional index_view::create_one(const client_session& session, - const index_model& model, - const options::index_view& options) { +bsoncxx::v_noabi::stdx::optional index_view::create_one( + const client_session& session, const index_model& model, const options::index_view& options) { return _get_impl().create_one(&session, model, options); } -bsoncxx::document::value index_view::create_many(const std::vector& indexes, - const options::index_view& options) { +bsoncxx::v_noabi::document::value index_view::create_many(const std::vector& indexes, + const options::index_view& options) { return _get_impl().create_many(nullptr, indexes, options); } -bsoncxx::document::value index_view::create_many(const client_session& session, - const std::vector& indexes, - const options::index_view& options) { +bsoncxx::v_noabi::document::value index_view::create_many(const client_session& session, + const std::vector& indexes, + const options::index_view& options) { return _get_impl().create_many(&session, indexes, options); } -void index_view::drop_one(bsoncxx::stdx::string_view name, const options::index_view& options) { +void index_view::drop_one(bsoncxx::v_noabi::stdx::string_view name, + const options::index_view& options) { return _get_impl().drop_one(nullptr, name, options); } void index_view::drop_one(const client_session& session, - bsoncxx::stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, const options::index_view& options) { return _get_impl().drop_one(&session, name, options); } -void index_view::drop_one(const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options, +void index_view::drop_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) { - bsoncxx::document::view opts_view = index_options.view(); + bsoncxx::v_noabi::document::view opts_view = index_options.view(); if (opts_view["name"]) { - drop_one(bsoncxx::string::to_string(opts_view["name"].get_string().value), options); + drop_one(bsoncxx::v_noabi::string::to_string(opts_view["name"].get_string().value), + options); } else { drop_one(_get_impl().get_index_name_from_keys(keys), options); } } void index_view::drop_one(const client_session& session, - const bsoncxx::document::view_or_value& keys, - const bsoncxx::document::view_or_value& index_options, + const bsoncxx::v_noabi::document::view_or_value& keys, + const bsoncxx::v_noabi::document::view_or_value& index_options, const options::index_view& options) { - bsoncxx::document::view opts_view = index_options.view(); + bsoncxx::v_noabi::document::view opts_view = index_options.view(); if (opts_view["name"]) { - drop_one( - session, bsoncxx::string::to_string(opts_view["name"].get_string().value), options); + drop_one(session, + bsoncxx::v_noabi::string::to_string(opts_view["name"].get_string().value), + options); } else { drop_one(session, _get_impl().get_index_name_from_keys(keys), options); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp index 0d366226eb..22543748f6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp @@ -31,7 +31,8 @@ #endif namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + namespace { log_level convert_log_level(::mongoc_log_level_t mongoc_log_level) { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp index 114d8d085e..1741fea843 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/logger.cpp @@ -17,7 +17,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + stdx::string_view MONGOCXX_CALL to_string(log_level level) { switch (level) { case log_level::k_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 48938044fb..f237768cf3 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 @@ -17,30 +17,31 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { -delete_many::delete_many(bsoncxx::document::view_or_value filter) : _filter(std::move(filter)) {} +delete_many::delete_many(bsoncxx::v_noabi::document::view_or_value filter) + : _filter(std::move(filter)) {} -const bsoncxx::document::view_or_value& delete_many::filter() const { +const bsoncxx::v_noabi::document::view_or_value& delete_many::filter() const { return _filter; } -delete_many& delete_many::collation(bsoncxx::document::view_or_value collation) { +delete_many& delete_many::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = collation; return *this; } -delete_many& delete_many::hint(mongocxx::hint index_hint) { +delete_many& delete_many::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -const stdx::optional& delete_many::hint() const { +const stdx::optional& delete_many::hint() const { return _hint; } -const stdx::optional& delete_many::collation() const { +const 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 7f1af92e19..dbfcd704e5 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 @@ -17,30 +17,31 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { -delete_one::delete_one(bsoncxx::document::view_or_value filter) : _filter(std::move(filter)) {} +delete_one::delete_one(bsoncxx::v_noabi::document::view_or_value filter) + : _filter(std::move(filter)) {} -const bsoncxx::document::view_or_value& delete_one::filter() const { +const bsoncxx::v_noabi::document::view_or_value& delete_one::filter() const { return _filter; } -delete_one& delete_one::collation(bsoncxx::document::view_or_value collation) { +delete_one& delete_one::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = collation; return *this; } -const stdx::optional& delete_one::collation() const { +const stdx::optional& delete_one::collation() const { return _collation; } -delete_one& delete_one::hint(mongocxx::hint index_hint) { +delete_one& delete_one::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -const stdx::optional& delete_one::hint() const { +const stdx::optional& delete_one::hint() const { return _hint; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/insert_one.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/insert_one.cpp index aa59972349..64cc7d9782 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/insert_one.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/insert_one.cpp @@ -17,13 +17,13 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { -insert_one::insert_one(bsoncxx::document::view_or_value document) +insert_one::insert_one(bsoncxx::v_noabi::document::view_or_value document) : _document(std::move(document)) {} -const bsoncxx::document::view_or_value& insert_one::document() const { +const bsoncxx::v_noabi::document::view_or_value& insert_one::document() const { return _document; } 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 e2df59784a..1ccdad26f3 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 @@ -17,27 +17,27 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { -replace_one::replace_one(bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value replacement) +replace_one::replace_one(bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value replacement) : _filter(std::move(filter)), _replacement(std::move(replacement)) {} -const bsoncxx::document::view_or_value& replace_one::filter() const { +const bsoncxx::v_noabi::document::view_or_value& replace_one::filter() const { return _filter; } -const bsoncxx::document::view_or_value& replace_one::replacement() const { +const bsoncxx::v_noabi::document::view_or_value& replace_one::replacement() const { return _replacement; } -replace_one& replace_one::collation(bsoncxx::document::view_or_value collation) { +replace_one& replace_one::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = collation; return *this; } -const stdx::optional& replace_one::collation() const { +const stdx::optional& replace_one::collation() const { return _collation; } @@ -51,12 +51,12 @@ const stdx::optional& replace_one::upsert() const { return _upsert; } -replace_one& replace_one::hint(mongocxx::hint index_hint) { +replace_one& replace_one::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -const stdx::optional& replace_one::hint() const { +const 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 a1c28780c0..b7541512e8 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 @@ -18,43 +18,43 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { -update_many::update_many(bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update) +update_many::update_many(bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update) : _filter(std::move(filter)), _update(std::move(update)) {} -update_many::update_many(bsoncxx::document::view_or_value filter, const pipeline& update) - : _filter(std::move(filter)), _update(bsoncxx::document::value(update.view_array())) {} +update_many::update_many(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update) + : _filter(std::move(filter)), _update(bsoncxx::v_noabi::document::value(update.view_array())) {} -update_many::update_many(bsoncxx::document::view_or_value filter, +update_many::update_many(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag>) : _filter(std::move(filter)), _update() {} -const bsoncxx::document::view_or_value& update_many::filter() const { +const bsoncxx::v_noabi::document::view_or_value& update_many::filter() const { return _filter; } -const bsoncxx::document::view_or_value& update_many::update() const { +const bsoncxx::v_noabi::document::view_or_value& update_many::update() const { return _update; } -update_many& update_many::collation(bsoncxx::document::view_or_value collation) { +update_many& update_many::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = collation; return *this; } -const stdx::optional& update_many::collation() const { +const stdx::optional& update_many::collation() const { return _collation; } -update_many& update_many::hint(mongocxx::hint index_hint) { +update_many& update_many::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -const stdx::optional& update_many::hint() const { +const stdx::optional& update_many::hint() const { return _hint; } @@ -67,12 +67,12 @@ const stdx::optional& update_many::upsert() const { return _upsert; } -update_many& update_many::array_filters(bsoncxx::array::view_or_value array_filters) { +update_many& update_many::array_filters(bsoncxx::v_noabi::array::view_or_value array_filters) { _array_filters = std::move(array_filters); return *this; } -const stdx::optional& update_many::array_filters() const { +const 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 9c7c50dbb1..cd9c251ad6 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 @@ -18,43 +18,43 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { -update_one::update_one(bsoncxx::document::view_or_value filter, - bsoncxx::document::view_or_value update) +update_one::update_one(bsoncxx::v_noabi::document::view_or_value filter, + bsoncxx::v_noabi::document::view_or_value update) : _filter(std::move(filter)), _update(std::move(update)) {} -update_one::update_one(bsoncxx::document::view_or_value filter, const pipeline& update) - : _filter(std::move(filter)), _update(bsoncxx::document::value(update.view_array())) {} +update_one::update_one(bsoncxx::v_noabi::document::view_or_value filter, const pipeline& update) + : _filter(std::move(filter)), _update(bsoncxx::v_noabi::document::value(update.view_array())) {} -update_one::update_one(bsoncxx::document::view_or_value filter, +update_one::update_one(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag>) : _filter(std::move(filter)), _update() {} -const bsoncxx::document::view_or_value& update_one::filter() const { +const bsoncxx::v_noabi::document::view_or_value& update_one::filter() const { return _filter; } -const bsoncxx::document::view_or_value& update_one::update() const { +const bsoncxx::v_noabi::document::view_or_value& update_one::update() const { return _update; } -update_one& update_one::collation(bsoncxx::document::view_or_value collation) { +update_one& update_one::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = collation; return *this; } -const stdx::optional& update_one::collation() const { +const stdx::optional& update_one::collation() const { return _collation; } -update_one& update_one::hint(mongocxx::hint index_hint) { +update_one& update_one::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -const stdx::optional& update_one::hint() const { +const stdx::optional& update_one::hint() const { return _hint; } @@ -67,12 +67,12 @@ const stdx::optional& update_one::upsert() const { return _upsert; } -update_one& update_one::array_filters(bsoncxx::array::view_or_value array_filters) { +update_one& update_one::array_filters(bsoncxx::v_noabi::array::view_or_value array_filters) { _array_filters = std::move(array_filters); return *this; } -const stdx::optional& update_one::array_filters() const { +const stdx::optional& update_one::array_filters() const { return _array_filters; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/write.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/write.cpp index c54d57d281..85ffdc1b8a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/write.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/model/write.cpp @@ -19,7 +19,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace model { write::write(insert_one value) : _type(write_type::k_insert_one), _insert_one(std::move(value)) { 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 d1247ac3d3..f401a911e1 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/aggregate.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/aggregate.cpp @@ -20,26 +20,26 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -using bsoncxx::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::kvp; aggregate& aggregate::allow_disk_use(bool allow_disk_use) { _allow_disk_use = allow_disk_use; return *this; } -void aggregate::append(bsoncxx::builder::basic::document& builder) const { +void aggregate::append(bsoncxx::v_noabi::builder::basic::document& builder) const { append_aggregate_options(builder, *this); } -aggregate& aggregate::collation(bsoncxx::document::view_or_value collation) { +aggregate& aggregate::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -aggregate& aggregate::let(bsoncxx::document::view_or_value let) { +aggregate& aggregate::let(bsoncxx::v_noabi::document::view_or_value let) { _let = std::move(let); return *this; } @@ -54,7 +54,7 @@ aggregate& aggregate::max_time(std::chrono::milliseconds max_time) { return *this; } -aggregate& aggregate::read_preference(mongocxx::read_preference rp) { +aggregate& aggregate::read_preference(mongocxx::v_noabi::read_preference rp) { _read_preference = std::move(rp); return *this; } @@ -64,22 +64,22 @@ aggregate& aggregate::bypass_document_validation(bool bypass_document_validation return *this; } -aggregate& aggregate::hint(mongocxx::hint index_hint) { +aggregate& aggregate::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -aggregate& aggregate::read_concern(mongocxx::read_concern read_concern) { +aggregate& aggregate::read_concern(mongocxx::v_noabi::read_concern read_concern) { _read_concern = std::move(read_concern); return *this; } -aggregate& aggregate::write_concern(mongocxx::write_concern write_concern) { +aggregate& aggregate::write_concern(mongocxx::v_noabi::write_concern write_concern) { _write_concern = std::move(write_concern); return *this; } -aggregate& aggregate::comment(bsoncxx::types::bson_value::view_or_value comment) { +aggregate& aggregate::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -92,11 +92,11 @@ const stdx::optional& aggregate::batch_size() const { return _batch_size; } -const stdx::optional& aggregate::collation() const { +const stdx::optional& aggregate::collation() const { return _collation; } -const stdx::optional& aggregate::let() const { +const stdx::optional& aggregate::let() const { return _let; } @@ -104,7 +104,7 @@ const stdx::optional& aggregate::max_time() const { return _max_time; } -const stdx::optional& aggregate::read_preference() const { +const stdx::optional& aggregate::read_preference() const { return _read_preference; } @@ -112,19 +112,20 @@ const stdx::optional& aggregate::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& aggregate::hint() const { +const stdx::optional& aggregate::hint() const { return _hint; } -const stdx::optional& aggregate::read_concern() const { +const stdx::optional& aggregate::read_concern() const { return _read_concern; } -const stdx::optional& aggregate::write_concern() const { +const stdx::optional& aggregate::write_concern() const { return _write_concern; } -const stdx::optional& aggregate::comment() const { +const stdx::optional& aggregate::comment() + const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/apm.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/apm.cpp index 46b9770ba7..4a3f6e274e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/apm.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/apm.cpp @@ -17,138 +17,126 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { apm& apm::on_command_started( - std::function command_started) { + std::function command_started) { _command_started = std::move(command_started); return *this; } -const std::function& apm::command_started() - const { +const std::function& apm::command_started() const { return _command_started; } apm& apm::on_command_failed( - std::function command_failed) { + std::function command_failed) { _command_failed = std::move(command_failed); return *this; } -const std::function& apm::command_failed() - const { +const std::function& apm::command_failed() const { return _command_failed; } apm& apm::on_command_succeeded( - std::function command_succeeded) { + std::function command_succeeded) { _command_succeeded = std::move(command_succeeded); return *this; } -const std::function& -apm::command_succeeded() const { +const std::function& apm::command_succeeded() const { return _command_succeeded; } apm& apm::on_server_opening( - std::function server_opening) { + std::function server_opening) { _server_opening = server_opening; return *this; } -const std::function& apm::server_opening() - const { +const std::function& apm::server_opening() const { return _server_opening; } -apm& apm::on_server_closed( - std::function server_closed) { +apm& apm::on_server_closed(std::function server_closed) { _server_closed = server_closed; return *this; } -const std::function& apm::server_closed() - const { +const std::function& apm::server_closed() const { return _server_closed; } apm& apm::on_server_changed( - std::function server_changed) { + std::function server_changed) { _server_changed = server_changed; return *this; } -const std::function& apm::server_changed() - const { +const std::function& apm::server_changed() const { return _server_changed; } apm& apm::on_topology_opening( - std::function topology_opening) { + std::function topology_opening) { _topology_opening = topology_opening; return *this; } -const std::function& apm::topology_opening() - const { +const std::function& apm::topology_opening() const { return _topology_opening; } apm& apm::on_topology_closed( - std::function topology_closed) { + std::function topology_closed) { _topology_closed = topology_closed; return *this; } -const std::function& apm::topology_closed() - const { +const std::function& apm::topology_closed() const { return _topology_closed; } apm& apm::on_topology_changed( - std::function topology_changed) { + std::function topology_changed) { _topology_changed = topology_changed; return *this; } -const std::function& apm::topology_changed() - const { +const std::function& apm::topology_changed() const { return _topology_changed; } apm& apm::on_heartbeat_started( - std::function heartbeat_started) { + std::function heartbeat_started) { _heartbeat_started = std::move(heartbeat_started); return *this; } -const std::function& -apm::heartbeat_started() const { +const std::function& apm::heartbeat_started() const { return _heartbeat_started; } apm& apm::on_heartbeat_failed( - std::function heartbeat_failed) { + std::function heartbeat_failed) { _heartbeat_failed = std::move(heartbeat_failed); return *this; } -const std::function& apm::heartbeat_failed() - const { +const std::function& apm::heartbeat_failed() const { return _heartbeat_failed; } apm& apm::on_heartbeat_succeeded( - std::function heartbeat_succeeded) { + std::function heartbeat_succeeded) { _heartbeat_succeeded = std::move(heartbeat_succeeded); return *this; } -const std::function& -apm::heartbeat_succeeded() const { +const std::function& apm::heartbeat_succeeded() + const { return _heartbeat_succeeded; } 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 b3f1c9ae50..8b12b2bdd3 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 @@ -25,26 +25,26 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { auto_encryption::auto_encryption() noexcept : _bypass(false), _bypass_query_analysis(false) {} -auto_encryption& auto_encryption::key_vault_client(mongocxx::client* client) { +auto_encryption& auto_encryption::key_vault_client(mongocxx::v_noabi::client* client) { _key_vault_client = client; return *this; } -const stdx::optional& auto_encryption::key_vault_client() const { +const stdx::optional& auto_encryption::key_vault_client() const { return _key_vault_client; } -auto_encryption& auto_encryption::key_vault_pool(mongocxx::pool* pool) { +auto_encryption& auto_encryption::key_vault_pool(mongocxx::v_noabi::pool* pool) { _key_vault_pool = pool; return *this; } -const stdx::optional& auto_encryption::key_vault_pool() const { +const stdx::optional& auto_encryption::key_vault_pool() const { return _key_vault_pool; } @@ -57,41 +57,44 @@ const stdx::optional& auto_encryption::key_vault_names return _key_vault_namespace; } -auto_encryption& auto_encryption::kms_providers(bsoncxx::document::view_or_value kms_providers) { +auto_encryption& auto_encryption::kms_providers( + bsoncxx::v_noabi::document::view_or_value kms_providers) { _kms_providers = std::move(kms_providers); return *this; } -const stdx::optional& auto_encryption::kms_providers() const { +const stdx::optional& auto_encryption::kms_providers() + const { return _kms_providers; } -auto_encryption& auto_encryption::tls_opts(bsoncxx::document::view_or_value tls_opts) { +auto_encryption& auto_encryption::tls_opts(bsoncxx::v_noabi::document::view_or_value tls_opts) { _tls_opts = std::move(tls_opts); return *this; } -const stdx::optional& auto_encryption::tls_opts() const { +const stdx::optional& auto_encryption::tls_opts() const { return _tls_opts; } -auto_encryption& auto_encryption::schema_map(bsoncxx::document::view_or_value schema_map) { +auto_encryption& auto_encryption::schema_map(bsoncxx::v_noabi::document::view_or_value schema_map) { _schema_map = std::move(schema_map); return *this; } -const stdx::optional& auto_encryption::schema_map() const { +const stdx::optional& auto_encryption::schema_map() + const { return _schema_map; } auto_encryption& auto_encryption::encrypted_fields_map( - bsoncxx::document::view_or_value encrypted_fields_map) { + bsoncxx::v_noabi::document::view_or_value encrypted_fields_map) { _encrypted_fields_map = std::move(encrypted_fields_map); return *this; } -const stdx::optional& auto_encryption::encrypted_fields_map() - const { +const stdx::optional& +auto_encryption::encrypted_fields_map() const { return _encrypted_fields_map; } @@ -113,12 +116,13 @@ bool auto_encryption::bypass_query_analysis() const { return _bypass_query_analysis; } -auto_encryption& auto_encryption::extra_options(bsoncxx::document::view_or_value extra) { +auto_encryption& auto_encryption::extra_options(bsoncxx::v_noabi::document::view_or_value extra) { _extra_options = std::move(extra); return *this; } -const stdx::optional& auto_encryption::extra_options() const { +const 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 ded6e9212d..6cf5d7b275 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 @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { bulk_write::bulk_write() : _ordered(true) {} @@ -31,12 +31,12 @@ bool bulk_write::ordered() const { return _ordered; } -bulk_write& bulk_write::write_concern(mongocxx::write_concern wc) { +bulk_write& bulk_write::write_concern(mongocxx::v_noabi::write_concern wc) { _write_concern = std::move(wc); return *this; } -const stdx::optional& bulk_write::write_concern() const { +const stdx::optional& bulk_write::write_concern() const { return _write_concern; } @@ -49,21 +49,22 @@ const stdx::optional bulk_write::bypass_document_validation() const { return _bypass_document_validation; } -bulk_write& bulk_write::let(bsoncxx::document::view_or_value let) { +bulk_write& bulk_write::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } -const stdx::optional bulk_write::let() const { +const stdx::optional bulk_write::let() const { return _let; } -bulk_write& bulk_write::comment(bsoncxx::types::bson_value::view_or_value comment) { +bulk_write& bulk_write::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } -const stdx::optional bulk_write::comment() const { +const 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 9c6ecf7642..8613f85255 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 @@ -22,28 +22,28 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { change_stream::change_stream() = default; -change_stream& change_stream::full_document(bsoncxx::string::view_or_value full_doc) { +change_stream& change_stream::full_document(bsoncxx::v_noabi::string::view_or_value full_doc) { _full_document = std::move(full_doc); return *this; } -const bsoncxx::stdx::optional& change_stream::full_document() - const { +const bsoncxx::v_noabi::stdx::optional& +change_stream::full_document() const { return _full_document; } change_stream& change_stream::full_document_before_change( - bsoncxx::string::view_or_value full_doc_before_change) { + bsoncxx::v_noabi::string::view_or_value full_doc_before_change) { _full_document_before_change = std::move(full_doc_before_change); return *this; } -const bsoncxx::stdx::optional& +const bsoncxx::v_noabi::stdx::optional& change_stream::full_document_before_change() const { return _full_document_before_change; } @@ -57,39 +57,42 @@ const stdx::optional& change_stream::batch_size() const { return _batch_size; } -change_stream& change_stream::comment(bsoncxx::types::bson_value::view_or_value comment) { +change_stream& change_stream::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } -const stdx::optional& change_stream::comment() const { +const stdx::optional& change_stream::comment() + const { return _comment; } -change_stream& change_stream::resume_after(bsoncxx::document::view_or_value resume_after) { +change_stream& change_stream::resume_after(bsoncxx::v_noabi::document::view_or_value resume_after) { _resume_after = std::move(resume_after); return *this; } -const stdx::optional& change_stream::resume_after() const { +const stdx::optional& change_stream::resume_after() + const { return _resume_after; } -change_stream& change_stream::start_after(bsoncxx::document::view_or_value token) { +change_stream& change_stream::start_after(bsoncxx::v_noabi::document::view_or_value token) { _start_after = std::move(token); return *this; } -const stdx::optional& change_stream::start_after() const { +const stdx::optional& change_stream::start_after() + const { return _start_after; } -change_stream& change_stream::collation(bsoncxx::document::view_or_value collation) { +change_stream& change_stream::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -const stdx::optional& change_stream::collation() const { +const stdx::optional& change_stream::collation() const { return _collation; } @@ -102,7 +105,8 @@ const stdx::optional& change_stream::max_await_time() return _max_await_time; } -change_stream& change_stream::start_at_operation_time(bsoncxx::types::b_timestamp timestamp) { +change_stream& change_stream::start_at_operation_time( + bsoncxx::v_noabi::types::b_timestamp timestamp) { _start_at_operation_time = timestamp; _start_at_operation_time_set = true; return *this; @@ -110,18 +114,18 @@ change_stream& change_stream::start_at_operation_time(bsoncxx::types::b_timestam namespace { template -inline void append_if(bsoncxx::builder::basic::document& doc, +inline void append_if(bsoncxx::v_noabi::builder::basic::document& doc, const std::string& key, - const mongocxx::stdx::optional& opt) { + const bsoncxx::v_noabi::stdx::optional& opt) { if (opt) { - doc.append(bsoncxx::builder::basic::kvp(key, opt.value())); + doc.append(bsoncxx::v_noabi::builder::basic::kvp(key, opt.value())); } } } // namespace -bsoncxx::document::value change_stream::as_bson() const { +bsoncxx::v_noabi::document::value change_stream::as_bson() const { // Construct new bson rep each time since values may change after this is called. - bsoncxx::builder::basic::document out{}; + bsoncxx::v_noabi::builder::basic::document out{}; append_if(out, "fullDocument", full_document()); append_if(out, "fullDocumentBeforeChange", full_document_before_change()); @@ -131,16 +135,18 @@ bsoncxx::document::value change_stream::as_bson() const { append_if(out, "collation", collation()); append_if(out, "comment", comment()); if (_start_at_operation_time_set) { - out.append(bsoncxx::builder::basic::kvp("startAtOperationTime", _start_at_operation_time)); + out.append(bsoncxx::v_noabi::builder::basic::kvp("startAtOperationTime", + _start_at_operation_time)); } if (max_await_time()) { auto count = max_await_time().value().count(); if ((count < 0) || (count >= std::numeric_limits::max())) { - throw mongocxx::logic_error{mongocxx::error_code::k_invalid_parameter}; + throw mongocxx::v_noabi::logic_error{ + mongocxx::v_noabi::error_code::k_invalid_parameter}; } - out.append( - bsoncxx::builder::basic::kvp("maxAwaitTimeMS", static_cast(count))); + out.append(bsoncxx::v_noabi::builder::basic::kvp("maxAwaitTimeMS", + static_cast(count))); } return out.extract(); 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 f66812f895..86a27febfd 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/client.cpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { client& client::tls_opts(tls tls_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 faa4e46a7c..d691e2338c 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 @@ -21,15 +21,15 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -client_encryption& client_encryption::key_vault_client(mongocxx::client* client) { +client_encryption& client_encryption::key_vault_client(mongocxx::v_noabi::client* client) { _key_vault_client = client; return *this; } -const stdx::optional& client_encryption::key_vault_client() const { +const stdx::optional& client_encryption::key_vault_client() const { return _key_vault_client; } @@ -43,21 +43,23 @@ const stdx::optional& client_encryption::key_vault_n } client_encryption& client_encryption::kms_providers( - bsoncxx::document::view_or_value kms_providers) { + bsoncxx::v_noabi::document::view_or_value kms_providers) { _kms_providers = std::move(kms_providers); return *this; } -const stdx::optional& client_encryption::kms_providers() const { +const stdx::optional& client_encryption::kms_providers() + const { return _kms_providers; } -client_encryption& client_encryption::tls_opts(bsoncxx::document::view_or_value tls_opts) { +client_encryption& client_encryption::tls_opts(bsoncxx::v_noabi::document::view_or_value tls_opts) { _tls_opts = std::move(tls_opts); return *this; } -const stdx::optional& client_encryption::tls_opts() const { +const 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 32180c5320..880cd02d1a 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 @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { client_session& client_session::causal_consistency(bool causal_consistency) noexcept { 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 f9800ec064..ad9ddfb1f4 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/count.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/count.cpp @@ -18,20 +18,20 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -count& count::collation(bsoncxx::document::view_or_value collation) { +count& count::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -count& count::hint(mongocxx::hint index_hint) { +count& count::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -count& count::comment(bsoncxx::types::bson_value::view_or_value comment) { +count& count::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -51,20 +51,20 @@ count& count::skip(std::int64_t skip) { return *this; } -count& count::read_preference(mongocxx::read_preference rp) { +count& count::read_preference(mongocxx::v_noabi::read_preference rp) { _read_preference = std::move(rp); return *this; } -const stdx::optional& count::collation() const { +const stdx::optional& count::collation() const { return _collation; } -const stdx::optional& count::hint() const { +const stdx::optional& count::hint() const { return _hint; } -const stdx::optional& count::comment() const { +const stdx::optional& count::comment() const { return _comment; } 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 84b79c41bd..eb9a41b38e 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 @@ -20,11 +20,11 @@ #include -using bsoncxx::builder::concatenate; -using bsoncxx::builder::basic::kvp; +using bsoncxx::v_noabi::builder::concatenate; +using bsoncxx::v_noabi::builder::basic::kvp; namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { create_collection_deprecated& create_collection_deprecated::capped(bool capped) { @@ -33,7 +33,7 @@ create_collection_deprecated& create_collection_deprecated::capped(bool capped) } create_collection_deprecated& create_collection_deprecated::collation( - bsoncxx::document::view_or_value collation) { + bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } @@ -54,13 +54,13 @@ create_collection_deprecated& create_collection_deprecated::size(std::int64_t ma } create_collection_deprecated& create_collection_deprecated::storage_engine( - bsoncxx::document::view_or_value storage_engine_opts) { + bsoncxx::v_noabi::document::view_or_value storage_engine_opts) { _storage_engine_opts = std::move(storage_engine_opts); return *this; } create_collection_deprecated& create_collection_deprecated::validation_criteria( - mongocxx::validation_criteria validation) { + mongocxx::v_noabi::validation_criteria validation) { _validation = std::move(validation); return *this; } @@ -69,8 +69,8 @@ const stdx::optional& create_collection_deprecated::capped() const { return _capped; } -const stdx::optional& create_collection_deprecated::collation() - const { +const stdx::optional& +create_collection_deprecated::collation() const { return _collation; } @@ -86,25 +86,25 @@ const stdx::optional& create_collection_deprecated::size() const { return _max_size; } -const stdx::optional& +const stdx::optional& create_collection_deprecated::storage_engine() const { return _storage_engine_opts; } -const stdx::optional& +const stdx::optional& create_collection_deprecated::validation_criteria() const { return _validation; } -bsoncxx::document::value create_collection_deprecated::to_document_deprecated() const { - auto doc = bsoncxx::builder::basic::document{}; +bsoncxx::v_noabi::document::value create_collection_deprecated::to_document_deprecated() const { + auto doc = bsoncxx::v_noabi::builder::basic::document{}; if (_capped) { doc.append(kvp("capped", *_capped)); } if (_collation) { - doc.append(kvp("collation", bsoncxx::types::b_document{*_collation})); + doc.append(kvp("collation", bsoncxx::v_noabi::types::b_document{*_collation})); } if (_max_documents) { @@ -120,7 +120,8 @@ bsoncxx::document::value create_collection_deprecated::to_document_deprecated() } if (_storage_engine_opts) { - doc.append(kvp("storageEngine", bsoncxx::types::b_document{*_storage_engine_opts})); + doc.append( + kvp("storageEngine", bsoncxx::v_noabi::types::b_document{*_storage_engine_opts})); } if (_validation) { @@ -130,7 +131,7 @@ bsoncxx::document::value create_collection_deprecated::to_document_deprecated() return doc.extract(); } -bsoncxx::document::value create_collection_deprecated::to_document() const { +bsoncxx::v_noabi::document::value create_collection_deprecated::to_document() const { return to_document_deprecated(); } 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 1e2e52d2bf..3e28896278 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 @@ -19,15 +19,15 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -data_key& data_key::master_key(bsoncxx::document::view_or_value master_key) { +data_key& data_key::master_key(bsoncxx::v_noabi::document::view_or_value master_key) { _master_key = std::move(master_key); return *this; } -const stdx::optional& data_key::master_key() const { +const stdx::optional& data_key::master_key() const { return _master_key; } 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 d9fec2ab8d..aef8b42c8e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/delete.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/delete.cpp @@ -18,51 +18,53 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -delete_options& delete_options::collation(bsoncxx::document::view_or_value collation) { +delete_options& delete_options::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -delete_options& delete_options::write_concern(mongocxx::write_concern wc) { +delete_options& delete_options::write_concern(mongocxx::v_noabi::write_concern wc) { _write_concern = std::move(wc); return *this; } -delete_options& delete_options::hint(mongocxx::hint index_hint) { +delete_options& delete_options::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -const stdx::optional& delete_options::collation() const { +const stdx::optional& delete_options::collation() const { return _collation; } -const stdx::optional& delete_options::write_concern() const { +const stdx::optional& delete_options::write_concern() const { return _write_concern; } -const stdx::optional& delete_options::hint() const { +const stdx::optional& delete_options::hint() const { return _hint; } -delete_options& delete_options::let(bsoncxx::document::view_or_value let) { +delete_options& delete_options::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } -const stdx::optional delete_options::let() const { +const stdx::optional delete_options::let() const { return _let; } -delete_options& delete_options::comment(bsoncxx::types::bson_value::view_or_value comment) { +delete_options& delete_options::comment( + bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } -const stdx::optional delete_options::comment() const { +const 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 b307b2d8eb..6184ed096b 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/distinct.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/distinct.cpp @@ -18,10 +18,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -distinct& distinct::collation(bsoncxx::document::view_or_value collation) { +distinct& distinct::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } @@ -31,17 +31,17 @@ distinct& distinct::max_time(std::chrono::milliseconds max_time) { return *this; } -distinct& distinct::comment(bsoncxx::types::bson_value::view_or_value comment) { +distinct& distinct::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } -distinct& distinct::read_preference(mongocxx::read_preference rp) { +distinct& distinct::read_preference(mongocxx::v_noabi::read_preference rp) { _read_preference = std::move(rp); return *this; } -const stdx::optional& distinct::collation() const { +const stdx::optional& distinct::collation() const { return _collation; } @@ -49,11 +49,12 @@ const stdx::optional& distinct::max_time() const { return _max_time; } -const stdx::optional& distinct::comment() const { +const stdx::optional& distinct::comment() + const { return _comment; } -const stdx::optional& distinct::read_preference() const { +const 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 68025bca13..4c41ff85c3 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/encrypt.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/encrypt.cpp @@ -24,15 +24,15 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -encrypt& encrypt::key_id(bsoncxx::types::bson_value::view_or_value key_id) { +encrypt& encrypt::key_id(bsoncxx::v_noabi::types::bson_value::view_or_value key_id) { _key_id = std::move(key_id); return *this; } -const stdx::optional& encrypt::key_id() const { +const stdx::optional& encrypt::key_id() const { return _key_id; } @@ -110,8 +110,8 @@ struct scoped_bson_value { convert(value); } - explicit scoped_bson_value(const bsoncxx::types::bson_value::view& view) { - // Argument order is reversed for bsoncxx::types::bson_value::view. + explicit scoped_bson_value(const bsoncxx::v_noabi::types::bson_value::view& view) { + // Argument order is reversed for bsoncxx::v_noabi::types::bson_value::view. bsoncxx::v_noabi::types::convert_to_libbson(&this->value, view); } @@ -147,13 +147,13 @@ void* encrypt::convert() const { // libmongoc will error if both key_id and key_alt_name are set, so no need to check here. if (_key_id) { - if (_key_id->view().type() != bsoncxx::type::k_binary) { + if (_key_id->view().type() != bsoncxx::v_noabi::type::k_binary) { throw exception{error_code::k_invalid_parameter, "key id myst be a binary value"}; } auto key_id = _key_id->view().get_binary(); - if (key_id.sub_type != bsoncxx::binary_sub_type::k_uuid) { + if (key_id.sub_type != bsoncxx::v_noabi::binary_sub_type::k_uuid) { throw exception{error_code::k_invalid_parameter, "key id must be a binary value with subtype 4 (UUID)"}; } 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 84630fe9fc..36e212da52 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 @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { estimated_document_count& estimated_document_count::max_time(std::chrono::milliseconds max_time) { @@ -26,13 +26,14 @@ estimated_document_count& estimated_document_count::max_time(std::chrono::millis return *this; } -estimated_document_count& estimated_document_count::read_preference(mongocxx::read_preference rp) { +estimated_document_count& estimated_document_count::read_preference( + mongocxx::v_noabi::read_preference rp) { _read_preference = std::move(rp); return *this; } estimated_document_count& estimated_document_count::comment( - bsoncxx::types::bson_value::view_or_value comment) { + bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -41,8 +42,8 @@ const stdx::optional& estimated_document_count::max_t return _max_time; } -const stdx::optional& estimated_document_count::comment() - const { +const stdx::optional& +estimated_document_count::comment() const { return _comment; } 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 d3122ed95c..6da28be591 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/find.cpp @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { find& find::allow_disk_use(bool allow_disk_use) { @@ -36,12 +36,12 @@ find& find::batch_size(std::int32_t batch_size) { return *this; } -find& find::collation(bsoncxx::document::view_or_value collation) { +find& find::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -find& find::comment(bsoncxx::string::view_or_value comment) { +find& find::comment(bsoncxx::v_noabi::string::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -51,7 +51,7 @@ find& find::cursor_type(cursor::type cursor_type) { return *this; } -find& find::hint(mongocxx::hint index_hint) { +find& find::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } @@ -61,17 +61,17 @@ find& find::limit(std::int64_t limit) { return *this; } -find& find::let(bsoncxx::document::view_or_value let) { +find& find::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } -find& find::comment_option(bsoncxx::types::bson_value::view_or_value comment) { +find& find::comment_option(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment_option = std::move(comment); return *this; } -find& find::max(bsoncxx::document::view_or_value max) { +find& find::max(bsoncxx::v_noabi::document::view_or_value max) { _max = std::move(max); return *this; } @@ -86,7 +86,7 @@ find& find::max_time(std::chrono::milliseconds max_time) { return *this; } -find& find::min(bsoncxx::document::view_or_value min) { +find& find::min(bsoncxx::v_noabi::document::view_or_value min) { _min = std::move(min); return *this; } @@ -96,12 +96,12 @@ find& find::no_cursor_timeout(bool no_cursor_timeout) { return *this; } -find& find::projection(bsoncxx::document::view_or_value projection) { +find& find::projection(bsoncxx::v_noabi::document::view_or_value projection) { _projection = std::move(projection); return *this; } -find& find::read_preference(mongocxx::read_preference rp) { +find& find::read_preference(mongocxx::v_noabi::read_preference rp) { _read_preference = std::move(rp); return *this; } @@ -121,7 +121,7 @@ find& find::skip(std::int64_t skip) { return *this; } -find& find::sort(bsoncxx::document::view_or_value ordering) { +find& find::sort(bsoncxx::v_noabi::document::view_or_value ordering) { _ordering = std::move(ordering); return *this; } @@ -138,11 +138,11 @@ const stdx::optional& find::batch_size() const { return _batch_size; } -const stdx::optional& find::collation() const { +const stdx::optional& find::collation() const { return _collation; } -const stdx::optional& find::comment() const { +const stdx::optional& find::comment() const { return _comment; } @@ -150,7 +150,7 @@ const stdx::optional& find::cursor_type() const { return _cursor_type; } -const stdx::optional& find::hint() const { +const stdx::optional& find::hint() const { return _hint; } @@ -158,15 +158,16 @@ const stdx::optional& find::limit() const { return _limit; } -const stdx::optional find::let() const { +const stdx::optional find::let() const { return _let; } -const stdx::optional& find::comment_option() const { +const stdx::optional& find::comment_option() + const { return _comment_option; } -const stdx::optional& find::max() const { +const stdx::optional& find::max() const { return _max; } @@ -178,7 +179,7 @@ const stdx::optional& find::max_time() const { return _max_time; } -const stdx::optional& find::min() const { +const stdx::optional& find::min() const { return _min; } @@ -186,7 +187,7 @@ const stdx::optional& find::no_cursor_timeout() const { return _no_cursor_timeout; } -const stdx::optional& find::projection() const { +const stdx::optional& find::projection() const { return _projection; } @@ -202,11 +203,11 @@ const stdx::optional& find::skip() const { return _skip; } -const stdx::optional& find::sort() const { +const stdx::optional& find::sort() const { return _ordering; } -const stdx::optional& find::read_preference() const { +const 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 0903458af5..da3cb181b6 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 @@ -17,10 +17,11 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -find_one_and_delete& find_one_and_delete::collation(bsoncxx::document::view_or_value collation) { +find_one_and_delete& find_one_and_delete::collation( + bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } @@ -30,50 +31,54 @@ find_one_and_delete& find_one_and_delete::max_time(std::chrono::milliseconds max return *this; } -find_one_and_delete& find_one_and_delete::projection(bsoncxx::document::view_or_value projection) { +find_one_and_delete& find_one_and_delete::projection( + bsoncxx::v_noabi::document::view_or_value projection) { _projection = std::move(projection); return *this; } -find_one_and_delete& find_one_and_delete::sort(bsoncxx::document::view_or_value ordering) { +find_one_and_delete& find_one_and_delete::sort(bsoncxx::v_noabi::document::view_or_value ordering) { _ordering = std::move(ordering); return *this; } -find_one_and_delete& find_one_and_delete::write_concern(mongocxx::write_concern write_concern) { +find_one_and_delete& find_one_and_delete::write_concern( + mongocxx::v_noabi::write_concern write_concern) { _write_concern = std::move(write_concern); return *this; } -find_one_and_delete& find_one_and_delete::hint(mongocxx::hint index_hint) { +find_one_and_delete& find_one_and_delete::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -find_one_and_delete& find_one_and_delete::let(bsoncxx::document::view_or_value let) { +find_one_and_delete& find_one_and_delete::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } find_one_and_delete& find_one_and_delete::comment( - bsoncxx::types::bson_value::view_or_value comment) { + bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } -const stdx::optional& find_one_and_delete::hint() const { +const stdx::optional& find_one_and_delete::hint() const { return _hint; } -const stdx::optional& find_one_and_delete::collation() const { +const stdx::optional& find_one_and_delete::collation() + const { return _collation; } -const stdx::optional& find_one_and_delete::projection() const { +const stdx::optional& find_one_and_delete::projection() + const { return _projection; } -const stdx::optional& find_one_and_delete::sort() const { +const stdx::optional& find_one_and_delete::sort() const { return _ordering; } @@ -81,16 +86,16 @@ const stdx::optional& find_one_and_delete::max_time() return _max_time; } -const stdx::optional& find_one_and_delete::write_concern() const { +const stdx::optional& find_one_and_delete::write_concern() const { return _write_concern; } -const stdx::optional find_one_and_delete::let() const { +const stdx::optional find_one_and_delete::let() const { return _let; } -const stdx::optional find_one_and_delete::comment() - const { +const 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 93e1df2723..648a80f8dd 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 @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { find_one_and_replace& find_one_and_replace::bypass_document_validation( @@ -26,23 +26,24 @@ find_one_and_replace& find_one_and_replace::bypass_document_validation( return *this; } -find_one_and_replace& find_one_and_replace::collation(bsoncxx::document::view_or_value collation) { +find_one_and_replace& find_one_and_replace::collation( + bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -find_one_and_replace& find_one_and_replace::hint(mongocxx::hint index_hint) { +find_one_and_replace& find_one_and_replace::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -find_one_and_replace& find_one_and_replace::let(bsoncxx::document::view_or_value let) { +find_one_and_replace& find_one_and_replace::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } find_one_and_replace& find_one_and_replace::comment( - bsoncxx::types::bson_value::view_or_value comment) { + bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -53,18 +54,19 @@ find_one_and_replace& find_one_and_replace::max_time(std::chrono::milliseconds m } find_one_and_replace& find_one_and_replace::projection( - bsoncxx::document::view_or_value projection) { + bsoncxx::v_noabi::document::view_or_value projection) { _projection = std::move(projection); return *this; } find_one_and_replace& find_one_and_replace::return_document( - mongocxx::options::return_document return_document) { + mongocxx::v_noabi::options::return_document return_document) { _return_document = return_document; return *this; } -find_one_and_replace& find_one_and_replace::sort(bsoncxx::document::view_or_value ordering) { +find_one_and_replace& find_one_and_replace::sort( + bsoncxx::v_noabi::document::view_or_value ordering) { _ordering = std::move(ordering); return *this; } @@ -74,7 +76,8 @@ find_one_and_replace& find_one_and_replace::upsert(bool upsert) { return *this; } -find_one_and_replace& find_one_and_replace::write_concern(mongocxx::write_concern write_concern) { +find_one_and_replace& find_one_and_replace::write_concern( + mongocxx::v_noabi::write_concern write_concern) { _write_concern = std::move(write_concern); return *this; } @@ -83,20 +86,21 @@ const stdx::optional& find_one_and_replace::bypass_document_validation() c return _bypass_document_validation; } -const stdx::optional& find_one_and_replace::collation() const { +const stdx::optional& find_one_and_replace::collation() + const { return _collation; } -const stdx::optional& find_one_and_replace::hint() const { +const stdx::optional& find_one_and_replace::hint() const { return _hint; } -const stdx::optional find_one_and_replace::let() const { +const stdx::optional find_one_and_replace::let() const { return _let; } -const stdx::optional find_one_and_replace::comment() - const { +const stdx::optional +find_one_and_replace::comment() const { return _comment; } @@ -104,16 +108,18 @@ const stdx::optional& find_one_and_replace::max_time( return _max_time; } -const stdx::optional& find_one_and_replace::projection() const { +const stdx::optional& find_one_and_replace::projection() + const { return _projection; } -const stdx::optional& find_one_and_replace::return_document() - const { +const stdx::optional& +find_one_and_replace::return_document() const { return _return_document; } -const stdx::optional& find_one_and_replace::sort() const { +const stdx::optional& find_one_and_replace::sort() + const { return _ordering; } @@ -121,7 +127,8 @@ const stdx::optional& find_one_and_replace::upsert() const { return _upsert; } -const stdx::optional& find_one_and_replace::write_concern() const { +const 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 51fa5bb93f..21a545c8a7 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 @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { find_one_and_update& find_one_and_update::bypass_document_validation( @@ -27,23 +27,24 @@ find_one_and_update& find_one_and_update::bypass_document_validation( return *this; } -find_one_and_update& find_one_and_update::collation(bsoncxx::document::view_or_value collation) { +find_one_and_update& find_one_and_update::collation( + bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -find_one_and_update& find_one_and_update::hint(mongocxx::hint index_hint) { +find_one_and_update& find_one_and_update::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -find_one_and_update& find_one_and_update::let(bsoncxx::document::view_or_value let) { +find_one_and_update& find_one_and_update::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } find_one_and_update& find_one_and_update::comment( - bsoncxx::types::bson_value::view_or_value comment) { + bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -53,18 +54,19 @@ find_one_and_update& find_one_and_update::max_time(std::chrono::milliseconds max return *this; } -find_one_and_update& find_one_and_update::projection(bsoncxx::document::view_or_value projection) { +find_one_and_update& find_one_and_update::projection( + bsoncxx::v_noabi::document::view_or_value projection) { _projection = std::move(projection); return *this; } find_one_and_update& find_one_and_update::return_document( - mongocxx::options::return_document return_document) { + mongocxx::v_noabi::options::return_document return_document) { _return_document = return_document; return *this; } -find_one_and_update& find_one_and_update::sort(bsoncxx::document::view_or_value ordering) { +find_one_and_update& find_one_and_update::sort(bsoncxx::v_noabi::document::view_or_value ordering) { _ordering = std::move(ordering); return *this; } @@ -74,7 +76,8 @@ find_one_and_update& find_one_and_update::upsert(bool upsert) { return *this; } -find_one_and_update& find_one_and_update::write_concern(mongocxx::write_concern write_concern) { +find_one_and_update& find_one_and_update::write_concern( + mongocxx::v_noabi::write_concern write_concern) { _write_concern = std::move(write_concern); return *this; } @@ -83,20 +86,21 @@ const stdx::optional& find_one_and_update::bypass_document_validation() co return _bypass_document_validation; } -const stdx::optional& find_one_and_update::collation() const { +const stdx::optional& find_one_and_update::collation() + const { return _collation; } -const stdx::optional& find_one_and_update::hint() const { +const stdx::optional& find_one_and_update::hint() const { return _hint; } -const stdx::optional find_one_and_update::let() const { +const stdx::optional find_one_and_update::let() const { return _let; } -const stdx::optional find_one_and_update::comment() - const { +const stdx::optional +find_one_and_update::comment() const { return _comment; } @@ -104,7 +108,8 @@ const stdx::optional& find_one_and_update::max_time() return _max_time; } -const stdx::optional& find_one_and_update::projection() const { +const stdx::optional& find_one_and_update::projection() + const { return _projection; } @@ -112,7 +117,7 @@ const stdx::optional& find_one_and_update::return_document() co return _return_document; } -const stdx::optional& find_one_and_update::sort() const { +const stdx::optional& find_one_and_update::sort() const { return _ordering; } @@ -120,17 +125,18 @@ const stdx::optional& find_one_and_update::upsert() const { return _upsert; } -const stdx::optional& find_one_and_update::write_concern() const { +const stdx::optional& find_one_and_update::write_concern() const { return _write_concern; } find_one_and_update& find_one_and_update::array_filters( - bsoncxx::array::view_or_value array_filters) { + bsoncxx::v_noabi::array::view_or_value array_filters) { _array_filters = std::move(array_filters); return *this; } -const stdx::optional& find_one_and_update::array_filters() const { +const 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 f3bc49f746..95b3d7c0b9 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 @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { namespace gridfs { @@ -44,30 +44,30 @@ const stdx::optional& bucket::chunk_size_bytes() const { return _chunk_size_bytes; } -bucket& bucket::read_concern(mongocxx::read_concern read_concern) { +bucket& bucket::read_concern(mongocxx::v_noabi::read_concern read_concern) { _read_concern = read_concern; return *this; } -const stdx::optional& bucket::read_concern() const { +const stdx::optional& bucket::read_concern() const { return _read_concern; } -bucket& bucket::read_preference(mongocxx::read_preference read_preference) { +bucket& bucket::read_preference(mongocxx::v_noabi::read_preference read_preference) { _read_preference = std::move(read_preference); return *this; } -const stdx::optional& bucket::read_preference() const { +const stdx::optional& bucket::read_preference() const { return _read_preference; } -bucket& bucket::write_concern(mongocxx::write_concern write_concern) { +bucket& bucket::write_concern(mongocxx::v_noabi::write_concern write_concern) { _write_concern = std::move(write_concern); return *this; } -const stdx::optional& bucket::write_concern() const { +const 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 57fbf1db8d..48865e1154 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 @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { namespace gridfs { @@ -31,12 +31,12 @@ const stdx::optional& upload::chunk_size_bytes() const { return _chunk_size_bytes; } -upload& upload::metadata(bsoncxx::document::view_or_value metadata) { +upload& upload::metadata(bsoncxx::v_noabi::document::view_or_value metadata) { _metadata = std::move(metadata); return *this; } -const stdx::optional& upload::metadata() const { +const 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 2e91ff4cb2..3bf4ee8d40 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { index::index() = default; @@ -42,12 +42,12 @@ index& index::hidden(bool hidden) { return *this; } -index& index::name(bsoncxx::string::view_or_value name) { +index& index::name(bsoncxx::v_noabi::string::view_or_value name) { _name = std::move(name); return *this; } -index& index::collation(bsoncxx::document::view collation) { +index& index::collation(bsoncxx::v_noabi::document::view collation) { _collation = collation; return *this; } @@ -78,22 +78,23 @@ index& index::version(std::int32_t version) { return *this; } -index& index::weights(bsoncxx::document::view weights) { +index& index::weights(bsoncxx::v_noabi::document::view weights) { _weights = weights; return *this; } -index& index::default_language(bsoncxx::string::view_or_value default_language) { +index& index::default_language(bsoncxx::v_noabi::string::view_or_value default_language) { _default_language = std::move(default_language); return *this; } -index& index::language_override(bsoncxx::string::view_or_value language_override) { +index& index::language_override(bsoncxx::v_noabi::string::view_or_value language_override) { _language_override = std::move(language_override); return *this; } -index& index::partial_filter_expression(bsoncxx::document::view partial_filter_expression) { +index& index::partial_filter_expression( + bsoncxx::v_noabi::document::view partial_filter_expression) { _partial_filter_expression = partial_filter_expression; return *this; } @@ -139,11 +140,11 @@ const stdx::optional& index::hidden() const { return _hidden; } -const stdx::optional& index::name() const { +const stdx::optional& index::name() const { return _name; } -const stdx::optional& index::collation() const { +const stdx::optional& index::collation() const { return _collation; } @@ -163,19 +164,19 @@ const stdx::optional& index::version() const { return _version; } -const stdx::optional& index::weights() const { +const stdx::optional& index::weights() const { return _weights; } -const stdx::optional& index::default_language() const { +const stdx::optional& index::default_language() const { return _default_language; } -const stdx::optional& index::language_override() const { +const stdx::optional& index::language_override() const { return _language_override; } -const stdx::optional& index::partial_filter_expression() const { +const stdx::optional& index::partial_filter_expression() const { return _partial_filter_expression; } @@ -203,7 +204,7 @@ const stdx::optional& index::haystack_bucket_size() const { return haystack_bucket_size_deprecated(); } -index::operator bsoncxx::document::view_or_value() { +index::operator bsoncxx::v_noabi::document::view_or_value() { using namespace bsoncxx; using builder::basic::kvp; using builder::basic::make_document; @@ -285,7 +286,7 @@ index::operator bsoncxx::document::view_or_value() { static_cast( _storage_options.get()); - bsoncxx::document::view_or_value storage_doc; + bsoncxx::v_noabi::document::view_or_value storage_doc; if (wt_options->config_string()) { storage_doc = make_document( kvp("wiredTiger", @@ -306,11 +307,11 @@ index::base_storage_options::~base_storage_options() = default; index::wiredtiger_storage_options::~wiredtiger_storage_options() = default; void index::wiredtiger_storage_options::config_string( - bsoncxx::string::view_or_value config_string) { + bsoncxx::v_noabi::string::view_or_value config_string) { _config_string = std::move(config_string); } -const stdx::optional& +const 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 c61cc7a3d8..e8f16a8e12 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 @@ -19,24 +19,25 @@ #include -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::make_document; +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::make_document; namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { index_view::index_view() : _max_time(), _write_concern(), _commit_quorum() {} -const bsoncxx::stdx::optional& index_view::write_concern() const { +const bsoncxx::v_noabi::stdx::optional& +index_view::write_concern() const { return _write_concern; } -const bsoncxx::stdx::optional& index_view::max_time() const { +const bsoncxx::v_noabi::stdx::optional& index_view::max_time() const { return _max_time; } -const stdx::optional index_view::commit_quorum() const { +const stdx::optional index_view::commit_quorum() const { return _commit_quorum; } @@ -45,23 +46,23 @@ index_view& index_view::max_time(std::chrono::milliseconds max_time) { return *this; } -index_view& index_view::write_concern(mongocxx::write_concern write_concern) { +index_view& index_view::write_concern(mongocxx::v_noabi::write_concern write_concern) { _write_concern = std::move(write_concern); return *this; } index_view& index_view::commit_quorum(int commit_quorum) { - _commit_quorum = stdx::make_optional( - make_document(kvp("commitQuorum", bsoncxx::types::b_int32{commit_quorum}))); + _commit_quorum = 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 = stdx::make_optional( make_document(kvp("commitQuorum", commit_quorum))); return *this; } -} // namespace options +} // namespace options } // namespace v_noabi } // namespace mongocxx 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 9550d868ae..965eb36aae 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/insert.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/insert.cpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { insert& insert::bypass_document_validation(bool bypass_document_validation) { @@ -25,7 +25,7 @@ insert& insert::bypass_document_validation(bool bypass_document_validation) { return *this; } -insert& insert::write_concern(mongocxx::write_concern wc) { +insert& insert::write_concern(mongocxx::v_noabi::write_concern wc) { _write_concern = std::move(wc); return *this; } @@ -35,7 +35,7 @@ insert& insert::ordered(bool ordered) { return *this; } -insert& insert::comment(bsoncxx::types::bson_value::view_or_value comment) { +insert& insert::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -44,7 +44,7 @@ const stdx::optional& insert::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& insert::write_concern() const { +const stdx::optional& insert::write_concern() const { return _write_concern; } @@ -52,7 +52,7 @@ const stdx::optional& insert::ordered() const { return _ordered; } -const stdx::optional& insert::comment() const { +const stdx::optional& insert::comment() const { return _comment; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/pool.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/pool.cpp index 9889cbece7..53b53b39c3 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/pool.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/pool.cpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { pool::pool(client client_opts) { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/apm.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/apm.hh index 299bb67108..1926b4dda2 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/apm.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/apm.hh @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { using apm_unique_callbacks = @@ -42,73 +42,73 @@ static void exception_guard(const char* source, Fn fn) noexcept { } static void command_started(const mongoc_apm_command_started_t* event) noexcept { - mongocxx::events::command_started_event started_event(static_cast(event)); + events::command_started_event started_event(static_cast(event)); auto context = static_cast(libmongoc::apm_command_started_get_context(event)); exception_guard(__func__, [&] { context->command_started()(started_event); }); } static void command_failed(const mongoc_apm_command_failed_t* event) noexcept { - mongocxx::events::command_failed_event failed_event(static_cast(event)); + events::command_failed_event failed_event(static_cast(event)); auto context = static_cast(libmongoc::apm_command_failed_get_context(event)); exception_guard(__func__, [&] { context->command_failed()(failed_event); }); } static void command_succeeded(const mongoc_apm_command_succeeded_t* event) noexcept { - mongocxx::events::command_succeeded_event succeeded_event(static_cast(event)); + events::command_succeeded_event succeeded_event(static_cast(event)); auto context = static_cast(libmongoc::apm_command_succeeded_get_context(event)); exception_guard(__func__, [&] { context->command_succeeded()(succeeded_event); }); } static void server_closed(const mongoc_apm_server_closed_t* event) noexcept { - mongocxx::events::server_closed_event e(static_cast(event)); + events::server_closed_event e(static_cast(event)); auto context = static_cast(libmongoc::apm_server_closed_get_context(event)); exception_guard(__func__, [&] { context->server_closed()(e); }); } static void server_changed(const mongoc_apm_server_changed_t* event) noexcept { - mongocxx::events::server_changed_event e(static_cast(event)); + events::server_changed_event e(static_cast(event)); auto context = static_cast(libmongoc::apm_server_changed_get_context(event)); exception_guard(__func__, [&] { context->server_changed()(e); }); } static void server_opening(const mongoc_apm_server_opening_t* event) noexcept { - mongocxx::events::server_opening_event e(static_cast(event)); + events::server_opening_event e(static_cast(event)); auto context = static_cast(libmongoc::apm_server_opening_get_context(event)); exception_guard(__func__, [&] { context->server_opening()(e); }); } static void topology_closed(const mongoc_apm_topology_closed_t* event) noexcept { - mongocxx::events::topology_closed_event e(static_cast(event)); + events::topology_closed_event e(static_cast(event)); auto context = static_cast(libmongoc::apm_topology_closed_get_context(event)); exception_guard(__func__, [&] { context->topology_closed()(e); }); } static void topology_changed(const mongoc_apm_topology_changed_t* event) noexcept { - mongocxx::events::topology_changed_event e(static_cast(event)); + events::topology_changed_event e(static_cast(event)); auto context = static_cast(libmongoc::apm_topology_changed_get_context(event)); exception_guard(__func__, [&] { context->topology_changed()(e); }); } static void topology_opening(const mongoc_apm_topology_opening_t* event) noexcept { - mongocxx::events::topology_opening_event e(static_cast(event)); + events::topology_opening_event e(static_cast(event)); auto context = static_cast(libmongoc::apm_topology_opening_get_context(event)); exception_guard(__func__, [&] { context->topology_opening()(e); }); } static void heartbeat_started(const mongoc_apm_server_heartbeat_started_t* event) noexcept { - mongocxx::events::heartbeat_started_event started_event(static_cast(event)); + events::heartbeat_started_event started_event(static_cast(event)); auto context = static_cast(libmongoc::apm_server_heartbeat_started_get_context(event)); exception_guard(__func__, [&] { context->heartbeat_started()(started_event); }); } static void heartbeat_failed(const mongoc_apm_server_heartbeat_failed_t* event) noexcept { - mongocxx::events::heartbeat_failed_event failed_event(static_cast(event)); + events::heartbeat_failed_event failed_event(static_cast(event)); auto context = static_cast(libmongoc::apm_server_heartbeat_failed_get_context(event)); exception_guard(__func__, [&] { context->heartbeat_failed()(failed_event); }); } static void heartbeat_succeeded(const mongoc_apm_server_heartbeat_succeeded_t* event) noexcept { - mongocxx::events::heartbeat_succeeded_event succeeded_event(static_cast(event)); + events::heartbeat_succeeded_event succeeded_event(static_cast(event)); auto context = static_cast(libmongoc::apm_server_heartbeat_succeeded_get_context(event)); exception_guard(__func__, [&] { context->heartbeat_succeeded()(succeeded_event); }); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/server_api.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/server_api.hh index 9031504a6c..0a890a3d2f 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/server_api.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/server_api.hh @@ -23,7 +23,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { using unique_server_api = @@ -37,15 +37,15 @@ static unique_server_api make_server_api(const server_api& opts) { auto result = libmongoc::server_api_version_from_string( server_api::version_to_string(opts.get_version()).c_str(), &mongoc_api_version); if (!result) { - throw mongocxx::logic_error{ - mongocxx::error_code::k_invalid_parameter, + throw mongocxx::v_noabi::logic_error{ + mongocxx::v_noabi::error_code::k_invalid_parameter, "invalid server API version" + server_api::version_to_string(opts.get_version())}; } auto mongoc_server_api_opts = libmongoc::server_api_new(mongoc_api_version); if (!mongoc_server_api_opts) { - throw mongocxx::logic_error{mongocxx::error_code::k_create_resource_fail, - "could not create server API"}; + throw mongocxx::v_noabi::logic_error{mongocxx::v_noabi::error_code::k_create_resource_fail, + "could not create server API"}; } if (opts.strict().value_or(false)) { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/ssl.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/ssl.hh index b4d8f7c7f5..fa653ba127 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/ssl.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/ssl.hh @@ -22,14 +22,14 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { #if defined(MONGOCXX_ENABLE_SSL) && defined(MONGOC_ENABLE_SSL) -inline std::pair<::mongoc_ssl_opt_t, std::list> make_tls_opts( - const tls& tls_opts) { +inline std::pair<::mongoc_ssl_opt_t, std::list> +make_tls_opts(const tls& tls_opts) { ::mongoc_ssl_opt_t out{}; - std::list values; + std::list values; if (tls_opts.pem_file()) { out.pem_file = values.emplace(values.end(), tls_opts.pem_file()->terminated())->data(); 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 4430eb3e38..69a3cb6a3f 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 @@ -26,7 +26,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { class transaction::impl { @@ -54,49 +54,49 @@ class transaction::impl { impl(impl&&) noexcept = default; impl& operator=(impl&&) noexcept = default; - void read_concern(const mongocxx::read_concern& rc) { + void read_concern(const mongocxx::v_noabi::read_concern& rc) { libmongoc::transaction_opts_set_read_concern(_transaction_opt_t.get(), rc._impl->read_concern_t); } - stdx::optional read_concern() const { + stdx::optional read_concern() const { auto rc = libmongoc::transaction_opts_get_read_concern(_transaction_opt_t.get()); if (!rc) { return {}; } - mongocxx::read_concern rci( + mongocxx::v_noabi::read_concern rci( stdx::make_unique(libmongoc::read_concern_copy(rc))); - return stdx::optional(std::move(rci)); + return stdx::optional(std::move(rci)); } - void write_concern(const mongocxx::write_concern& wc) { + void write_concern(const mongocxx::v_noabi::write_concern& wc) { libmongoc::transaction_opts_set_write_concern(_transaction_opt_t.get(), wc._impl->write_concern_t); } - stdx::optional write_concern() const { + stdx::optional write_concern() const { auto wc = libmongoc::transaction_opts_get_write_concern(_transaction_opt_t.get()); if (!wc) { return {}; } - mongocxx::write_concern wci( + mongocxx::v_noabi::write_concern wci( stdx::make_unique(libmongoc::write_concern_copy(wc))); - return stdx::optional(std::move(wci)); + return stdx::optional(std::move(wci)); } - void read_preference(const mongocxx::read_preference& rp) { + void read_preference(const mongocxx::v_noabi::read_preference& rp) { libmongoc::transaction_opts_set_read_prefs(_transaction_opt_t.get(), rp._impl->read_preference_t); } - stdx::optional read_preference() const { + stdx::optional read_preference() const { auto rp = libmongoc::transaction_opts_get_read_prefs(_transaction_opt_t.get()); if (!rp) { return {}; } - mongocxx::read_preference rpi( + mongocxx::v_noabi::read_preference rpi( stdx::make_unique(libmongoc::read_prefs_copy(rp))); - return stdx::optional(std::move(rpi)); + return stdx::optional(std::move(rpi)); } void max_commit_time_ms(std::chrono::milliseconds ms) { 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 208f7acba5..c3c6d89337 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/range.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/range.cpp @@ -17,24 +17,24 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -range& range::min(bsoncxx::types::bson_value::view_or_value value) { +range& range::min(bsoncxx::v_noabi::types::bson_value::view_or_value value) { _min = std::move(value); return *this; } -const stdx::optional& range::min() const { +const stdx::optional& range::min() const { return _min; } -range& range::max(bsoncxx::types::bson_value::view_or_value value) { +range& range::max(bsoncxx::v_noabi::types::bson_value::view_or_value value) { _max = std::move(value); return *this; } -const stdx::optional& range::max() const { +const stdx::optional& range::max() const { return _max; } 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 ed105a76db..2233a627ff 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/replace.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/replace.cpp @@ -18,7 +18,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { replace& replace::bypass_document_validation(bool bypass_document_validation) { @@ -26,22 +26,22 @@ replace& replace::bypass_document_validation(bool bypass_document_validation) { return *this; } -replace& replace::hint(mongocxx::hint index_hint) { +replace& replace::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -replace& replace::let(bsoncxx::document::view_or_value let) { +replace& replace::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } -replace& replace::comment(bsoncxx::types::bson_value::view_or_value comment) { +replace& replace::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } -replace& replace::collation(bsoncxx::document::view_or_value collation) { +replace& replace::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } @@ -51,20 +51,20 @@ replace& replace::upsert(bool upsert) { return *this; } -replace& replace::write_concern(mongocxx::write_concern wc) { +replace& replace::write_concern(mongocxx::v_noabi::write_concern wc) { _write_concern = std::move(wc); return *this; } -const stdx::optional& replace::hint() const { +const stdx::optional& replace::hint() const { return _hint; } -const stdx::optional replace::let() const { +const stdx::optional replace::let() const { return _let; } -const stdx::optional replace::comment() const { +const stdx::optional replace::comment() const { return _comment; } @@ -72,7 +72,7 @@ const stdx::optional& replace::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& replace::collation() const { +const stdx::optional& replace::collation() const { return _collation; } @@ -80,7 +80,7 @@ const stdx::optional& replace::upsert() const { return _upsert; } -const stdx::optional& replace::write_concern() const { +const 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 e045c471aa..0ae826acd0 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 @@ -22,24 +22,27 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -rewrap_many_datakey& rewrap_many_datakey::provider(bsoncxx::string::view_or_value provider) { +rewrap_many_datakey& rewrap_many_datakey::provider( + bsoncxx::v_noabi::string::view_or_value provider) { _provider = std::move(provider); return *this; } -bsoncxx::string::view_or_value rewrap_many_datakey::provider() const { +bsoncxx::v_noabi::string::view_or_value rewrap_many_datakey::provider() const { return _provider; } -rewrap_many_datakey& rewrap_many_datakey::master_key(bsoncxx::document::view_or_value master_key) { +rewrap_many_datakey& rewrap_many_datakey::master_key( + bsoncxx::v_noabi::document::view_or_value master_key) { _master_key = std::move(master_key); return *this; } -const stdx::optional& rewrap_many_datakey::master_key() const { +const 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 343396e49a..e1207c056e 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 @@ -24,7 +24,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { std::string server_api::version_to_string(server_api::version version) { @@ -32,8 +32,8 @@ std::string server_api::version_to_string(server_api::version version) { case server_api::version::k_version_1: return "1"; default: - throw mongocxx::logic_error{mongocxx::error_code::k_invalid_parameter, - "invalid server API version"}; + throw mongocxx::v_noabi::logic_error{mongocxx::v_noabi::error_code::k_invalid_parameter, + "invalid server API version"}; } } @@ -41,8 +41,8 @@ server_api::version server_api::version_from_string(stdx::string_view version) { if (!version.compare("1")) { return server_api::version::k_version_1; } - throw mongocxx::logic_error{mongocxx::error_code::k_invalid_parameter, - "invalid server API version"}; + throw mongocxx::v_noabi::logic_error{mongocxx::v_noabi::error_code::k_invalid_parameter, + "invalid server API version"}; } server_api::server_api(server_api::version version) : _version(std::move(version)) {} 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 e12b0a0f4f..7459842d00 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/tls.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/tls.cpp @@ -17,51 +17,51 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { -tls& tls::pem_file(bsoncxx::string::view_or_value pem_file) { +tls& tls::pem_file(bsoncxx::v_noabi::string::view_or_value pem_file) { _pem_file = std::move(pem_file); return *this; } -const stdx::optional& tls::pem_file() const { +const stdx::optional& tls::pem_file() const { return _pem_file; } -tls& tls::pem_password(bsoncxx::string::view_or_value pem_password) { +tls& tls::pem_password(bsoncxx::v_noabi::string::view_or_value pem_password) { _pem_password = std::move(pem_password); return *this; } -const stdx::optional& tls::pem_password() const { +const stdx::optional& tls::pem_password() const { return _pem_password; } -tls& tls::ca_file(bsoncxx::string::view_or_value ca_file) { +tls& tls::ca_file(bsoncxx::v_noabi::string::view_or_value ca_file) { _ca_file = std::move(ca_file); return *this; } -const stdx::optional& tls::ca_file() const { +const stdx::optional& tls::ca_file() const { return _ca_file; } -tls& tls::ca_dir(bsoncxx::string::view_or_value ca_dir) { +tls& tls::ca_dir(bsoncxx::v_noabi::string::view_or_value ca_dir) { _ca_dir = std::move(ca_dir); return *this; } -const stdx::optional& tls::ca_dir() const { +const stdx::optional& tls::ca_dir() const { return _ca_dir; } -tls& tls::crl_file(bsoncxx::string::view_or_value crl_file) { +tls& tls::crl_file(bsoncxx::v_noabi::string::view_or_value crl_file) { _crl_file = std::move(crl_file); return *this; } -const stdx::optional& tls::crl_file() const { +const stdx::optional& tls::crl_file() const { return _crl_file; } 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 aa9a3299e0..5e4ced91b0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp @@ -20,7 +20,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { transaction::transaction() : _impl{stdx::make_unique()} {} @@ -38,30 +38,30 @@ transaction& transaction::operator=(const transaction& other) { transaction::~transaction() noexcept = default; -transaction& transaction::read_concern(const mongocxx::read_concern& rc) { +transaction& transaction::read_concern(const mongocxx::v_noabi::read_concern& rc) { _impl->read_concern(rc); return *this; } -stdx::optional transaction::read_concern() const { +stdx::optional transaction::read_concern() const { return _impl->read_concern(); } -transaction& transaction::write_concern(const mongocxx::write_concern& wc) { +transaction& transaction::write_concern(const mongocxx::v_noabi::write_concern& wc) { _impl->write_concern(wc); return *this; } -stdx::optional transaction::write_concern() const { +stdx::optional transaction::write_concern() const { return _impl->write_concern(); } -transaction& transaction::read_preference(const mongocxx::read_preference& rp) { +transaction& transaction::read_preference(const mongocxx::v_noabi::read_preference& rp) { _impl->read_preference(rp); return *this; } -stdx::optional transaction::read_preference() const { +stdx::optional transaction::read_preference() const { return _impl->read_preference(); } 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 4eb12752ce..53127a8dd5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/update.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/update.cpp @@ -19,7 +19,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace options { update& update::bypass_document_validation(bool bypass_document_validation) { @@ -27,22 +27,22 @@ update& update::bypass_document_validation(bool bypass_document_validation) { return *this; } -update& update::collation(bsoncxx::document::view_or_value collation) { +update& update::collation(bsoncxx::v_noabi::document::view_or_value collation) { _collation = std::move(collation); return *this; } -update& update::hint(mongocxx::hint index_hint) { +update& update::hint(mongocxx::v_noabi::hint index_hint) { _hint = std::move(index_hint); return *this; } -update& update::let(bsoncxx::document::view_or_value let) { +update& update::let(bsoncxx::v_noabi::document::view_or_value let) { _let = let; return *this; } -update& update::comment(bsoncxx::types::bson_value::view_or_value comment) { +update& update::comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment) { _comment = std::move(comment); return *this; } @@ -52,7 +52,7 @@ update& update::upsert(bool upsert) { return *this; } -update& update::write_concern(mongocxx::write_concern wc) { +update& update::write_concern(mongocxx::v_noabi::write_concern wc) { _write_concern = std::move(wc); return *this; } @@ -61,19 +61,19 @@ const stdx::optional& update::bypass_document_validation() const { return _bypass_document_validation; } -const stdx::optional& update::collation() const { +const stdx::optional& update::collation() const { return _collation; } -const stdx::optional& update::hint() const { +const stdx::optional& update::hint() const { return _hint; } -const stdx::optional update::let() const { +const stdx::optional update::let() const { return _let; } -const stdx::optional update::comment() const { +const stdx::optional update::comment() const { return _comment; } @@ -81,16 +81,16 @@ const stdx::optional& update::upsert() const { return _upsert; } -const stdx::optional& update::write_concern() const { +const stdx::optional& update::write_concern() const { return _write_concern; } -update& update::array_filters(bsoncxx::array::view_or_value array_filters) { +update& update::array_filters(bsoncxx::v_noabi::array::view_or_value array_filters) { _array_filters = std::move(array_filters); return *this; } -const stdx::optional& update::array_filters() const { +const 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 a1c55500c8..c0f6cf4035 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp @@ -21,18 +21,19 @@ #include -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::sub_document; +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::sub_document; namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + pipeline::pipeline() : _impl(stdx::make_unique()) {} pipeline::pipeline(pipeline&&) noexcept = default; pipeline& pipeline::operator=(pipeline&&) noexcept = default; pipeline::~pipeline() = default; -pipeline& pipeline::add_fields(bsoncxx::document::view_or_value fields_to_add) { +pipeline& pipeline::add_fields(bsoncxx::v_noabi::document::view_or_value fields_to_add) { _impl->sink().append([fields_to_add](sub_document sub_doc) { sub_doc.append(kvp("$addFields", fields_to_add)); }); @@ -40,26 +41,26 @@ pipeline& pipeline::add_fields(bsoncxx::document::view_or_value fields_to_add) { return *this; } -pipeline& pipeline::append_stage(bsoncxx::document::view_or_value stage) { +pipeline& pipeline::append_stage(bsoncxx::v_noabi::document::view_or_value stage) { _impl->sink().append(std::move(stage)); return *this; } -pipeline& pipeline::append_stages(bsoncxx::array::view_or_value stages) { +pipeline& pipeline::append_stages(bsoncxx::v_noabi::array::view_or_value stages) { for (auto&& stage : stages.view()) { _impl->sink().append(stage.get_document().value); } return *this; } -pipeline& pipeline::bucket(bsoncxx::document::view_or_value bucket_args) { +pipeline& pipeline::bucket(bsoncxx::v_noabi::document::view_or_value bucket_args) { _impl->sink().append( [bucket_args](sub_document sub_doc) { sub_doc.append(kvp("$bucket", bucket_args)); }); return *this; } -pipeline& pipeline::bucket_auto(bsoncxx::document::view_or_value bucket_auto_args) { +pipeline& pipeline::bucket_auto(bsoncxx::v_noabi::document::view_or_value bucket_auto_args) { _impl->sink().append([bucket_auto_args](sub_document sub_doc) { sub_doc.append(kvp("$bucketAuto", bucket_auto_args)); }); @@ -67,7 +68,7 @@ pipeline& pipeline::bucket_auto(bsoncxx::document::view_or_value bucket_auto_arg return *this; } -pipeline& pipeline::coll_stats(bsoncxx::document::view_or_value coll_stats_args) { +pipeline& pipeline::coll_stats(bsoncxx::v_noabi::document::view_or_value coll_stats_args) { _impl->sink().append([coll_stats_args](sub_document sub_doc) { sub_doc.append(kvp("$collStats", coll_stats_args)); }); @@ -81,7 +82,7 @@ pipeline& pipeline::count(std::string field) { return *this; } -pipeline& pipeline::current_op(bsoncxx::document::view_or_value current_op_args) { +pipeline& pipeline::current_op(bsoncxx::v_noabi::document::view_or_value current_op_args) { _impl->sink().append([current_op_args](sub_document sub_doc) { sub_doc.append(kvp("$currentOp", current_op_args)); }); @@ -89,21 +90,21 @@ pipeline& pipeline::current_op(bsoncxx::document::view_or_value current_op_args) return *this; } -pipeline& pipeline::facet(bsoncxx::document::view_or_value facet_args) { +pipeline& pipeline::facet(bsoncxx::v_noabi::document::view_or_value facet_args) { _impl->sink().append( [facet_args](sub_document sub_doc) { sub_doc.append(kvp("$facet", facet_args)); }); return *this; } -pipeline& pipeline::geo_near(bsoncxx::document::view_or_value geo_near_args) { +pipeline& pipeline::geo_near(bsoncxx::v_noabi::document::view_or_value geo_near_args) { _impl->sink().append( [geo_near_args](sub_document sub_doc) { sub_doc.append(kvp("$geoNear", geo_near_args)); }); return *this; } -pipeline& pipeline::graph_lookup(bsoncxx::document::view_or_value graph_lookup_args) { +pipeline& pipeline::graph_lookup(bsoncxx::v_noabi::document::view_or_value graph_lookup_args) { _impl->sink().append([graph_lookup_args](sub_document sub_doc) { sub_doc.append(kvp("$graphLookup", graph_lookup_args)); }); @@ -111,7 +112,7 @@ pipeline& pipeline::graph_lookup(bsoncxx::document::view_or_value graph_lookup_a return *this; } -pipeline& pipeline::group(bsoncxx::document::view_or_value group_args) { +pipeline& pipeline::group(bsoncxx::v_noabi::document::view_or_value group_args) { _impl->sink().append( [group_args](sub_document sub_doc) { sub_doc.append(kvp("$group", group_args)); }); @@ -120,7 +121,7 @@ pipeline& pipeline::group(bsoncxx::document::view_or_value group_args) { pipeline& pipeline::index_stats() { _impl->sink().append([](sub_document sub_doc) { - sub_doc.append(kvp("$indexStats", bsoncxx::document::view{})); + sub_doc.append(kvp("$indexStats", bsoncxx::v_noabi::document::view{})); }); return *this; @@ -132,7 +133,8 @@ pipeline& pipeline::limit(std::int32_t limit) { return *this; } -pipeline& pipeline::list_local_sessions(bsoncxx::document::view_or_value list_local_sessions_args) { +pipeline& pipeline::list_local_sessions( + bsoncxx::v_noabi::document::view_or_value list_local_sessions_args) { _impl->sink().append([list_local_sessions_args](sub_document sub_doc) { sub_doc.append(kvp("$listLocalSessions", list_local_sessions_args)); }); @@ -140,7 +142,7 @@ pipeline& pipeline::list_local_sessions(bsoncxx::document::view_or_value list_lo return *this; } -pipeline& pipeline::list_sessions(bsoncxx::document::view_or_value list_sessions_args) { +pipeline& pipeline::list_sessions(bsoncxx::v_noabi::document::view_or_value list_sessions_args) { _impl->sink().append([list_sessions_args](sub_document sub_doc) { sub_doc.append(kvp("$listSessions", list_sessions_args)); }); @@ -148,20 +150,20 @@ pipeline& pipeline::list_sessions(bsoncxx::document::view_or_value list_sessions return *this; } -pipeline& pipeline::lookup(bsoncxx::document::view_or_value lookup_args) { +pipeline& pipeline::lookup(bsoncxx::v_noabi::document::view_or_value lookup_args) { _impl->sink().append( [lookup_args](sub_document sub_doc) { sub_doc.append(kvp("$lookup", lookup_args)); }); return *this; } -pipeline& pipeline::match(bsoncxx::document::view_or_value filter) { +pipeline& pipeline::match(bsoncxx::v_noabi::document::view_or_value filter) { _impl->sink().append([filter](sub_document sub_doc) { sub_doc.append(kvp("$match", filter)); }); return *this; } -pipeline& pipeline::merge(bsoncxx::document::view_or_value merge_args) { +pipeline& pipeline::merge(bsoncxx::v_noabi::document::view_or_value merge_args) { _impl->sink().append( [merge_args](sub_document sub_doc) { sub_doc.append(kvp("$merge", merge_args)); }); @@ -175,21 +177,21 @@ pipeline& pipeline::out(std::string collection_name) { return *this; } -pipeline& pipeline::project(bsoncxx::document::view_or_value projection) { +pipeline& pipeline::project(bsoncxx::v_noabi::document::view_or_value projection) { _impl->sink().append( [projection](sub_document sub_doc) { sub_doc.append(kvp("$project", projection)); }); return *this; } -pipeline& pipeline::redact(bsoncxx::document::view_or_value restrictions) { +pipeline& pipeline::redact(bsoncxx::v_noabi::document::view_or_value restrictions) { _impl->sink().append( [restrictions](sub_document sub_doc) { sub_doc.append(kvp("$redact", restrictions)); }); return *this; } -pipeline& pipeline::replace_root(bsoncxx::document::view_or_value replace_root_args) { +pipeline& pipeline::replace_root(bsoncxx::v_noabi::document::view_or_value replace_root_args) { _impl->sink().append([replace_root_args](sub_document sub_doc) { sub_doc.append(kvp("$replaceRoot", replace_root_args)); }); @@ -213,14 +215,14 @@ pipeline& pipeline::skip(std::int32_t docs_to_skip) { return *this; } -pipeline& pipeline::sort(bsoncxx::document::view_or_value ordering) { +pipeline& pipeline::sort(bsoncxx::v_noabi::document::view_or_value ordering) { _impl->sink().append( [ordering](sub_document sub_doc) { sub_doc.append(kvp("$sort", ordering)); }); return *this; } -pipeline& pipeline::sort_by_count(bsoncxx::document::view_or_value field_expression) { +pipeline& pipeline::sort_by_count(bsoncxx::v_noabi::document::view_or_value field_expression) { _impl->sink().append([field_expression](sub_document sub_doc) { sub_doc.append(kvp("$sortByCount", field_expression)); }); @@ -236,7 +238,7 @@ pipeline& pipeline::sort_by_count(std::string field_expression) { return *this; } -pipeline& pipeline::unwind(bsoncxx::document::view_or_value unwind_args) { +pipeline& pipeline::unwind(bsoncxx::v_noabi::document::view_or_value unwind_args) { _impl->sink().append( [unwind_args](sub_document sub_doc) { sub_doc.append(kvp("$unwind", unwind_args)); }); @@ -250,7 +252,7 @@ pipeline& pipeline::unwind(std::string field_name) { return *this; } -bsoncxx::array::view pipeline::view_array() const { +bsoncxx::v_noabi::array::view pipeline::view_array() const { return _impl->view_array(); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp index 02458fcc1e..413fad28a2 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp @@ -31,7 +31,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + // Attempts to create a new client pool using the uri. Throws an exception upon error. static mongoc_client_pool_t* construct_client_pool(mongoc_uri_t* uri) { bson_error_t error; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/append_aggregate_options.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/append_aggregate_options.hh index af02318a97..b8c8e688eb 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/append_aggregate_options.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/append_aggregate_options.hh @@ -6,10 +6,11 @@ #include namespace mongocxx { -inline namespace v_noabi { -MONGOCXX_INLINE void append_aggregate_options(bsoncxx::builder::basic::document& builder, - const options::aggregate& options) { - using bsoncxx::builder::basic::kvp; +namespace v_noabi { + +inline void append_aggregate_options(bsoncxx::v_noabi::builder::basic::document& builder, + const options::aggregate& options) { + using bsoncxx::v_noabi::builder::basic::kvp; if (const auto& allow_disk_use = options.allow_disk_use()) { builder.append(kvp("allowDiskUse", *allow_disk_use)); @@ -24,7 +25,7 @@ MONGOCXX_INLINE void append_aggregate_options(bsoncxx::builder::basic::document& } if (const auto& max_time = options.max_time()) { - builder.append(kvp("maxTimeMS", bsoncxx::types::b_int64{max_time->count()})); + builder.append(kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{max_time->count()})); } if (const auto& bypass_document_validation = options.bypass_document_validation()) { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/bulk_write.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/bulk_write.hh index 3e54cace5d..71998baeba 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/bulk_write.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/bulk_write.hh @@ -20,7 +20,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class bulk_write::impl { public: impl(mongoc_bulk_operation_t* op) : operation_t(op) {} 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 a6fbfeb38d..3487818b8b 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 @@ -25,7 +25,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class change_stream::impl { public: // lifecycle of the cursor @@ -65,7 +66,7 @@ class change_stream::impl { } void mark_nothing_left() { - doc_ = bsoncxx::document::view{}; + doc_ = bsoncxx::v_noabi::document::view{}; exhausted_ = true; status_ = state::k_pending; } @@ -80,7 +81,7 @@ class change_stream::impl { // Happy-case. if (libmongoc::change_stream_next(this->change_stream_, &out)) { - this->doc_ = bsoncxx::document::view{bson_get_data(out), out->len}; + this->doc_ = bsoncxx::v_noabi::document::view{bson_get_data(out), out->len}; return; } @@ -88,7 +89,7 @@ class change_stream::impl { bson_error_t error; if (libmongoc::change_stream_error_document(this->change_stream_, &error, &out)) { this->mark_dead(); - this->doc_ = bsoncxx::document::view{}; + this->doc_ = bsoncxx::v_noabi::document::view{}; mongocxx::libbson::scoped_bson_t scoped_error_reply{}; bson_copy_to(out, scoped_error_reply.bson_for_init()); throw_exception(scoped_error_reply.steal(), error); @@ -98,22 +99,22 @@ class change_stream::impl { this->mark_nothing_left(); } - bsoncxx::document::view& doc() { + bsoncxx::v_noabi::document::view& doc() { return this->doc_; } - stdx::optional get_resume_token() { + stdx::optional get_resume_token() { auto token = libmongoc::change_stream_get_resume_token(this->change_stream_); if (!token) { return {}; } - return {bsoncxx::document::view{bson_get_data(token), token->len}}; + return {bsoncxx::v_noabi::document::view{bson_get_data(token), token->len}}; } private: mongoc_change_stream_t* const change_stream_; - bsoncxx::document::view doc_; + bsoncxx::v_noabi::document::view doc_; state status_; bool exhausted_; }; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client.hh index 2d1b6eb298..82ed99109e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/client.hh @@ -23,7 +23,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class client::impl { public: impl(mongoc_client_t* client) : client_t(client) {} @@ -33,7 +34,7 @@ class client::impl { } mongoc_client_t* client_t; - std::list tls_options; + std::list tls_options; options::apm listeners; }; 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 2a12dcf083..0830b4fd30 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 @@ -37,7 +37,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class client_encryption::impl { private: using scoped_bson_t = mongocxx::libbson::scoped_bson_t; @@ -69,8 +70,8 @@ class client_encryption::impl { convert(value); } - explicit scoped_bson_value(const bsoncxx::types::bson_value::view& view) { - // Argument order is reversed for bsoncxx::types::bson_value::view. + explicit scoped_bson_value(const bsoncxx::v_noabi::types::bson_value::view& view) { + // Argument order is reversed for bsoncxx::v_noabi::types::bson_value::view. bsoncxx::v_noabi::types::convert_to_libbson(&this->value, view); } @@ -118,8 +119,8 @@ class client_encryption::impl { } } - bsoncxx::types::bson_value::value create_data_key(std::string kms_provider, - const options::data_key& opts) { + bsoncxx::v_noabi::types::bson_value::value create_data_key(std::string kms_provider, + const options::data_key& opts) { using opts_type = mongoc_client_encryption_datakey_opts_t; struct opts_deleter { @@ -146,8 +147,8 @@ class client_encryption::impl { return bsoncxx::v_noabi::types::bson_value::make_owning_bson(keyid.get()); } - bsoncxx::types::bson_value::value encrypt(bsoncxx::types::bson_value::view value, - const options::encrypt& opts) { + bsoncxx::v_noabi::types::bson_value::value encrypt( + bsoncxx::v_noabi::types::bson_value::view value, const options::encrypt& opts) { const auto encrypt_opts = encrypt_opts_ptr(static_cast(opts.convert())); @@ -165,8 +166,8 @@ class client_encryption::impl { return bsoncxx::v_noabi::types::bson_value::make_owning_bson(ciphertext.get()); } - bsoncxx::document::value encrypt_expression(bsoncxx::document::view_or_value expr, - const options::encrypt& opts) { + bsoncxx::v_noabi::document::value encrypt_expression( + bsoncxx::v_noabi::document::view_or_value expr, const options::encrypt& opts) { const auto encrypt_opts = encrypt_opts_ptr(static_cast(opts.convert())); @@ -184,7 +185,8 @@ class client_encryption::impl { return encrypted.steal(); } - bsoncxx::types::bson_value::value decrypt(bsoncxx::types::bson_value::view value) { + bsoncxx::v_noabi::types::bson_value::value decrypt( + bsoncxx::v_noabi::types::bson_value::view value) { scoped_bson_value decrypted_value; bson_error_t error; @@ -198,8 +200,9 @@ class client_encryption::impl { return bsoncxx::v_noabi::types::bson_value::make_owning_bson(decrypted_value.get()); } - result::rewrap_many_datakey rewrap_many_datakey(bsoncxx::document::view_or_value filter, - const options::rewrap_many_datakey& opts) { + result::rewrap_many_datakey rewrap_many_datakey( + bsoncxx::v_noabi::document::view_or_value filter, + const options::rewrap_many_datakey& opts) { using result_type = mongoc_client_encryption_rewrap_many_datakey_result_t; struct result_deleter { @@ -237,17 +240,18 @@ class client_encryption::impl { result.get()); if (bulk_write_result) { - const auto doc = - bsoncxx::document::view(bson_get_data(bulk_write_result), bulk_write_result->len); - return result::rewrap_many_datakey(result::bulk_write(bsoncxx::document::value(doc))); + const auto doc = bsoncxx::v_noabi::document::view(bson_get_data(bulk_write_result), + bulk_write_result->len); + return result::rewrap_many_datakey( + result::bulk_write(bsoncxx::v_noabi::document::value(doc))); } else { return result::rewrap_many_datakey(); } } - result::delete_result delete_key(bsoncxx::types::bson_value::view_or_value id) { - using bsoncxx::builder::basic::kvp; - using bsoncxx::builder::basic::make_document; + result::delete_result delete_key(bsoncxx::v_noabi::types::bson_value::view_or_value id) { + using bsoncxx::v_noabi::builder::basic::kvp; + using bsoncxx::v_noabi::builder::basic::make_document; scoped_bson_t reply; bson_error_t error; @@ -271,7 +275,8 @@ class client_encryption::impl { make_document(kvp("nRemoved", reply.view()["deletedCount"].get_int32())))); } - stdx::optional get_key(bsoncxx::types::bson_value::view_or_value id) { + stdx::optional get_key( + bsoncxx::v_noabi::types::bson_value::view_or_value id) { libbson::scoped_bson_t key_doc; bson_error_t error; @@ -282,11 +287,12 @@ class client_encryption::impl { throw_exception(error); } - return key_doc.view().empty() ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + return key_doc.view().empty() + ? stdx::nullopt + : stdx::optional{key_doc.steal()}; } - mongocxx::cursor get_keys() { + mongocxx::v_noabi::cursor get_keys() { bson_error_t error; mongoc_cursor_t* const cursor = @@ -296,11 +302,12 @@ class client_encryption::impl { throw_exception(error); } - return mongocxx::cursor(cursor); + return mongocxx::v_noabi::cursor(cursor); } - stdx::optional add_key_alt_name( - bsoncxx::types::bson_value::view_or_value id, bsoncxx::string::view_or_value key_alt_name) { + 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; bson_error_t error; @@ -312,12 +319,13 @@ class client_encryption::impl { throw_exception(error); } - return key_doc.view().empty() ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + return key_doc.view().empty() + ? stdx::nullopt + : stdx::optional{key_doc.steal()}; } - stdx::optional get_key_by_alt_name( - bsoncxx::string::view_or_value key_alt_name) { + 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; @@ -328,12 +336,14 @@ class client_encryption::impl { throw_exception(error); } - return key_doc.view().empty() ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + return key_doc.view().empty() + ? stdx::nullopt + : stdx::optional{key_doc.steal()}; } - stdx::optional remove_key_alt_name( - bsoncxx::types::bson_value::view_or_value id, bsoncxx::string::view_or_value key_alt_name) { + 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; bson_error_t error; @@ -345,18 +355,19 @@ class client_encryption::impl { throw_exception(error); } - return key_doc.view().empty() ? stdx::nullopt - : stdx::optional{key_doc.steal()}; + return key_doc.view().empty() + ? stdx::nullopt + : stdx::optional{key_doc.steal()}; } collection create_encrypted_collection( const database& dbcxx, mongoc_database_t* const db, const std::string& coll_name, - const bsoncxx::document::view opts, - bsoncxx::document::value& out_options, + const bsoncxx::v_noabi::document::view opts, + bsoncxx::v_noabi::document::value& out_options, const std::string& kms_provider, - const stdx::optional& masterkey) { + const 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 8508f280cb..3d2ca8b88a 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 @@ -31,8 +31,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + namespace { + struct with_transaction_ctx { client_session* parent; client_session::with_transaction_cb cb; @@ -70,7 +72,7 @@ bool with_transaction_cpp_cb(mongoc_client_session_t*, class client_session::impl { public: - impl(const mongocxx::client* client, const options::client_session& session_options) + impl(const mongocxx::v_noabi::client* client, const options::client_session& session_options) : _client(client), _options(session_options), _session_t(nullptr, nullptr) { // Create a mongoc_session_opts_t from session_options. std::unique_ptr opt_t{ @@ -95,14 +97,14 @@ class client_session::impl { auto s = libmongoc::client_start_session(_client->_get_impl().client_t, opt_t.get(), &error); if (!s) { - throw mongocxx::exception{error_code::k_cannot_create_session, error.message}; + throw mongocxx::v_noabi::exception{error_code::k_cannot_create_session, error.message}; } _session_t = unique_session{ s, [](mongoc_client_session_t* cs) { libmongoc::client_session_destroy(cs); }}; } - const mongocxx::client& client() const noexcept { + const mongocxx::v_noabi::client& client() const noexcept { return *_client; } @@ -115,12 +117,12 @@ class client_session::impl { } // Get session id, also known as "logical session id" or "lsid". - bsoncxx::document::view id() const noexcept { + bsoncxx::v_noabi::document::view id() const noexcept { return bsoncxx::helpers::view_from_bson_t( libmongoc::client_session_get_lsid(_session_t.get())); } - bsoncxx::document::view cluster_time() const noexcept { + bsoncxx::v_noabi::document::view cluster_time() const noexcept { const bson_t* ct = libmongoc::client_session_get_cluster_time(_session_t.get()); if (ct) { return bsoncxx::helpers::view_from_bson_t(ct); @@ -129,20 +131,21 @@ class client_session::impl { return bsoncxx::helpers::view_from_bson_t(&_empty_cluster_time); } - bsoncxx::types::b_timestamp operation_time() const noexcept { - bsoncxx::types::b_timestamp ts; + bsoncxx::v_noabi::types::b_timestamp operation_time() const noexcept { + bsoncxx::v_noabi::types::b_timestamp ts; libmongoc::client_session_get_operation_time( _session_t.get(), &ts.timestamp, &ts.increment); return ts; } - void advance_cluster_time(const bsoncxx::document::view& cluster_time) noexcept { + void advance_cluster_time(const bsoncxx::v_noabi::document::view& cluster_time) noexcept { bson_t bson; bson_init_static(&bson, cluster_time.data(), cluster_time.length()); libmongoc::client_session_advance_cluster_time(_session_t.get(), &bson); } - void advance_operation_time(const bsoncxx::types::b_timestamp& operation_time) noexcept { + void advance_operation_time( + const bsoncxx::v_noabi::types::b_timestamp& operation_time) noexcept { libmongoc::client_session_advance_operation_time( _session_t.get(), operation_time.timestamp, operation_time.increment); } @@ -221,11 +224,11 @@ class client_session::impl { return libmongoc::client_session_get_dirty(_session_t.get()); } - bsoncxx::document::value to_document() const { + bsoncxx::v_noabi::document::value to_document() const { bson_error_t error; bson_t bson = BSON_INITIALIZER; if (!libmongoc::client_session_append(_session_t.get(), &bson, &error)) { - throw mongocxx::logic_error{error_code::k_invalid_session, error.message}; + throw mongocxx::v_noabi::logic_error{error_code::k_invalid_session, error.message}; } // document::value takes ownership of the bson buffer. @@ -237,7 +240,7 @@ class client_session::impl { } private: - const mongocxx::client* _client; + const mongocxx::v_noabi::client* _client; options::client_session _options; using unique_session = 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 164a4a66b9..ff52cd6119 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/collection.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/collection.hh @@ -27,12 +27,13 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class collection::impl { public: impl(mongoc_collection_t* collection, stdx::string_view database_name, - const mongocxx::client::impl* client) + const mongocxx::v_noabi::client::impl* client) : collection_t(collection), database_name(std::move(database_name)), client_impl(client) {} impl(const impl& i) @@ -58,7 +59,7 @@ class collection::impl { mongoc_collection_t* collection_t; std::string database_name; - const mongocxx::client::impl* client_impl; + const mongocxx::v_noabi::client::impl* client_impl; }; } // namespace v_noabi diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.cpp index c1c7029dcd..a4e7b04a52 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.cpp @@ -17,7 +17,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace libmongoc { namespace conversions { @@ -57,5 +56,4 @@ read_preference::read_mode read_mode_from_read_mode_t(mongoc_read_mode_t read_mo } // namespace conversions } // namespace libmongoc -} // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.hh index 058c4b1403..3f2a3835e1 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/conversions.hh @@ -21,7 +21,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace libmongoc { namespace conversions { @@ -33,7 +32,6 @@ MONGOCXX_TEST_API read_preference::read_mode read_mode_from_read_mode_t( } // namespace conversions } // namespace libmongoc -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/cursor.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/cursor.hh index 93f3925ead..ed17f13388 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/cursor.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/cursor.hh @@ -22,7 +22,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class cursor::impl { public: // States represent a one-way, ordered lifecycle of a cursor. k_started means that @@ -30,7 +31,7 @@ class cursor::impl { // cursor, the cursor resets to k_pending on exhaustion so that it can resume later. enum class state { k_pending = 0, k_started = 1, k_dead = 2 }; - impl(mongoc_cursor_t* cursor, bsoncxx::stdx::optional cursor_type) + impl(mongoc_cursor_t* cursor, bsoncxx::v_noabi::stdx::optional cursor_type) : cursor_t(cursor), status{cursor ? state::k_pending : state::k_dead}, exhausted(!cursor), @@ -64,7 +65,7 @@ class cursor::impl { } void mark_nothing_left() { - doc = bsoncxx::document::view{}; + doc = bsoncxx::v_noabi::document::view{}; exhausted = true; status = tailable ? state::k_pending : state::k_dead; } @@ -75,7 +76,7 @@ class cursor::impl { } mongoc_cursor_t* cursor_t; - bsoncxx::document::view doc; + bsoncxx::v_noabi::document::view doc; state status; bool exhausted; bool tailable; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/database.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/database.hh index 07aacf116b..e003ff76c5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/database.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/database.hh @@ -23,10 +23,11 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class database::impl { public: - impl(mongoc_database_t* db, const mongocxx::client::impl* client, std::string name) + impl(mongoc_database_t* db, const mongocxx::v_noabi::client::impl* client, std::string name) : database_t(db), client_impl(client), name(std::move(name)) {} impl(const impl& i) @@ -50,7 +51,7 @@ class database::impl { } mongoc_database_t* database_t; - const mongocxx::client::impl* client_impl; + const mongocxx::v_noabi::client::impl* client_impl; std::string name; }; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/index_view.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/index_view.hh index 7d125830e1..f21ad8deb4 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/index_view.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/index_view.hh @@ -33,9 +33,10 @@ #include namespace mongocxx { -inline namespace v_noabi { -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::make_document; +namespace v_noabi { + +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::make_document; class index_view::impl { public: @@ -50,7 +51,7 @@ class index_view::impl { impl& operator=(const impl& i) = default; - std::string get_index_name_from_keys(bsoncxx::document::view_or_value keys) { + std::string get_index_name_from_keys(bsoncxx::v_noabi::document::view_or_value keys) { libbson::scoped_bson_t keys_bson{keys}; auto name_from_keys = libmongoc::collection_keys_to_index_string(keys_bson.bson()); @@ -62,9 +63,9 @@ class index_view::impl { cursor list(const client_session* session) { if (session) { - bsoncxx::builder::basic::document options_builder; + bsoncxx::v_noabi::builder::basic::document options_builder; options_builder.append( - bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); libbson::scoped_bson_t bson_options(options_builder.extract()); return libmongoc::collection_find_indexes_with_opts(_coll, bson_options.bson()); } @@ -72,9 +73,9 @@ class index_view::impl { return libmongoc::collection_find_indexes_with_opts(_coll, nullptr); } - bsoncxx::stdx::optional create_one(const client_session* session, - const index_model& model, - const options::index_view& options) { + bsoncxx::v_noabi::stdx::optional create_one(const client_session* session, + const index_model& model, + const options::index_view& options) { const auto result = create_many(session, std::vector{model}, options); auto result_view = result.view(); @@ -98,22 +99,22 @@ class index_view::impl { const auto note = result_view["note"]; - if (note && - bsoncxx::string::to_string(note.get_string().value) == "all indexes already exist") { - return bsoncxx::stdx::nullopt; + if (note && bsoncxx::v_noabi::string::to_string(note.get_string().value) == + "all indexes already exist") { + return bsoncxx::v_noabi::stdx::nullopt; } if (auto name = model.options()["name"]) { - return bsoncxx::stdx::make_optional( - bsoncxx::string::to_string(name.get_value().get_string().value)); + return bsoncxx::v_noabi::stdx::make_optional( + bsoncxx::v_noabi::string::to_string(name.get_value().get_string().value)); } - return bsoncxx::stdx::make_optional(get_index_name_from_keys(model.keys())); + return bsoncxx::v_noabi::stdx::make_optional(get_index_name_from_keys(model.keys())); } - bsoncxx::document::value create_many(const client_session* session, - const std::vector& indexes, - const options::index_view& options) { + bsoncxx::v_noabi::document::value create_many(const client_session* session, + const std::vector& indexes, + const options::index_view& options) { using namespace bsoncxx; using builder::basic::concatenate; @@ -121,8 +122,8 @@ class index_view::impl { for (auto&& model : indexes) { builder::basic::document index_doc; - const bsoncxx::document::view& opts_view = model.options(); - const bsoncxx::document::view& keys = model.keys(); + const bsoncxx::v_noabi::document::view& opts_view = model.options(); + const bsoncxx::v_noabi::document::view& keys = model.keys(); if (!opts_view["name"]) { index_doc.append(kvp("name", get_index_name_from_keys(keys))); @@ -142,7 +143,8 @@ class index_view::impl { builder::basic::document opts_doc; if (options.max_time()) { - opts_doc.append(kvp("maxTimeMS", bsoncxx::types::b_int64{options.max_time()->count()})); + opts_doc.append( + kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{options.max_time()->count()})); } if (options.write_concern()) { @@ -150,7 +152,8 @@ class index_view::impl { } if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } if (options.commit_quorum()) { @@ -187,16 +190,17 @@ class index_view::impl { } void drop_one(const client_session* session, - bsoncxx::stdx::string_view name, + bsoncxx::v_noabi::stdx::string_view name, const options::index_view& options) { - if (name == bsoncxx::stdx::string_view{"*"}) { + if (name == bsoncxx::v_noabi::stdx::string_view{"*"}) { throw logic_error(error_code::k_invalid_parameter); } - bsoncxx::builder::basic::document opts_doc; + bsoncxx::v_noabi::builder::basic::document opts_doc; if (options.max_time()) { - opts_doc.append(kvp("maxTimeMS", bsoncxx::types::b_int64{options.max_time()->count()})); + opts_doc.append( + kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{options.max_time()->count()})); } if (options.write_concern()) { @@ -204,10 +208,11 @@ class index_view::impl { } if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } - bsoncxx::document::value command = make_document( + bsoncxx::v_noabi::document::value command = make_document( kvp("dropIndexes", libmongoc::collection_get_name(_coll)), kvp("index", name)); libbson::scoped_bson_t reply; @@ -223,9 +228,8 @@ class index_view::impl { } } - MONGOCXX_INLINE void drop_all(const client_session* session, - const options::index_view& options) { - bsoncxx::document::value command = make_document( + inline void drop_all(const client_session* session, const options::index_view& options) { + bsoncxx::v_noabi::document::value command = make_document( kvp("dropIndexes", libmongoc::collection_get_name(_coll)), kvp("index", "*")); libbson::scoped_bson_t reply; @@ -233,10 +237,11 @@ class index_view::impl { libbson::scoped_bson_t command_bson{command.view()}; - bsoncxx::builder::basic::document opts_doc; + bsoncxx::v_noabi::builder::basic::document opts_doc; if (options.max_time()) { - opts_doc.append(kvp("maxTimeMS", bsoncxx::types::b_int64{options.max_time()->count()})); + opts_doc.append( + kvp("maxTimeMS", bsoncxx::v_noabi::types::b_int64{options.max_time()->count()})); } if (options.write_concern()) { @@ -244,7 +249,8 @@ class index_view::impl { } if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } libbson::scoped_bson_t opts_bson{opts_doc.view()}; @@ -269,6 +275,7 @@ class index_view::impl { mongoc_server_description_t* sd; }; }; + } // namespace v_noabi } // namespace mongocxx 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 ff8f68c406..064b33bdde 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.cpp @@ -17,16 +17,15 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace libbson { namespace { -void doc_to_bson_t(const bsoncxx::document::view& doc, bson_t* bson) { +void doc_to_bson_t(const bsoncxx::v_noabi::document::view& doc, bson_t* bson) { // While bson_init_static is documented as returning false if the bson_t was unable to be // initialized, this only occurs when the length of the data passed in is less than five. We - // assume that the data from the bsoncxx::document::view is valid and that bson_init_static will - // not be changed to fail to initialize the bson_t in any other case. + // assume that the data from the bsoncxx::v_noabi::document::view is valid and that + // bson_init_static will not be changed to fail to initialize the bson_t in any other case. bson_init_static(bson, doc.data(), doc.length()); } @@ -34,12 +33,12 @@ void doc_to_bson_t(const bsoncxx::document::view& doc, bson_t* bson) { #if !defined(BSONCXX_POLY_USE_STD) -scoped_bson_t::scoped_bson_t(bsoncxx::document::view_or_value doc) +scoped_bson_t::scoped_bson_t(bsoncxx::v_noabi::document::view_or_value doc) : _is_initialized{true}, _doc{std::move(doc)} { doc_to_bson_t(*_doc, &_bson); } -void scoped_bson_t::init_from_static(bsoncxx::document::view_or_value doc) { +void scoped_bson_t::init_from_static(bsoncxx::v_noabi::document::view_or_value doc) { _is_initialized = true; _doc = std::move(doc); doc_to_bson_t(*_doc, &_bson); @@ -47,7 +46,8 @@ void scoped_bson_t::init_from_static(bsoncxx::document::view_or_value doc) { #endif -scoped_bson_t::scoped_bson_t(bsoncxx::stdx::optional doc) +scoped_bson_t::scoped_bson_t( + bsoncxx::v_noabi::stdx::optional doc) : _is_initialized{doc} { if (doc) { _doc = std::move(doc); @@ -56,7 +56,7 @@ scoped_bson_t::scoped_bson_t(bsoncxx::stdx::optional doc) { + bsoncxx::v_noabi::stdx::optional doc) { if (doc) { _is_initialized = true; _doc = std::move(doc); @@ -91,17 +91,17 @@ bson_t* scoped_bson_t::bson_for_init() { return &_bson; } -bsoncxx::document::view scoped_bson_t::view() { +bsoncxx::v_noabi::document::view scoped_bson_t::view() { // if we were initialized with a view_or_value just use that view if (_doc) { return _doc->view(); } // otherwise, if we were initialized from libmongoc, construct if (_is_initialized) { - return bsoncxx::document::view{bson_get_data(bson()), bson()->len}; + return bsoncxx::v_noabi::document::view{bson_get_data(bson()), bson()->len}; } // otherwise, return an empty view - return bsoncxx::document::view{}; + return bsoncxx::v_noabi::document::view{}; } namespace { @@ -112,9 +112,9 @@ void bson_free_deleter(std::uint8_t* ptr) { } // anonymous namespace -bsoncxx::document::value scoped_bson_t::steal() { +bsoncxx::v_noabi::document::value scoped_bson_t::steal() { if (!_is_initialized) { - return bsoncxx::document::value{bsoncxx::document::view()}; + return bsoncxx::v_noabi::document::value{bsoncxx::v_noabi::document::view()}; } std::uint32_t length; @@ -122,9 +122,8 @@ bsoncxx::document::value scoped_bson_t::steal() { _is_initialized = false; - return bsoncxx::document::value(buff, length, bson_free_deleter); + return bsoncxx::v_noabi::document::value(buff, length, bson_free_deleter); } } // namespace libbson -} // namespace v_noabi } // namespace mongocxx 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 a1d356efca..e07ecd21a7 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libbson.hh @@ -25,7 +25,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace libbson { // @@ -61,14 +60,14 @@ class MONGOCXX_TEST_API scoped_bson_t { // // The internal bson_t is considered initialized. // - explicit scoped_bson_t(bsoncxx::document::view_or_value doc); + explicit scoped_bson_t(bsoncxx::v_noabi::document::view_or_value doc); // // Initializes a bson_t from the provided document. // // The internal bson_t is considered initialized. // - void init_from_static(bsoncxx::document::view_or_value doc); + void init_from_static(bsoncxx::v_noabi::document::view_or_value doc); #endif // @@ -76,14 +75,16 @@ class MONGOCXX_TEST_API scoped_bson_t { // // The internal bson_t is initialized if the optional is populated. // - explicit scoped_bson_t(bsoncxx::stdx::optional doc); + explicit scoped_bson_t( + bsoncxx::v_noabi::stdx::optional doc); // // Initializes a bson_t from the provided optional document. // // The internal bson_t is initialized if the optional is populated. // - void init_from_static(bsoncxx::stdx::optional doc); + void init_from_static( + bsoncxx::v_noabi::stdx::optional doc); // // Initialize the internal bson_t. @@ -123,19 +124,18 @@ class MONGOCXX_TEST_API scoped_bson_t { // bson_t* bson_for_init(); - bsoncxx::document::view view(); - bsoncxx::document::value steal(); + bsoncxx::v_noabi::document::view view(); + bsoncxx::v_noabi::document::value steal(); private: bson_t _bson; bool _is_initialized; // If we are passed a value created on-the-fly, we'll need to own this. - bsoncxx::stdx::optional _doc; + bsoncxx::v_noabi::stdx::optional _doc; }; } // namespace libbson -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.cpp index bf42167966..720b33698b 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.cpp @@ -17,7 +17,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace libmongoc { #ifdef MONGOCXX_TESTING @@ -41,5 +40,4 @@ namespace libmongoc { #endif // MONGOCXX_TESTING } // namespace libmongoc -} // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.hh index 392422b2cf..89036671c3 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/libmongoc.hh @@ -34,12 +34,12 @@ // TODO: CXX-1366 Disable MSVC warnings for libmongoc #endif +#include #include #include namespace mongocxx { -inline namespace v_noabi { namespace libmongoc { #ifdef MONGOCXX_TESTING @@ -55,7 +55,7 @@ namespace libmongoc { #endif #define MONGOCXX_LIBMONGOC_SYMBOL(name) \ - extern MONGOCXX_API mongocxx::test_util::mock& name; + extern MONGOCXX_TEST_API mongocxx::test_util::mock& name; #include "libmongoc_symbols.hh" #undef MONGOCXX_LIBMONGOC_SYMBOL @@ -64,13 +64,14 @@ namespace libmongoc { #endif #else + #define MONGOCXX_LIBMONGOC_SYMBOL(name) constexpr auto name = mongoc_##name; #include "libmongoc_symbols.hh" #undef MONGOCXX_LIBMONGOC_SYMBOL + #endif } // namespace libmongoc -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.cpp index 4d7dda7461..a67f31c4a6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.cpp @@ -19,7 +19,7 @@ #include namespace mongocxx { -inline namespace v_noabi { + bool size_t_to_int64_safe(const std::size_t in, int64_t& out) { if (sizeof(in) >= sizeof(int64_t)) { if (in > static_cast(std::numeric_limits::max())) { @@ -67,5 +67,4 @@ bool int64_to_size_t_safe(const int64_t in, std::size_t& out) { return true; } -} // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.hh index 874ffcc540..72be97b0f9 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/numeric_casting.hh @@ -22,7 +22,7 @@ #include namespace mongocxx { -inline namespace v_noabi { + // size_t_to_int64_safe checks if @in is within the bounds of an int64_t. // If yes, it safely casts into @out and returns true. // If no, @out is not modified and returns false. @@ -47,7 +47,6 @@ bool int32_to_size_t_safe(const int32_t in, std::size_t& out); MONGOCXX_TEST_API bool int64_to_size_t_safe(const int64_t in, std::size_t& out); -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pipeline.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pipeline.hh index c006ab6f77..7e5dda6cbe 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pipeline.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pipeline.hh @@ -20,26 +20,27 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class pipeline::impl { public: - bsoncxx::builder::basic::array& sink() { + bsoncxx::v_noabi::builder::basic::array& sink() { return _builder; } - bsoncxx::array::view view_array() { + bsoncxx::v_noabi::array::view view_array() { return _builder.view(); } /// /// view() is deprecated. Use view_array() instead. /// - bsoncxx::document::view view() { + bsoncxx::v_noabi::document::view view() { return _builder.view(); } private: - bsoncxx::builder::basic::array _builder; + bsoncxx::v_noabi::builder::basic::array _builder; }; } // namespace v_noabi diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pool.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pool.hh index 536c570058..b2cbfafc25 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pool.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/pool.hh @@ -23,7 +23,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class pool::impl { public: impl(mongoc_client_pool_t* pool) : client_pool_t(pool) {} @@ -33,7 +34,7 @@ class pool::impl { } mongoc_client_pool_t* client_pool_t; - std::list tls_options; + std::list tls_options; options::apm listeners; }; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_concern.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_concern.hh index fe15c653e3..c7b5704f4d 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_concern.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_concern.hh @@ -20,7 +20,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class read_concern::impl { public: impl(::mongoc_read_concern_t* read_concern) : read_concern_t{read_concern} {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_preference.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_preference.hh index 1bb2f6580a..38a028270e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_preference.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/read_preference.hh @@ -20,7 +20,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class read_preference::impl { public: impl(mongoc_read_prefs_t* read_pref) : read_preference_t(read_pref) {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_model.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_model.hh index 199181d1ee..500638f475 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_model.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_model.hh @@ -6,15 +6,17 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class search_index_model::impl { public: - impl(bsoncxx::document::view_or_value definition) : _definition(definition.view()) {} - impl(bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value definition) + impl(bsoncxx::v_noabi::document::view_or_value definition) : _definition(definition.view()) {} + impl(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) : _name(name), _definition(definition.view()) {} - bsoncxx::stdx::optional _name; - bsoncxx::document::view_or_value _definition; + bsoncxx::v_noabi::stdx::optional _name; + bsoncxx::v_noabi::document::view_or_value _definition; }; } // namespace v_noabi diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_view.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_view.hh index 3ce12a5ed4..5e0d5bdaa3 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_view.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/search_index_view.hh @@ -14,9 +14,10 @@ #include namespace mongocxx { -inline namespace v_noabi { -using bsoncxx::builder::basic::kvp; -using bsoncxx::builder::basic::make_document; +namespace v_noabi { + +using bsoncxx::v_noabi::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::make_document; struct collection_deleter { void operator()(mongoc_collection_t* ptr) noexcept { @@ -48,7 +49,7 @@ class search_index_view::impl { : _coll{collection}, _client{client} {} cursor list(const client_session* session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::aggregate& options) { pipeline pipeline{}; pipeline.append_stage( @@ -65,13 +66,14 @@ class search_index_view::impl { cursor list(const client_session* session, const pipeline& pipeline, const options::aggregate& options) { - bsoncxx::builder::basic::document opts_doc; - libbson::scoped_bson_t stages(bsoncxx::document::view(pipeline.view_array())); + bsoncxx::v_noabi::builder::basic::document opts_doc; + libbson::scoped_bson_t stages(bsoncxx::v_noabi::document::view(pipeline.view_array())); append_aggregate_options(opts_doc, options); if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } const mongoc_read_prefs_t* const rp_ptr = @@ -87,17 +89,17 @@ class search_index_view::impl { std::string create_one(const client_session* session, const search_index_model& model) { const auto result = create_many(session, std::vector{model}); - return bsoncxx::string::to_string(result["indexesCreated"] - .get_array() - .value.begin() - ->get_document() - .value["name"] - .get_string() - .value); + return bsoncxx::v_noabi::string::to_string(result["indexesCreated"] + .get_array() + .value.begin() + ->get_document() + .value["name"] + .get_string() + .value); } - bsoncxx::document::value create_many(const client_session* session, - const std::vector& search_indexes) { + bsoncxx::v_noabi::document::value create_many( + const client_session* session, const std::vector& search_indexes) { using namespace bsoncxx; builder::basic::array search_index_arr; @@ -106,8 +108,8 @@ class search_index_view::impl { builder::basic::document search_index_doc; // model may or may not have a name attached to it. The server will create the name if // it is not set. - const stdx::optional name = model.name(); - const bsoncxx::document::view& definition = model.definition(); + const stdx::optional name = model.name(); + const bsoncxx::v_noabi::document::view& definition = model.definition(); if (name) { search_index_doc.append(kvp("name", name.value())); @@ -126,7 +128,8 @@ class search_index_view::impl { builder::basic::document opts_doc; if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } libbson::scoped_bson_t command_bson{command}; @@ -143,15 +146,16 @@ class search_index_view::impl { return reply.steal(); } - void drop_one(const client_session* session, bsoncxx::string::view_or_value name) { - bsoncxx::builder::basic::document opts_doc; + void drop_one(const client_session* session, bsoncxx::v_noabi::string::view_or_value name) { + bsoncxx::v_noabi::builder::basic::document opts_doc; - bsoncxx::document::value command = + bsoncxx::v_noabi::document::value command = make_document(kvp("dropSearchIndex", libmongoc::collection_get_name(_coll)), kvp("name", name.view())); if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } libbson::scoped_bson_t reply; @@ -177,16 +181,17 @@ class search_index_view::impl { } void update_one(const client_session* session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition) { - bsoncxx::builder::basic::document opts_doc; - bsoncxx::document::value command = + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) { + bsoncxx::v_noabi::builder::basic::document opts_doc; + bsoncxx::v_noabi::document::value command = make_document(kvp("updateSearchIndex", libmongoc::collection_get_name(_coll)), kvp("name", name.view()), kvp("definition", definition.view())); if (session) { - opts_doc.append(bsoncxx::builder::concatenate_doc{session->_get_impl().to_document()}); + opts_doc.append( + bsoncxx::v_noabi::builder::concatenate_doc{session->_get_impl().to_document()}); } libbson::scoped_bson_t reply; @@ -206,6 +211,7 @@ class search_index_view::impl { mongoc_collection_t* _coll; mongoc_client_t* _client; }; + } // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/uri.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/uri.hh index db05e2f063..9b1bafd073 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/uri.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/uri.hh @@ -20,7 +20,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class uri::impl { public: impl(mongoc_uri_t* uri) : uri_t(uri) {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/write_concern.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/write_concern.hh index a2e6808f7b..da767ee847 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/write_concern.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/write_concern.hh @@ -20,7 +20,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + class write_concern::impl { public: impl(mongoc_write_concern_t* write_concern) : write_concern_t(write_concern) {} 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 594ecc4b45..8d6645da08 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp @@ -24,7 +24,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + read_concern::read_concern() : _impl{stdx::make_unique(libmongoc::read_concern_new())} {} read_concern::read_concern(std::unique_ptr&& implementation) @@ -78,7 +79,7 @@ void read_concern::acknowledge_string(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, - rc_string.empty() ? NULL : bsoncxx::string::to_string(rc_string).data()); + rc_string.empty() ? NULL : bsoncxx::v_noabi::string::to_string(rc_string).data()); } read_concern::level read_concern::acknowledge_level() const { @@ -109,12 +110,12 @@ stdx::string_view read_concern::acknowledge_string() const { return {stdx::string_view{level}}; } -bsoncxx::document::value read_concern::to_document() const { - using bsoncxx::builder::basic::kvp; +bsoncxx::v_noabi::document::value read_concern::to_document() const { + using bsoncxx::v_noabi::builder::basic::kvp; auto level = libmongoc::read_concern_get_level(_impl->read_concern_t); - bsoncxx::builder::basic::document doc; + bsoncxx::v_noabi::builder::basic::document doc; if (level) { doc.append(kvp("level", level)); }; 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 fe9f34375a..187b68535c 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp @@ -25,7 +25,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + read_preference::read_preference(read_preference&&) noexcept = default; read_preference& read_preference::operator=(read_preference&&) noexcept = default; @@ -52,11 +53,11 @@ read_preference::read_preference(read_mode mode, deprecated_tag) : _impl(stdx::make_unique( libmongoc::read_prefs_new(libmongoc::conversions::read_mode_t_from_read_mode(mode)))) {} -read_preference::read_preference(read_mode mode, bsoncxx::document::view_or_value tags) +read_preference::read_preference(read_mode mode, bsoncxx::v_noabi::document::view_or_value tags) : read_preference(mode, std::move(tags), deprecated_tag{}) {} read_preference::read_preference(read_mode mode, - bsoncxx::document::view_or_value tags, + bsoncxx::v_noabi::document::view_or_value tags, deprecated_tag) : read_preference(mode, deprecated_tag{}) { read_preference::tags(std::move(tags)); @@ -71,15 +72,15 @@ read_preference& read_preference::mode(read_mode mode) { return *this; } -read_preference& read_preference::tags(bsoncxx::document::view_or_value tag_set_list) { +read_preference& read_preference::tags(bsoncxx::v_noabi::document::view_or_value tag_set_list) { libbson::scoped_bson_t scoped_bson_tags(std::move(tag_set_list)); libmongoc::read_prefs_set_tags(_impl->read_preference_t, scoped_bson_tags.bson()); return *this; } -read_preference& read_preference::tags(bsoncxx::array::view_or_value tag_set_list) { - libbson::scoped_bson_t scoped_bson_tags(bsoncxx::document::view(tag_set_list.view())); +read_preference& read_preference::tags(bsoncxx::v_noabi::array::view_or_value tag_set_list) { + libbson::scoped_bson_t scoped_bson_tags(bsoncxx::v_noabi::document::view(tag_set_list.view())); libmongoc::read_prefs_set_tags(_impl->read_preference_t, scoped_bson_tags.bson()); return *this; @@ -90,13 +91,13 @@ read_preference::read_mode read_preference::mode() const { libmongoc::read_prefs_get_mode(_impl->read_preference_t)); } -stdx::optional read_preference::tags() const { +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::document::view(bson_get_data(bson_tags), bson_tags->len); + return bsoncxx::v_noabi::document::view(bson_get_data(bson_tags), bson_tags->len); - return stdx::optional{}; + return stdx::optional{}; } read_preference& read_preference::max_staleness(std::chrono::seconds max_staleness) { @@ -120,21 +121,21 @@ stdx::optional read_preference::max_staleness() const { return std::chrono::seconds{staleness}; } -read_preference& read_preference::hedge(bsoncxx::document::view_or_value hedge) { +read_preference& read_preference::hedge(bsoncxx::v_noabi::document::view_or_value hedge) { libbson::scoped_bson_t hedge_bson{std::move(hedge)}; libmongoc::read_prefs_set_hedge(_impl->read_preference_t, hedge_bson.bson()); return *this; } -const stdx::optional read_preference::hedge() const { +const 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::document::view(bson_get_data(hedge_bson), hedge_bson->len); + return bsoncxx::v_noabi::document::view(bson_get_data(hedge_bson), hedge_bson->len); } - return stdx::optional{}; + return stdx::optional{}; } bool MONGOCXX_CALL operator==(const read_preference& lhs, const read_preference& rhs) { diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/bulk_write.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/bulk_write.cpp index 842f3c74a1..2089a41253 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/bulk_write.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/bulk_write.cpp @@ -17,10 +17,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { -bulk_write::bulk_write(bsoncxx::document::value raw_response) +bulk_write::bulk_write(bsoncxx::v_noabi::document::value raw_response) : _response(std::move(raw_response)) {} std::int32_t bulk_write::inserted_count() const { @@ -56,7 +56,7 @@ bulk_write::id_map bulk_write::upserted_ids() const { return upserted_ids; } -bsoncxx::document::view bulk_write::view() const { +bsoncxx::v_noabi::document::view bulk_write::view() const { return _response.view(); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/delete.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/delete.cpp index 0cfd9b65a7..03a8735d26 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/delete.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/delete.cpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { delete_result::delete_result(result::bulk_write result) : _result(std::move(result)) {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/gridfs/upload.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/gridfs/upload.cpp index bf32723330..90a515c069 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/gridfs/upload.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/gridfs/upload.cpp @@ -18,14 +18,15 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { namespace gridfs { -upload::upload(bsoncxx::types::bson_value::view id) - : _id_owned(bsoncxx::builder::basic::make_array(id)), _id(_id_owned.view()[0].get_value()) {} +upload::upload(bsoncxx::v_noabi::types::bson_value::view id) + : _id_owned(bsoncxx::v_noabi::builder::basic::make_array(id)), + _id(_id_owned.view()[0].get_value()) {} -const bsoncxx::types::bson_value::view& upload::id() const { +const bsoncxx::v_noabi::types::bson_value::view& upload::id() const { return _id; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_many.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_many.cpp index 2e8be0ef33..24d2bd7e78 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_many.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_many.cpp @@ -18,10 +18,10 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { -insert_many::insert_many(result::bulk_write result, bsoncxx::array::value inserted_ids) +insert_many::insert_many(result::bulk_write result, bsoncxx::v_noabi::array::value inserted_ids) : _result(std::move(result)), _inserted_ids_owned(std::move(inserted_ids)) { _buildInsertedIds(); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_one.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_one.cpp index 75ee336a1a..d5cf53e7b5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_one.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/insert_one.cpp @@ -18,19 +18,20 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { -insert_one::insert_one(result::bulk_write result, bsoncxx::types::bson_value::view inserted_id) +insert_one::insert_one(result::bulk_write result, + bsoncxx::v_noabi::types::bson_value::view inserted_id) : _result(std::move(result)), - _inserted_id_owned(bsoncxx::builder::basic::make_array(inserted_id)), + _inserted_id_owned(bsoncxx::v_noabi::builder::basic::make_array(inserted_id)), _inserted_id(_inserted_id_owned.view()[0].get_value()) {} const result::bulk_write& insert_one::result() const { return _result; } -const bsoncxx::types::bson_value::view& insert_one::inserted_id() const { +const bsoncxx::v_noabi::types::bson_value::view& insert_one::inserted_id() const { return _inserted_id; } 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 f445394284..e4f34751b8 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 @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { replace_one::replace_one(result::bulk_write result) : _result(std::move(result)) {} @@ -34,7 +34,7 @@ std::int32_t replace_one::modified_count() const { return _result.modified_count(); } -stdx::optional replace_one::upserted_id() const { +stdx::optional replace_one::upserted_id() const { if (_result.upserted_ids().size() == 0) { return stdx::nullopt; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.cpp index 80b355acc2..f808172095 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/rewrap_many_datakey.cpp @@ -19,14 +19,16 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { -rewrap_many_datakey::rewrap_many_datakey(mongocxx::result::bulk_write bulk_write_result_doc) { +rewrap_many_datakey::rewrap_many_datakey( + mongocxx::v_noabi::result::bulk_write bulk_write_result_doc) { _result = std::move(bulk_write_result_doc); } -const bsoncxx::stdx::optional& rewrap_many_datakey::result() { +const bsoncxx::v_noabi::stdx::optional& +rewrap_many_datakey::result() { return _result; } 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 86a2752720..33491b51d5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/update.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/result/update.cpp @@ -17,7 +17,7 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { namespace result { update::update(result::bulk_write result) : _result(std::move(result)) {} @@ -37,7 +37,7 @@ std::int32_t update::upserted_count() const { return _result.upserted_count(); } -stdx::optional update::upserted_id() const { +stdx::optional update::upserted_id() const { if (_result.upserted_ids().size() == 0) { return stdx::nullopt; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp index d747923ba7..f6f35ea08a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp @@ -7,19 +7,20 @@ #include namespace mongocxx { -inline namespace v_noabi { -search_index_model::search_index_model(bsoncxx::document::view_or_value definition) - : _impl{bsoncxx::stdx::make_unique(definition)} {} -search_index_model::search_index_model(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition) - : _impl{bsoncxx::stdx::make_unique(name, definition)} {} +namespace v_noabi { + +search_index_model::search_index_model(bsoncxx::v_noabi::document::view_or_value definition) + : _impl{bsoncxx::v_noabi::stdx::make_unique(definition)} {} +search_index_model::search_index_model(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) + : _impl{bsoncxx::v_noabi::stdx::make_unique(name, definition)} {} search_index_model::search_index_model(search_index_model&&) noexcept = default; search_index_model& search_index_model::operator=(search_index_model&&) noexcept = default; search_index_model::search_index_model(const search_index_model& other) - : _impl(bsoncxx::stdx::make_unique(other._get_impl())) {} + : _impl(bsoncxx::v_noabi::stdx::make_unique(other._get_impl())) {} search_index_model& search_index_model::operator=(const search_index_model& other) { _get_impl() = other._get_impl(); @@ -28,11 +29,12 @@ search_index_model& search_index_model::operator=(const search_index_model& othe search_index_model::~search_index_model() = default; -bsoncxx::stdx::optional search_index_model::name() const { +bsoncxx::v_noabi::stdx::optional search_index_model::name() + const { return _get_impl()._name; } -bsoncxx::document::view search_index_model::definition() const { +bsoncxx::v_noabi::document::view search_index_model::definition() const { return _get_impl()._definition.view(); } 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 054c4c694f..6e3c2e7eb0 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 @@ -7,7 +7,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + search_index_view::search_index_view(void* coll, void* client) : _impl{stdx::make_unique(static_cast(coll), static_cast(client))} {} @@ -33,34 +34,34 @@ cursor search_index_view::list(const client_session& session, const options::agg return _get_impl().list(&session, options); } -cursor search_index_view::list(bsoncxx::string::view_or_value name, +cursor search_index_view::list(bsoncxx::v_noabi::string::view_or_value name, const options::aggregate& options) { return _get_impl().list(nullptr, name, options); } cursor search_index_view::list(const client_session& session, - bsoncxx::string::view_or_value name, + bsoncxx::v_noabi::string::view_or_value name, const options::aggregate& options) { return _get_impl().list(&session, name, options); } -std::string search_index_view::create_one(bsoncxx::document::view_or_value definition) { +std::string search_index_view::create_one(bsoncxx::v_noabi::document::view_or_value definition) { return create_one(search_index_model(definition)); } std::string search_index_view::create_one(const client_session& session, - bsoncxx::document::view_or_value definition) { + bsoncxx::v_noabi::document::view_or_value definition) { return create_one(session, search_index_model(definition)); } -std::string search_index_view::create_one(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition) { +std::string search_index_view::create_one(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) { return create_one(search_index_model(name, definition)); } std::string search_index_view::create_one(const client_session& session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition) { + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) { return create_one(session, search_index_model(name, definition)); } @@ -86,38 +87,38 @@ std::vector search_index_view::create_many( } std::vector search_index_view::_create_many_helper( - bsoncxx::array::view created_indexes) { + bsoncxx::v_noabi::array::view created_indexes) { std::vector search_index_names; for (auto&& index : created_indexes) { - search_index_names.push_back( - bsoncxx::string::to_string(index.get_document().value["name"].get_string().value)); + search_index_names.push_back(bsoncxx::v_noabi::string::to_string( + index.get_document().value["name"].get_string().value)); } return search_index_names; } -void search_index_view::drop_one(bsoncxx::string::view_or_value name) { +void search_index_view::drop_one(bsoncxx::v_noabi::string::view_or_value name) { _get_impl().drop_one(nullptr, name); } void search_index_view::drop_one(const client_session& session, - bsoncxx::string::view_or_value name) { + bsoncxx::v_noabi::string::view_or_value name) { _get_impl().drop_one(&session, name); } -void search_index_view::update_one(bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition) { +void search_index_view::update_one(bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) { _get_impl().update_one(nullptr, name, definition); } void search_index_view::update_one(const client_session& session, - bsoncxx::string::view_or_value name, - bsoncxx::document::view_or_value definition) { + bsoncxx::v_noabi::string::view_or_value name, + bsoncxx::v_noabi::document::view_or_value definition) { _get_impl().update_one(&session, name, definition); } const search_index_view::impl& search_index_view::_get_impl() const { if (!_impl) { - throw mongocxx::logic_error{error_code::k_invalid_search_index_view}; + throw mongocxx::v_noabi::logic_error{error_code::k_invalid_search_index_view}; } return *_impl; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/test_util/mock.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/test_util/mock.hh index 50dd03b939..afe4c1c76c 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/test_util/mock.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/test_util/mock.hh @@ -31,7 +31,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace test_util { template @@ -189,7 +188,6 @@ class mock { }; } // namespace test_util -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp index 328b158fb0..bff7afad1e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp @@ -26,7 +26,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + namespace { // Some of the 'uri_get_*' string accessors may return nullptr. Check for this case and convert to @@ -46,7 +47,7 @@ uri::uri(std::unique_ptr&& implementation) { _impl.reset(implementation.release()); } -uri::uri(bsoncxx::string::view_or_value uri_string) { +uri::uri(bsoncxx::v_noabi::string::view_or_value uri_string) { bson_error_t error; _impl = stdx::make_unique( @@ -85,24 +86,24 @@ std::vector uri::hosts() const { return result; } -bsoncxx::document::view uri::options() const { +bsoncxx::v_noabi::document::view uri::options() const { auto opts_bson = libmongoc::uri_get_options(_impl->uri_t); - return bsoncxx::document::view{::bson_get_data(opts_bson), opts_bson->len}; + return bsoncxx::v_noabi::document::view{::bson_get_data(opts_bson), opts_bson->len}; } std::string uri::password() const { return to_string_null_safe(libmongoc::uri_get_password(_impl->uri_t)); } -mongocxx::read_concern uri::read_concern() const { +mongocxx::v_noabi::read_concern uri::read_concern() const { auto rc = libmongoc::uri_get_read_concern(_impl->uri_t); - return mongocxx::read_concern( + return mongocxx::v_noabi::read_concern( stdx::make_unique(libmongoc::read_concern_copy(rc))); } -mongocxx::read_preference uri::read_preference() const { +mongocxx::v_noabi::read_preference uri::read_preference() const { auto rp = libmongoc::uri_get_read_prefs_t(_impl->uri_t); - return (mongocxx::read_preference)( + return (mongocxx::v_noabi::read_preference)( stdx::make_unique(libmongoc::read_prefs_copy(rp))); } @@ -126,9 +127,9 @@ std::string uri::username() const { return to_string_null_safe(libmongoc::uri_get_username(_impl->uri_t)); } -mongocxx::write_concern uri::write_concern() const { +mongocxx::v_noabi::write_concern uri::write_concern() const { auto wc = libmongoc::uri_get_write_concern(_impl->uri_t); - return mongocxx::write_concern( + return mongocxx::v_noabi::write_concern( stdx::make_unique(libmongoc::write_concern_copy(wc))); } @@ -165,19 +166,19 @@ static stdx::optional _bool_option(mongoc_uri_t* uri, std::string opt_name return bson_iter_bool(&iter); } -stdx::optional uri::credentials() { +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::document::view(data, options_bson->len); + return bsoncxx::v_noabi::document::view(data, options_bson->len); } 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 stdx::optional _credential_document_option( + mongoc_uri_t* uri, std::string opt_name) { bson_iter_t iter; const uint8_t* data; uint32_t len; @@ -188,7 +189,7 @@ static stdx::optional _credential_document_option(mongo return {}; } bson_iter_document(&iter, &len, &data); - return bsoncxx::document::view(data, len); + return bsoncxx::v_noabi::document::view(data, len); } stdx::optional uri::appname() const { @@ -196,7 +197,7 @@ stdx::optional uri::appname() const { } // Special case. authMechanismProperties are stored as part of libmongoc's credentials. -stdx::optional uri::auth_mechanism_properties() const { +stdx::optional uri::auth_mechanism_properties() const { return _credential_document_option(_impl->uri_t, "authMechanismProperties"); } 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 a3ad09f6f7..3faa50b7d8 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/validation_criteria.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/validation_criteria.cpp @@ -19,16 +19,17 @@ namespace { -using bsoncxx::builder::basic::kvp; +using bsoncxx::v_noabi::builder::basic::kvp; // Convert validation levels to strings. -std::string validation_level_to_string(mongocxx::validation_criteria::validation_level level) { +std::string validation_level_to_string( + mongocxx::v_noabi::validation_criteria::validation_level level) { switch (level) { - case mongocxx::validation_criteria::validation_level::k_off: + case mongocxx::v_noabi::validation_criteria::validation_level::k_off: return "off"; - case mongocxx::validation_criteria::validation_level::k_moderate: + case mongocxx::v_noabi::validation_criteria::validation_level::k_moderate: return "moderate"; - case mongocxx::validation_criteria::validation_level::k_strict: + case mongocxx::v_noabi::validation_criteria::validation_level::k_strict: return "strict"; } @@ -36,11 +37,12 @@ std::string validation_level_to_string(mongocxx::validation_criteria::validation } // Convert validation actions to strings. -std::string validation_action_to_string(mongocxx::validation_criteria::validation_action action) { +std::string validation_action_to_string( + mongocxx::v_noabi::validation_criteria::validation_action action) { switch (action) { - case mongocxx::validation_criteria::validation_action::k_warn: + case mongocxx::v_noabi::validation_criteria::validation_action::k_warn: return "warn"; - case mongocxx::validation_criteria::validation_action::k_error: + case mongocxx::v_noabi::validation_criteria::validation_action::k_error: return "error"; } @@ -50,8 +52,9 @@ std::string validation_action_to_string(mongocxx::validation_criteria::validatio } // namespace namespace mongocxx { -inline namespace v_noabi { -validation_criteria& validation_criteria::rule(bsoncxx::document::view_or_value rule) { +namespace v_noabi { + +validation_criteria& validation_criteria::rule(bsoncxx::v_noabi::document::view_or_value rule) { _rule = std::move(rule); return *this; } @@ -66,7 +69,7 @@ validation_criteria& validation_criteria::action(validation_criteria::validation return *this; } -const stdx::optional& validation_criteria::rule() const { +const stdx::optional& validation_criteria::rule() const { return _rule; } @@ -78,11 +81,11 @@ const stdx::optional& validation_criteri return _action; } -bsoncxx::document::value validation_criteria::to_document_deprecated() const { - bsoncxx::builder::basic::document doc; +bsoncxx::v_noabi::document::value validation_criteria::to_document_deprecated() const { + bsoncxx::v_noabi::builder::basic::document doc; if (_rule) { - doc.append(kvp("validator", bsoncxx::types::b_document{*_rule})); + doc.append(kvp("validator", bsoncxx::v_noabi::types::b_document{*_rule})); } if (_level) { @@ -96,7 +99,7 @@ bsoncxx::document::value validation_criteria::to_document_deprecated() const { return doc.extract(); } -bsoncxx::document::value validation_criteria::to_document() const { +bsoncxx::v_noabi::document::value validation_criteria::to_document() const { return to_document_deprecated(); } 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 572522b631..5cdbcba68b 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp @@ -25,7 +25,8 @@ #include namespace mongocxx { -inline namespace v_noabi { +namespace v_noabi { + write_concern::write_concern() : _impl{stdx::make_unique(libmongoc::write_concern_new())} {} write_concern::write_concern(std::unique_ptr&& implementation) { @@ -52,7 +53,7 @@ void write_concern::journal(bool journal) { void write_concern::nodes(std::int32_t confirm_from) { if (confirm_from < 0) { - throw mongocxx::logic_error{error_code::k_invalid_parameter}; + throw mongocxx::v_noabi::logic_error{error_code::k_invalid_parameter}; } libmongoc::write_concern_set_w(_impl->write_concern_t, confirm_from); } @@ -86,7 +87,7 @@ void write_concern::acknowledge_level(write_concern::level confirm_level) { void write_concern::tag(stdx::string_view confirm_from) { libmongoc::write_concern_set_wtag(_impl->write_concern_t, - bsoncxx::string::to_string(confirm_from).data()); + bsoncxx::v_noabi::string::to_string(confirm_from).data()); } void write_concern::majority(std::chrono::milliseconds timeout) { @@ -150,11 +151,11 @@ bool write_concern::is_acknowledged() const { return libmongoc::write_concern_is_acknowledged(_impl->write_concern_t); } -bsoncxx::document::value write_concern::to_document() const { - using bsoncxx::builder::basic::kvp; - using bsoncxx::builder::basic::make_document; +bsoncxx::v_noabi::document::value write_concern::to_document() const { + using bsoncxx::v_noabi::builder::basic::kvp; + using bsoncxx::v_noabi::builder::basic::make_document; - bsoncxx::builder::basic::document doc; + bsoncxx::v_noabi::builder::basic::document doc; if (auto ns = nodes()) { doc.append(kvp("w", *ns)); @@ -185,7 +186,7 @@ bsoncxx::document::value write_concern::to_document() const { std::int32_t count; if ((count = static_cast(timeout().count())) > 0) { - doc.append(kvp("wtimeout", bsoncxx::types::b_int32{count})); + doc.append(kvp("wtimeout", bsoncxx::v_noabi::types::b_int32{count})); } return doc.extract(); diff --git a/src/mongocxx/test/client_helpers.cpp b/src/mongocxx/test/client_helpers.cpp index 39f00bfcd7..2bda85348a 100644 --- a/src/mongocxx/test/client_helpers.cpp +++ b/src/mongocxx/test/client_helpers.cpp @@ -41,7 +41,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace test_util { namespace { @@ -552,5 +551,4 @@ std::string getenv_or_fail(const std::string env_name) { } } // namespace test_util -} // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/test/client_helpers.hh b/src/mongocxx/test/client_helpers.hh index a74b93a3c8..9481087ba1 100644 --- a/src/mongocxx/test/client_helpers.hh +++ b/src/mongocxx/test/client_helpers.hh @@ -36,8 +36,8 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace test_util { + // // Compares to version number strings (i.e. positive integers separated by periods). Comparisons are // done to the lesser precision of the two versions. For example, 3.2 is considered equal to 3.2.11, @@ -225,8 +225,6 @@ bool should_run_client_side_encryption_test(void); std::string getenv_or_fail(const std::string env_name); } // namespace test_util - -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/test/spec/monitoring.cpp b/src/mongocxx/test/spec/monitoring.cpp index 2d0246bb13..c798cccb1c 100644 --- a/src/mongocxx/test/spec/monitoring.cpp +++ b/src/mongocxx/test/spec/monitoring.cpp @@ -27,7 +27,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace spec { using namespace mongocxx; @@ -350,6 +349,6 @@ void apm_checker::clear() { } } // namespace spec -} // namespace v_noabi } // namespace mongocxx + #include diff --git a/src/mongocxx/test/spec/monitoring.hh b/src/mongocxx/test/spec/monitoring.hh index 2894b99214..13a5deb824 100644 --- a/src/mongocxx/test/spec/monitoring.hh +++ b/src/mongocxx/test/spec/monitoring.hh @@ -21,7 +21,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace spec { using namespace mongocxx; @@ -87,6 +86,6 @@ class apm_checker { }; } // namespace spec -} // namespace v_noabi } // namespace mongocxx + #include diff --git a/src/mongocxx/test/spec/operation.cpp b/src/mongocxx/test/spec/operation.cpp index fd9f7cb970..bfd88c07fc 100644 --- a/src/mongocxx/test/spec/operation.cpp +++ b/src/mongocxx/test/spec/operation.cpp @@ -45,7 +45,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace spec { using namespace mongocxx; @@ -1504,7 +1503,6 @@ document::value operation_runner::run(document::view operation) { } } // namespace spec -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/test/spec/operation.hh b/src/mongocxx/test/spec/operation.hh index 0e1d030a77..e0eabf705f 100644 --- a/src/mongocxx/test/spec/operation.hh +++ b/src/mongocxx/test/spec/operation.hh @@ -26,7 +26,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace spec { using namespace bsoncxx; @@ -85,6 +84,6 @@ class operation_runner { }; } // namespace spec -} // namespace v_noabi } // namespace mongocxx + #include diff --git a/src/mongocxx/test/spec/unified_tests/assert.hh b/src/mongocxx/test/spec/unified_tests/assert.hh index d8628c9763..1a19e3de6f 100644 --- a/src/mongocxx/test/spec/unified_tests/assert.hh +++ b/src/mongocxx/test/spec/unified_tests/assert.hh @@ -20,7 +20,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace assert { void matches(bsoncxx::types::bson_value::view actual, @@ -30,7 +29,6 @@ void matches(bsoncxx::types::bson_value::view actual, bool is_array_of_root_docs = false); } // namespace assert -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/test/spec/unified_tests/entity.cpp b/src/mongocxx/test/spec/unified_tests/entity.cpp index f1f07ea7dd..f411d5e642 100644 --- a/src/mongocxx/test/spec/unified_tests/entity.cpp +++ b/src/mongocxx/test/spec/unified_tests/entity.cpp @@ -21,7 +21,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace entity { template @@ -153,5 +152,4 @@ void map::erase(const key_type& key) { } } // namespace entity -} // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/test/spec/unified_tests/entity.hh b/src/mongocxx/test/spec/unified_tests/entity.hh index 69a211363d..7c242ac690 100644 --- a/src/mongocxx/test/spec/unified_tests/entity.hh +++ b/src/mongocxx/test/spec/unified_tests/entity.hh @@ -24,7 +24,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace entity { class map { @@ -85,8 +84,8 @@ class map { std::unordered_map _cursor_map; std::unordered_map _client_encryption_map; }; + } // namespace entity -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/test/spec/unified_tests/operations.cpp b/src/mongocxx/test/spec/unified_tests/operations.cpp index e81107597a..7e6d0e0869 100644 --- a/src/mongocxx/test/spec/unified_tests/operations.cpp +++ b/src/mongocxx/test/spec/unified_tests/operations.cpp @@ -29,7 +29,7 @@ #include namespace mongocxx { -inline namespace v_noabi { + using namespace bsoncxx; using builder::basic::kvp; @@ -2292,5 +2292,4 @@ document::value operations::run(entity::map& entity_map, throw std::logic_error{"unsupported operation: " + name}; } -} // namespace v_noabi } // namespace mongocxx diff --git a/src/mongocxx/test/spec/unified_tests/operations.hh b/src/mongocxx/test/spec/unified_tests/operations.hh index b3a18c2122..ba2cdb4261 100644 --- a/src/mongocxx/test/spec/unified_tests/operations.hh +++ b/src/mongocxx/test/spec/unified_tests/operations.hh @@ -25,7 +25,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace operations { struct state { @@ -38,17 +37,11 @@ bsoncxx::document::value run(entity::map& map, const bsoncxx::array::element& op, state& state); -} // namespace operations - -namespace operations { - bsoncxx::stdx::optional lookup_read_concern(bsoncxx::document::view doc); bsoncxx::stdx::optional lookup_write_concern(bsoncxx::document::view doc); bsoncxx::stdx::optional lookup_read_preference(bsoncxx::document::view doc); } // namespace operations - -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/test/spec/util.cpp b/src/mongocxx/test/spec/util.cpp index 2e2af9b160..1b3a7eeb1d 100644 --- a/src/mongocxx/test/spec/util.cpp +++ b/src/mongocxx/test/spec/util.cpp @@ -45,7 +45,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace spec { using namespace bsoncxx; @@ -1137,7 +1136,6 @@ void run_crud_tests_in_file(const std::string& test_path, uri test_uri) { } } // namespace spec -} // namespace v_noabi } // namespace mongocxx #include diff --git a/src/mongocxx/test/spec/util.hh b/src/mongocxx/test/spec/util.hh index b71d668c35..c54e7a738f 100644 --- a/src/mongocxx/test/spec/util.hh +++ b/src/mongocxx/test/spec/util.hh @@ -25,7 +25,6 @@ #include namespace mongocxx { -inline namespace v_noabi { namespace spec { using namespace bsoncxx; @@ -117,6 +116,6 @@ void run_transactions_tests_in_file(const std::string& test_path); void run_crud_tests_in_file(const std::string& test_path, uri test_uri = uri{}); } // namespace spec -} // namespace v_noabi } // namespace mongocxx + #include diff --git a/src/third_party/catch/include/helpers.hpp b/src/third_party/catch/include/helpers.hpp index 0e0ba128e3..d626b051ca 100644 --- a/src/third_party/catch/include/helpers.hpp +++ b/src/third_party/catch/include/helpers.hpp @@ -21,9 +21,8 @@ #include namespace mongocxx { -inline namespace v_noabi { - namespace test_util { + // Check that an error message includes a substring, case-insensitively. Use like: // REQUIRE_THROWS_MATCHES(function(), mongocxx::exception, mongocxx_exception_matcher("substring") class mongocxx_exception_matcher : public Catch::MatcherBase { @@ -40,9 +39,8 @@ class mongocxx_exception_matcher : public Catch::MatcherBase