.TH "include/Zycore/Format.h" 3 "Version 1.5.0.0" "Zycore" \" -*- nroff -*- .ad l .nh .SH NAME include/Zycore/Format.h .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Functions" .in +1c .ti -1c .RI "ZYAN_INLINE ZyanU64 \fBZyanAbsI64\fP (ZyanI64 x)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringInsertFormat\fP (\fBZyanString\fP *string, ZyanUSize index, const char *format,\&.\&.\&.)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringInsertDecU\fP (\fBZyanString\fP *string, ZyanUSize index, ZyanU64 value, ZyanU8 padding_length)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringInsertDecS\fP (\fBZyanString\fP *string, ZyanUSize index, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP force_sign, const \fBZyanString\fP *prefix)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringInsertHexU\fP (\fBZyanString\fP *string, ZyanUSize index, ZyanU64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringInsertHexS\fP (\fBZyanString\fP *string, ZyanUSize index, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase, \fBZyanBool\fP force_sign, const \fBZyanString\fP *prefix)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZYAN_REQUIRES_LIBC\fP \fBZyanStatus\fP \fBZyanStringAppendFormat\fP (\fBZyanString\fP *string, const char *format,\&.\&.\&.)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringAppendDecU\fP (\fBZyanString\fP *string, ZyanU64 value, ZyanU8 padding_length)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringAppendDecS\fP (\fBZyanString\fP *string, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP force_sign, const \fBZyanStringView\fP *prefix)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringAppendHexU\fP (\fBZyanString\fP *string, ZyanU64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanStringAppendHexS\fP (\fBZyanString\fP *string, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase, \fBZyanBool\fP force_sign, const \fBZyanStringView\fP *prefix)" .br .in -1c .SH "Detailed Description" .PP Provides helper functions for performant number to string conversion\&. .SH "Function Documentation" .PP .SS "ZYAN_INLINE ZyanU64 ZyanAbsI64 (ZyanI64 x)" Get the absolute value of a 64 bit int\&. .PP \fBParameters\fP .RS 4 \fIx\fP The value to process\&. .RE .PP \fBReturns\fP .RS 4 The absolute, unsigned value\&. .RE .PP This gracefully deals with the special case of \fCx\fP being \fCINT_MAX\fP\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringAppendDecS (\fBZyanString\fP * string, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP force_sign, const \fBZyanStringView\fP * prefix)" Formats the given signed ordinal \fCvalue\fP to its decimal text-representation and appends it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .br \fIforce_sign\fP Set \fCZYAN_TRUE\fP, to force printing of the \fC+\fP sign for positive numbers\&. .br \fIprefix\fP The string to use as prefix or \fCZYAN_NULL\fP, if not needed\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringAppendDecU (\fBZyanString\fP * string, ZyanU64 value, ZyanU8 padding_length)" Formats the given unsigned ordinal \fCvalue\fP to its decimal text-representation and appends it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZYAN_REQUIRES_LIBC\fP \fBZyanStatus\fP ZyanStringAppendFormat (\fBZyanString\fP * string, const char * format, \&.\&.\&.)" Appends formatted text to the destination string\&. .PP \fBParameters\fP .RS 4 \fIstring\fP The destination string\&. .br \fIformat\fP The format string\&. .br \fI\&.\&.\&.\fP The format arguments\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringAppendHexS (\fBZyanString\fP * string, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase, \fBZyanBool\fP force_sign, const \fBZyanStringView\fP * prefix)" Formats the given signed ordinal \fCvalue\fP to its hexadecimal text-representation and appends it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .br \fIuppercase\fP Set \fCZYAN_TRUE\fP to use uppercase letters ('A'-'F') instead of lowercase ones ('a'-'f')\&. .br \fIforce_sign\fP Set \fCZYAN_TRUE\fP, to force printing of the \fC+\fP sign for positive numbers\&. .br \fIprefix\fP The string to use as prefix or \fCZYAN_NULL\fP, if not needed\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringAppendHexU (\fBZyanString\fP * string, ZyanU64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase)" Formats the given unsigned ordinal \fCvalue\fP to its hexadecimal text-representation and appends it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .br \fIuppercase\fP Set \fCZYAN_TRUE\fP to use uppercase letters ('A'-'F') instead of lowercase ones ('a'-'f')\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringInsertDecS (\fBZyanString\fP * string, ZyanUSize index, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP force_sign, const \fBZyanString\fP * prefix)" Formats the given signed ordinal \fCvalue\fP to its decimal text-representation and inserts it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIindex\fP The insert index\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .br \fIforce_sign\fP Set \fCZYAN_TRUE\fP, to force printing of the \fC+\fP sign for positive numbers\&. .br \fIprefix\fP The string to use as prefix or \fCZYAN_NULL\fP, if not needed\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringInsertDecU (\fBZyanString\fP * string, ZyanUSize index, ZyanU64 value, ZyanU8 padding_length)" Formats the given unsigned ordinal \fCvalue\fP to its decimal text-representation and inserts it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIindex\fP The insert index\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringInsertFormat (\fBZyanString\fP * string, ZyanUSize index, const char * format, \&.\&.\&.)" Inserts formatted text in the destination string at the given \fCindex\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP The destination string\&. .br \fIindex\fP The insert index\&. .br \fIformat\fP The format string\&. .br \fI\&.\&.\&.\fP The format arguments\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringInsertHexS (\fBZyanString\fP * string, ZyanUSize index, ZyanI64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase, \fBZyanBool\fP force_sign, const \fBZyanString\fP * prefix)" Formats the given signed ordinal \fCvalue\fP to its hexadecimal text-representation and inserts it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIindex\fP The insert index\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .br \fIuppercase\fP Set \fCZYAN_TRUE\fP to use uppercase letters ('A'-'F') instead of lowercase ones ('a'-'f')\&. .br \fIforce_sign\fP Set \fCZYAN_TRUE\fP, to force printing of the \fC+\fP sign for positive numbers\&. .br \fIprefix\fP The string to use as prefix or \fCZYAN_NULL\fP, if not needed\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanStringInsertHexU (\fBZyanString\fP * string, ZyanUSize index, ZyanU64 value, ZyanU8 padding_length, \fBZyanBool\fP uppercase)" Formats the given unsigned ordinal \fCvalue\fP to its hexadecimal text-representation and inserts it to the \fCstring\fP\&. .PP \fBParameters\fP .RS 4 \fIstring\fP A pointer to the \fCZyanString\fP instance\&. .br \fIindex\fP The insert index\&. .br \fIvalue\fP The value\&. .br \fIpadding_length\fP Padds the converted value with leading zeros, if the number of chars is less than the \fCpadding_length\fP\&. .br \fIuppercase\fP Set \fCZYAN_TRUE\fP to use uppercase letters ('A'-'F') instead of lowercase ones ('a'-'f')\&. .RE .PP \fBReturns\fP .RS 4 A zyan status code\&. .RE .PP This function will fail, if the \fCZYAN_STRING_IS_IMMUTABLE\fP flag is set for the specified \fCZyanString\fP instance\&. .SH "Author" .PP Generated automatically by Doxygen for Zycore from the source code\&.