diff options
Diffstat (limited to 'src/mongo/db/storage/key_string.h')
-rw-r--r-- | src/mongo/db/storage/key_string.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/storage/key_string.h b/src/mongo/db/storage/key_string.h index 4707c6671d1..9865c901958 100644 --- a/src/mongo/db/storage/key_string.h +++ b/src/mongo/db/storage/key_string.h @@ -450,6 +450,9 @@ public: */ void appendBSONElement(const BSONElement& elem, const StringTransformFn& f = nullptr); + void appendString(StringData val); + void appendNumberDouble(double num); + /** * Resets to an empty state. * Equivalent to but faster than *this = Builder(ord, discriminator) @@ -573,6 +576,14 @@ private: } } + void _verifyAppendingState() { + invariant(_state == BuildState::kEmpty || _state == BuildState::kAppendingBSONElements); + + if (_state == BuildState::kEmpty) { + _transition(BuildState::kAppendingBSONElements); + } + } + void _transition(BuildState to) { // We can empty at any point since it just means that we are clearing the buffer. if (to == BuildState::kEmpty) { @@ -613,6 +624,10 @@ private: _state = to; } + bool _shouldInvertOnAppend() const { + return _ordering.get(_elemCount) == -1; + } + TypeBits _typeBits; BufferT _buffer; |