* Validate if the bson inside pgbson_writer is an empty document. * Note that the bson spec (https://bsonspec.org/spec.html) implies that an array has * 4 bytes for the array length, followed by a list of [ 1 byte type code, path, value] * This implies that a non empty array has 4 bytes of length, 1 byte of type code * (for the first element), and at least 1 byte for the index path which is 6
| 1921 | * (for the first element), and at least 1 byte for the index path which is 6 bytes at least. |
| 1922 | */ |
| 1923 | bool |
| 1924 | IsPgbsonWriterEmptyDocument(pgbson_writer *writer) |
| 1925 | { |
| 1926 | return writer != NULL && PgbsonWriterGetSize(writer) < 6; |
| 1927 | } |
| 1928 | |
| 1929 | |
| 1930 | /* |
no test coverage detected