Skip to content

Commit dc971ed

Browse files
authored
CXX-3070 Address -Wdocumentation Clang warnings (#1175)
1 parent 770d5b6 commit dc971ed

File tree

9 files changed

+36
-33
lines changed

9 files changed

+36
-33
lines changed

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ BSONCXX_API std::string BSONCXX_CALL to_json(array::view view,
5757
///
5858
/// Constructs a new document::value from the provided JSON text.
5959
///
60-
/// @param 'json'
61-
/// A string_view into a JSON document.
60+
/// @param json A string_view into a JSON document.
6261
///
6362
/// @returns A document::value if conversion worked.
6463
///
@@ -70,11 +69,9 @@ BSONCXX_API document::value BSONCXX_CALL from_json(stdx::string_view json);
7069
/// Constructs a new document::value from the provided JSON text. This is the UDL version of
7170
/// from_json().
7271
///
73-
/// @param 'json'
74-
/// A string into a JSON document.
72+
/// @param json A string into a JSON document.
7573
///
76-
/// @param 'len'
77-
/// The length of the JSON string. This is calculated automatically upon use of the UDL.
74+
/// @param len The length of the JSON string. This is calculated automatically upon use of the UDL.
7875
///
7976
/// @returns A document::value if conversion worked.
8077
///

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,7 @@ constexpr copymove_classification classify_assignment() {
475475
return CanCopy ? copyable : CanMove ? movable : immobile;
476476
}
477477

478-
/**
479-
* @brief Common base class for optional storage implementation
480-
*
481-
* @tparam T
482-
*/
478+
/// Common base class for optional storage implementation
483479
template <typename T>
484480
class optional_common_base;
485481

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static constexpr struct invoke_fn {
435435
/**
436436
* @brief Yields the type that would result from invoking F with the given arguments.
437437
*
438-
* @tparam Fun A invocable: A function pointer or callable object, or a member pointer
438+
* @tparam F An invocable function pointer, object, or pointer-to-member.
439439
* @tparam Args The arguments to apply
440440
*/
441441
template <typename F, typename... Args>
@@ -444,14 +444,14 @@ using invoke_result_t = decltype(invoke(std::declval<F>(), std::declval<Args>().
444444
/**
445445
* @brief Trait type to detect if the given object can be "invoked" using the given arguments.
446446
*
447-
* @tparam Fun A invocable: A function pointer or callable object, or a member pointer
447+
* @tparam F An invocable function pointer, object, or pointer-to-member.
448448
* @tparam Args The arguments to match against
449449
*/
450-
template <typename Fun, typename... Args>
450+
template <typename F, typename... Args>
451451
#if defined(_MSC_VER) && _MSC_VER < 1910
452-
using is_invocable = is_detected<invoke_result_t, Fun, Args...>;
452+
using is_invocable = is_detected<invoke_result_t, F, Args...>;
453453
#else
454-
struct is_invocable : is_detected<invoke_result_t, Fun, Args...> {
454+
struct is_invocable : is_detected<invoke_result_t, F, Args...> {
455455
};
456456
#endif
457457

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ BSONCXX_INLINE bool operator==(const b_binary& lhs, const b_binary& rhs) {
240240
///
241241
/// A BSON undefined value.
242242
///
243-
/// @deprecated
244-
/// This BSON type is deprecated and use by clients is discouraged.
243+
/// @deprecated This BSON type is deprecated. Usage is discouraged.
245244
///
246245
struct b_undefined {
247246
static constexpr auto type_id = type::k_undefined;
@@ -409,10 +408,9 @@ BSONCXX_INLINE bool operator==(const b_regex& lhs, const b_regex& rhs) {
409408
}
410409

411410
///
412-
/// A BSON DBPointer value.
411+
/// A BSON DBPointer (aka DBRef) value.
413412
///
414-
/// @deprecated
415-
/// A BSON DBPointer (aka DBRef) is still supported but deprecated.
413+
/// @deprecated This BSON type is deprecated. Usage is discouraged.
416414
///
417415
struct b_dbpointer {
418416
static constexpr auto type_id = type::k_dbpointer;
@@ -467,8 +465,7 @@ BSONCXX_INLINE bool operator==(const b_code& lhs, const b_code& rhs) {
467465
///
468466
/// A BSON Symbol value.
469467
///
470-
/// @deprecated
471-
/// This BSON type is deprecated and use by clients is discouraged.
468+
/// @deprecated This BSON type is deprecated. Usage is discouraged.
472469
///
473470
struct b_symbol {
474471
static constexpr auto type_id = type::k_symbol;

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ class value {
153153
/// @param value
154154
/// the object id
155155
///
156-
/// @deprecated
157-
/// A BSON DBPointer (aka DBRef) is still supported but deprecated.
156+
/// @warning The DBPointer (aka DBRef) BSON type is deprecated. Usage is discouraged.
158157
///
159158
value(stdx::string_view collection, oid value);
160159

@@ -192,10 +191,8 @@ class value {
192191
///
193192
/// @throws bsoncxx::v_noabi::exception if the type's value is not k_code, k_regex, or k_symbol.
194193
///
195-
/// @deprecated
196-
/// The BSON symbol type is deprecated and use by clients is discouraged.
197-
/// @deprecated
198-
/// The BSON undefined type is deprecated and use by clients is discouraged.
194+
/// @warning The Symbol BSON type is deprecated. Usage is discouraged.
195+
/// @warning The Undefined BSON type is deprecated. Usage is discouraged.
199196
///
200197
value(const type id, stdx::string_view v);
201198

src/mongocxx/include/mongocxx/v_noabi/mongocxx/client_session.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ class client_session {
168168
///
169169
void abort_transaction();
170170

171+
///
172+
/// Represents a callback invoked within a transaction.
173+
///
174+
using with_transaction_cb = std::function<void MONGOCXX_CALL(client_session*)>;
175+
171176
///
172177
/// Helper to run a user-provided callback within a transaction.
173178
///
@@ -189,7 +194,6 @@ class client_session {
189194
/// @throws mongocxx::v_noabi::operation_exception if there are errors completing the
190195
/// transaction.
191196
///
192-
using with_transaction_cb = std::function<void MONGOCXX_CALL(client_session*)>;
193197
void with_transaction(with_transaction_cb cb, options::transaction opts = {});
194198

195199
private:

src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/auto_encryption.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class auto_encryption {
9696
///
9797
const stdx::optional<mongocxx::v_noabi::pool*>& key_vault_pool() const;
9898

99+
///
100+
/// Represents the name of a database and a collection.
101+
///
102+
using ns_pair = std::pair<std::string, std::string>;
103+
99104
///
100105
/// Sets the namespace to use to access the key vault collection, which
101106
/// contains all data keys used for encryption and decryption. This
@@ -112,7 +117,6 @@ class auto_encryption {
112117
///
113118
/// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/
114119
///
115-
using ns_pair = std::pair<std::string, std::string>;
116120
auto_encryption& key_vault_namespace(ns_pair ns);
117121

118122
///

src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/client_encryption.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class client_encryption {
5858
///
5959
const stdx::optional<mongocxx::v_noabi::client*>& key_vault_client() const;
6060

61+
///
62+
/// Represents the name of a database and a collection.
63+
///
64+
using ns_pair = std::pair<std::string, std::string>;
65+
6166
///
6267
/// Sets the namespace to use to access the key vault collection, which
6368
/// contains all data keys used for encryption and decryption. This
@@ -74,7 +79,6 @@ class client_encryption {
7479
///
7580
/// @see https://www.mongodb.com/docs/manual/core/security-client-side-encryption/
7681
///
77-
using ns_pair = std::pair<std::string, std::string>;
7882
client_encryption& key_vault_namespace(ns_pair ns);
7983

8084
///

src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/data_key.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ class data_key {
122122
///
123123
const std::vector<std::string>& key_alt_names() const;
124124

125+
///
126+
/// Represents binary data used to represent key material.
127+
///
128+
using key_material_type = std::vector<uint8_t>;
129+
125130
///
126131
/// Sets the binary data for the key material
127132
///
@@ -140,7 +145,6 @@ class data_key {
140145
///
141146
/// @see https://www.mongodb.com/docs/v6.0/reference/method/KeyVault.createKey/
142147
///
143-
using key_material_type = std::vector<uint8_t>;
144148
data_key& key_material(key_material_type key_material);
145149

146150
///

0 commit comments

Comments
 (0)