Skip to content

Commit 49d7023

Browse files
authored
Merge pull request simdjson#969 from simdjson/dlemire/minor_pre0.4_cleaning
Very minor cleaning.
2 parents 2570898 + f1a03bf commit 49d7023

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

include/simdjson/dom/object.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ class object {
190190
*/
191191
class key_value_pair {
192192
public:
193+
/** key in the key-value pair **/
193194
std::string_view key;
195+
/** value in the key-value pair **/
194196
element value;
195197

196198
private:

include/simdjson/dom/parsedjson_iterator.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
namespace simdjson {
1818

19+
/** @private **/
1920
class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")]] dom::parser::Iterator {
2021
public:
2122
inline Iterator(const dom::parser &parser) noexcept(false);
@@ -104,11 +105,11 @@ class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")
104105

105106
inline bool is_string() const { return get_type() == '"'; }
106107

107-
// Returns true if the current type of node is an signed integer.
108+
// Returns true if the current type of the node is an signed integer.
108109
// You can get its value with `get_integer()`.
109110
inline bool is_integer() const { return get_type() == 'l'; }
110111

111-
// Returns true if the current type of node is an unsigned integer.
112+
// Returns true if the current type of the node is an unsigned integer.
112113
// You can get its value with `get_unsigned_integer()`.
113114
//
114115
// NOTE:
@@ -117,19 +118,19 @@ class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")
117118
// positive integer, such as 1, 42, or 1000000, is as a signed node.
118119
// Be aware this function returns false for a signed node.
119120
inline bool is_unsigned_integer() const { return get_type() == 'u'; }
120-
121+
// Returns true if the current type of the node is a double floating-point number.
121122
inline bool is_double() const { return get_type() == 'd'; }
122-
123+
// Returns true if the current type of the node is a number (integer or floating-point).
123124
inline bool is_number() const {
124125
return is_integer() || is_unsigned_integer() || is_double();
125126
}
126-
127+
// Returns true if the current type of the node is a bool with true value.
127128
inline bool is_true() const { return get_type() == 't'; }
128-
129+
// Returns true if the current type of the node is a bool with false value.
129130
inline bool is_false() const { return get_type() == 'f'; }
130-
131+
// Returns true if the current type of the node is null.
131132
inline bool is_null() const { return get_type() == 'n'; }
132-
133+
// Returns true if the type byte represents an object of an array
133134
static bool is_object_or_array(uint8_t type) {
134135
return ((type == '[') || (type == '{'));
135136
}
@@ -243,15 +244,10 @@ class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")
243244
;
244245
}
245246

246-
// void to_end_scope(); // move us to
247-
// the start of our current scope; always succeeds
247+
248248

249249
// print the node we are currently pointing at
250250
inline bool print(std::ostream &os, bool escape_strings = true) const;
251-
typedef struct {
252-
size_t start_of_scope;
253-
uint8_t scope_type;
254-
} scopeindex_t;
255251

256252
private:
257253
const document &doc;
@@ -261,6 +257,11 @@ class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")
261257
size_t tape_length{};
262258
uint8_t current_type{};
263259
uint64_t current_val{};
260+
typedef struct {
261+
size_t start_of_scope;
262+
uint8_t scope_type;
263+
} scopeindex_t;
264+
264265
scopeindex_t *depth_index{};
265266
};
266267

include/simdjson/dom/parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class parser {
192192
* If the parser's current capacity is less than batch_size, it will allocate enough capacity
193193
* to handle it (up to max_capacity).
194194
*
195-
* @param s The concatenated JSON to parse. Must have at least len + SIMDJSON_PADDING allocated bytes.
195+
* @param path File name pointing at the concatenated JSON to parse.
196196
* @param batch_size The batch size to use. MUST be larger than the largest document. The sweet
197197
* spot is cache-related: small enough to fit in cache, yet big enough to
198198
* parse as many documents as possible in one tight loop.

include/simdjson/padded_string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct padded_string final {
4545
/**
4646
* Create a new padded string by copying the given input.
4747
*
48-
* @param str_ the string to copy
48+
* @param sv_ the string to copy
4949
*/
5050
inline padded_string(std::string_view sv_) noexcept;
5151
/**

0 commit comments

Comments
 (0)