1BSON_UINT32_TO_STRING(3)            libbson           BSON_UINT32_TO_STRING(3)
2
3
4

NAME

6       bson_uint32_to_string - bson_uint32_to_string()
7

SYNOPSIS

9          size_t
10          bson_uint32_to_string (uint32_t value,
11                                 const char **strptr,
12                                 char *str,
13                                 size_t size);
14

PARAMETERS

16value: A uint32_t.
17
18strptr: A location for the resulting string pointer.
19
20str: A location to buffer the string.
21
22size: A size_t containing the size of str.
23

DESCRIPTION

25       Converts value to a string.
26
27       If  value  is  from 0 to 999, it will use a constant string in the data
28       section of the library.
29
30       If not, a string will be formatted using str and snprintf().
31
32       strptr will always be set. It will either point to str  or  a  constant
33       string. Use this as your key.
34

ARRAY ELEMENT KEY BUILDING

36       Each  element in a BSON array has a monotonic string key like "0", "1",
37       etc. This function is optimized for generating such string keys.
38
39          char str[16];
40          const char *key;
41          uint32_t i;
42
43          for (i = 0; i < 10; i++) {
44             bson_uint32_to_string (i, &key, str, sizeof str);
45             printf ("Key: %s\n", key);
46          }
47

RETURNS

49       The number of bytes in the resulting string.
50

AUTHOR

52       MongoDB, Inc
53
55       2017-present, MongoDB, Inc
56
57
58
59
601.17.6                           Jun 03, 2021         BSON_UINT32_TO_STRING(3)
Impressum