.\" Man page generated from reStructuredText. . .TH "BSON_UINT32_TO_STRING" "3" "Jun 04, 2021" "1.17.6" "libbson" .SH NAME bson_uint32_to_string \- bson_uint32_to_string() . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C size_t bson_uint32_to_string (uint32_t value, const char **strptr, char *str, size_t size); .ft P .fi .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBvalue\fP: A uint32_t. .IP \(bu 2 \fBstrptr\fP: A location for the resulting string pointer. .IP \(bu 2 \fBstr\fP: A location to buffer the string. .IP \(bu 2 \fBsize\fP: A size_t containing the size of \fBstr\fP\&. .UNINDENT .SH DESCRIPTION .sp Converts \fBvalue\fP to a string. .sp If \fBvalue\fP is from 0 to 999, it will use a constant string in the data section of the library. .sp If not, a string will be formatted using \fBstr\fP and \fBsnprintf()\fP\&. .sp \fBstrptr\fP will always be set. It will either point to \fBstr\fP or a constant string. Use this as your key. .SH ARRAY ELEMENT KEY BUILDING .sp Each element in a BSON array has a monotonic string key like \fB"0"\fP, \fB"1"\fP, etc. This function is optimized for generating such string keys. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C char str[16]; const char *key; uint32_t i; for (i = 0; i < 10; i++) { bson_uint32_to_string (i, &key, str, sizeof str); printf ("Key: %s\en", key); } .ft P .fi .UNINDENT .UNINDENT .SH RETURNS .sp The number of bytes in the resulting string. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .