Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/mongocxx/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# limitations under the License.

set(mongocxx_sources_private
mongocxx/private/bson.cpp
mongocxx/private/conversions.cpp
mongocxx/private/mongoc.cpp
mongocxx/private/numeric_casting.cpp
mongocxx/private/scoped_bson.cpp
)

set(mongocxx_sources_v_noabi
Expand Down Expand Up @@ -255,7 +255,6 @@ set_dist_list(src_mongocxx_lib_DIST
${mongocxx_sources_v_noabi}
${mongocxx_sources_v1}
mongocxx/private/append_aggregate_options.hh
mongocxx/private/bson.hh
mongocxx/private/bulk_write.hh
mongocxx/private/change_stream.hh
mongocxx/private/client_encryption.hh
Expand All @@ -277,6 +276,7 @@ set_dist_list(src_mongocxx_lib_DIST
mongocxx/private/read_concern.hh
mongocxx/private/read_preference.hh
mongocxx/private/scoped_bson_value.hh
mongocxx/private/scoped_bson.hh
mongocxx/private/search_index_model.hh
mongocxx/private/search_index_view.hh
mongocxx/private/ssl.hh
Expand All @@ -289,6 +289,7 @@ set_dist_list(src_mongocxx_lib_DIST
mongocxx/v_noabi/mongocxx/options/server_api.hh
mongocxx/v_noabi/mongocxx/options/tls.hh
mongocxx/v_noabi/mongocxx/options/transaction.hh
mongocxx/v_noabi/mongocxx/scoped_bson.hh
mongocxx/v1/config/config.hpp.in
mongocxx/v1/config/version.hpp.in
)
129 changes: 0 additions & 129 deletions src/mongocxx/lib/mongocxx/private/bson.cpp

This file was deleted.

162 changes: 0 additions & 162 deletions src/mongocxx/lib/mongocxx/private/bson.hh

This file was deleted.

15 changes: 7 additions & 8 deletions src/mongocxx/lib/mongocxx/private/change_stream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#include <mongocxx/change_stream.hpp>
#include <mongocxx/exception/query_exception.hpp>

#include <mongocxx/private/bson.hh>
#include <mongocxx/scoped_bson.hh>

#include <mongocxx/private/mongoc.hh>
#include <mongocxx/private/mongoc_error.hh>

Expand Down Expand Up @@ -77,22 +78,20 @@ class change_stream::impl {
}

void advance_iterator() {
bson_t const* out;
scoped_bson_view doc;

// Happy-case.
if (libmongoc::change_stream_next(this->change_stream_, &out)) {
this->doc_ = bsoncxx::v_noabi::document::view{bson_get_data(out), out->len};
if (libmongoc::change_stream_next(this->change_stream_, doc.out_ptr())) {
this->doc_ = doc.view();
return;
}

// Check for errors or just nothing left.
bson_error_t error;
if (libmongoc::change_stream_error_document(this->change_stream_, &error, &out)) {
if (libmongoc::change_stream_error_document(this->change_stream_, &error, doc.out_ptr())) {
this->mark_dead();
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<query_exception>(scoped_error_reply.steal(), error);
throw_exception<query_exception>(bsoncxx::v_noabi::from_v1(doc.value()), error);
}

// Just nothing left.
Expand Down
Loading