file
Format.hCnxFormat brings human readable string formatting, similar to C++'s std::format
and fmtlib
, and Rust's std::format, to C.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Classes
- struct CnxFormatContext
CnxFormatContext
is the context type used to store parsed format specifier state for passing to the formatting functionsCnxFormat.format
andCnxFormat.format_with_allocator
.
Enums
- enum CnxFormatErrorTypes { CNX_FORMAT_SUCCESS = 0, CNX_FORMAT_BAD_SPECIFIER_INVALID_CHAR_IN_SPECIFIER, CNX_FORMAT_INVALID_CLOSING_BRACE_LOCATION, CNX_FORMAT_UNCLOSED_SPECIFIER, CNX_FORMAT_MORE_SPECIFIERS_THAN_ARGS, CNX_FORMAT_FEWER_SPECIFIERS_THAN_ARGS }
- Specifies possible errors that could occur when parsing a format specifier.
- enum CnxFormatDefaults { CNX_FORMAT_DEFAULT_NUM_SIG_FIGS = 3 }
- Default values for various formatting parameters for Cnx string formatting.
Typedefs
- using CnxFormatErrorTypes = enum CnxFormatErrorTypes
- Specifies possible errors that could occur when parsing a format specifier.
- using CnxFormatContext = struct CnxFormatContext
CnxFormatContext
is the context type used to store parsed format specifier state for passing to the formatting functionsCnxFormat.format
andCnxFormat.format_with_allocator
.- using CnxFormatDefaults = enum CnxFormatDefaults
- Default values for various formatting parameters for Cnx string formatting.
Functions
-
CnxString cnx_format_with_allocator(restrict const_
cstring format_string, CnxAllocator allocator, usize num_args, ...) cnx_disable_if(!format_string - Formats the various parameter pack arguments into their associated place in the given format string, using the provided allocator.
-
CnxString cnx_vformat_with_allocator(restrict const_
cstring format_string, CnxAllocator allocator, usize num_args, va_list list) cnx_disable_if(!format_string - Formats the various parameter pack arguments into their associated place in the given format string, using the provided allocator.
- CnxFormatContext cnx_format_is_specifier_valid_cstring(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtincstring
- CnxFormatContext cnx_format_is_specifier_valid_bool(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinbool
- CnxFormatContext cnx_format_is_specifier_valid_char(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinchar
- CnxFormatContext cnx_format_is_specifier_valid_u8(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinu8
- CnxFormatContext cnx_format_is_specifier_valid_u16(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinu16
- CnxFormatContext cnx_format_is_specifier_valid_u32(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinu32
- CnxFormatContext cnx_format_is_specifier_valid_u64(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinu64
- CnxFormatContext cnx_format_is_specifier_valid_i8(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtini8
- CnxFormatContext cnx_format_is_specifier_valid_i16(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtini16
- CnxFormatContext cnx_format_is_specifier_valid_i32(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtini32
- CnxFormatContext cnx_format_is_specifier_valid_i64(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtini64
- CnxFormatContext cnx_format_is_specifier_valid_f32(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinf32
- CnxFormatContext cnx_format_is_specifier_valid_f64(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for the builtinf64
- CnxFormatContext cnx_format_is_specifier_valid_ptr(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
for pointers - CnxFormatContext cnx_format_is_specifier_valid_cnx_string(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
forCnxString
- CnxFormatContext cnx_format_is_specifier_valid_cnx_stringview(const CnxFormat*restrict self, CnxStringView specifier)
- implementation of
CnxFormat.is_specifier_valid
forCnxStringView
- CnxString cnx_format_cstring(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtincstring
- CnxString cnx_format_bool(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinbool
- CnxString cnx_format_char(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinchar
- CnxString cnx_format_u8(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinu8
- CnxString cnx_format_u16(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinu16
- CnxString cnx_format_u32(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinu32
- CnxString cnx_format_u64(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinu64
- CnxString cnx_format_i8(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtini8
- CnxString cnx_format_i16(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtini16
- CnxString cnx_format_i32(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtini32
- CnxString cnx_format_i64(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtini64
- CnxString cnx_format_f32(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinf32
- CnxString cnx_format_f64(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for the builtinf64
- CnxString cnx_format_ptr(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
for pointers - CnxString cnx_format_cnx_string(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
forCnxString
- CnxString cnx_format_cnx_stringview(const CnxFormat*restrict self, CnxFormatContext context)
- implementation of
CnxFormat.format
forCnxStringView
- CnxString cnx_format_cstring_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtincstring
- CnxString cnx_format_bool_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinbool
- CnxString cnx_format_char_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinchar
- CnxString cnx_format_u8_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinu8
- CnxString cnx_format_u16_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinu16
- CnxString cnx_format_u32_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinu32
- CnxString cnx_format_u64_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinu64
- CnxString cnx_format_i8_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtini8
- CnxString cnx_format_i16_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtini16
- CnxString cnx_format_i32_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtini32
- CnxString cnx_format_i64_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtini64
- CnxString cnx_format_f32_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinf32
- CnxString cnx_format_f64_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for the builtinf64
- CnxString cnx_format_ptr_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
for pointers - CnxString cnx_format_cnx_string_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
forCnxString
- CnxString cnx_format_cnx_stringview_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
- implementation of
CnxFormat.format_with_allocator
forCnxStringView
-
static ImplTraitFor(CnxFormat,
cstring,
cnx_
format_ is_ specifier_ valid_ cstring, cnx_ format_ cstring, cnx_ format_ cstring_ with_ allocator) - implementation of
CnxFormat
for the builtincstring
-
static ImplTraitFor(CnxFormat,
bool,
cnx_
format_ is_ specifier_ valid_ bool, cnx_ format_ bool, cnx_ format_ bool_ with_ allocator) - implementation of
CnxFormat
for the builtinbool
-
static ImplTraitFor(CnxFormat,
char,
cnx_
format_ is_ specifier_ valid_ char, cnx_ format_ char, cnx_ format_ char_ with_ allocator) - implementation of
CnxFormat
for the builtinchar
-
static ImplTraitFor(CnxFormat,
u8,
cnx_
format_ is_ specifier_ valid_ u8, cnx_ format_ u8, cnx_ format_ u8_ with_ allocator) - implementation of
CnxFormat
for the builtinu8
-
static ImplTraitFor(CnxFormat,
u16,
cnx_
format_ is_ specifier_ valid_ u16, cnx_ format_ u16, cnx_ format_ u16_ with_ allocator) - implementation of
CnxFormat
for the builtinu16
-
static ImplTraitFor(CnxFormat,
u32,
cnx_
format_ is_ specifier_ valid_ u32, cnx_ format_ u32, cnx_ format_ u32_ with_ allocator) - implementation of
CnxFormat
for the builtinu32
-
static ImplTraitFor(CnxFormat,
u64,
cnx_
format_ is_ specifier_ valid_ u64, cnx_ format_ u64, cnx_ format_ u64_ with_ allocator) - implementation of
CnxFormat
for the builtinu64
-
static ImplTraitFor(CnxFormat,
i8,
cnx_
format_ is_ specifier_ valid_ i8, cnx_ format_ i8, cnx_ format_ i8_ with_ allocator) - implementation of
CnxFormat
for the builtini8
-
static ImplTraitFor(CnxFormat,
i16,
cnx_
format_ is_ specifier_ valid_ i16, cnx_ format_ i16, cnx_ format_ i16_ with_ allocator) - implementation of
CnxFormat
for the builtini16
-
static ImplTraitFor(CnxFormat,
i32,
cnx_
format_ is_ specifier_ valid_ i32, cnx_ format_ i32, cnx_ format_ i32_ with_ allocator) - implementation of
CnxFormat
for the builtini32
-
static ImplTraitFor(CnxFormat,
i64,
cnx_
format_ is_ specifier_ valid_ i64, cnx_ format_ i64, cnx_ format_ i64_ with_ allocator) - implementation of
CnxFormat
for the builtini64
-
static ImplTraitFor(CnxFormat,
f32,
cnx_
format_ is_ specifier_ valid_ f32, cnx_ format_ f32, cnx_ format_ f32_ with_ allocator) - implementation of
CnxFormat
for the builtinf32
-
static ImplTraitFor(CnxFormat,
f64,
cnx_
format_ is_ specifier_ valid_ f64, cnx_ format_ f64, cnx_ format_ f64_ with_ allocator) - implementation of
CnxFormat
for the builtinf64
-
static ImplTraitFor(CnxFormat,
nullptr_
t, cnx_ format_ is_ specifier_ valid_ ptr, cnx_ format_ ptr, cnx_ format_ ptr_ with_ allocator) - implementation of
CnxFormat
for pointers -
static ImplTraitFor(CnxFormat,
CnxString,
cnx_
format_ is_ specifier_ valid_ cnx_ string, cnx_ format_ cnx_ string, cnx_ format_ cnx_ string_ with_ allocator) - implementation of
CnxFormat
forCnxString
-
static ImplTraitFor(CnxFormat,
CnxStringView,
cnx_
format_ is_ specifier_ valid_ cnx_ stringview, cnx_ format_ cnx_ stringview, cnx_ format_ cnx_ stringview_ with_ allocator) - implementation of
CnxFormat
forCnxStringView
Defines
- #define CNX_FORMAT
- Declarations and Definitions related to
cnx_
,format(format_ string, ...) CnxFormat
, and Cnx string formatting. - #define as_format_t(T, x)
- Converts the given variable into its associated
CnxFormat
Trait implementation. - #define CNX_AS_FORMAT_USES_USER_SUPPLIED_TYPES
- Feature enable macro to allow specific user-defined types to be automatically converted to their
CnxFormat
implementation when passed tocnx_
or a similar Cnx string formatting function.format(format_ string, ...) - #define CNX_AS_FORMAT_USER_SUPPLIED_TYPES
- Define this macro to a comma separated list of conversions to enable specific user-defined types to be automatically converted to their
CnxFormat
implementation when passed tocnx_
or a similar Cnx string formatting function.format(format_ string, ...) - #define as_format(x)
- Converts the given variable into its associated
CnxFormat
Trait implementation. - #define cnx_format_with_allocator(format_string, allocator, ...)
- Formats the various parameter pack arguments into their associated place in the given format string, using the provided allocator.
- #define cnx_format(format_string, ...)
- Formats the various parameter pack arguments into their associated place in the given format string, using the default allocator.
- #define cnx_vformat_with_allocator(format_string, allocator, num_args, list)
- Formats the various
va_list
parameter pack arguments into their associated place in the given format string, using the provided allocator. - #define cnx_vformat(format_string, num_args, list)
- Formats the various
va_list
parameter pack arguments into their associated place in the given format string, using the default allocator.
Function documentation
CnxString cnx_format_with_allocator(restrict const_ cstring format_string,
CnxAllocator allocator,
usize num_args,
...) cnx_disable_if(!format_string
Formats the various parameter pack arguments into their associated place in the given format string, using the provided allocator.
Parameters | |
---|---|
format_string | - The string specifying the format positions, specifiers, and other text that should be present in the output string |
allocator | - The CnxAllocator to allocate the output string with |
num_args | - The number of arguments in the parameter pack |
Returns | The formatted output string |
CnxString cnx_vformat_with_allocator(restrict const_ cstring format_string,
CnxAllocator allocator,
usize num_args,
va_list list) cnx_disable_if(!format_string
Formats the various parameter pack arguments into their associated place in the given format string, using the provided allocator.
Parameters | |
---|---|
format_string | - The string specifying the format positions, specifiers, and other text that should be present in the output string |
allocator | - The CnxAllocator to allocate the output string with |
num_args | - The number of arguments in the parameter pack |
list | - The parameter pack of arguments to be formatted |
Returns | The formatted output string |
CnxFormatContext cnx_format_is_specifier_valid_cstring(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin cstring
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_bool(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin bool
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_char(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin char
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_u8(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin u8
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_u16(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin u16
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_u32(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin u32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_u64(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin u64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_i8(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin i8
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_i16(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin i16
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_i32(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin i32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_i64(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin i64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_f32(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin f32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_f64(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for the builtin f64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_ptr(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for pointers
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_cnx_string(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for CnxString
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxFormatContext cnx_format_is_specifier_valid_cnx_stringview(const CnxFormat*restrict self, CnxStringView specifier)
implementation of CnxFormat.is_specifier_valid
for CnxStringView
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
specifier | - The format specifier to follow |
Returns | whether specifier is valid |
CnxString cnx_format_cstring(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin cstring
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_bool(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin bool
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_char(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin char
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_u8(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin u8
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_u16(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin u16
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_u32(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin u32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_u64(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin u64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_i8(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin i8
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_i16(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin i16
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_i32(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin i32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_i64(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin i64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_f32(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin f32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_f64(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for the builtin f64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_ptr(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for pointers
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_cnx_string(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for CnxString
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_cnx_stringview(const CnxFormat*restrict self, CnxFormatContext context)
implementation of CnxFormat.format
for CnxStringView
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
Returns | a formatted string associated with self |
CnxString cnx_format_cstring_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin cstring
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_bool_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin bool
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_char_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin char
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_u8_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin u8
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_u16_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin u16
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_u32_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin u32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_u64_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin u64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_i8_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin i8
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_i16_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin i16
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_i32_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin i32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_i64_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin i64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_f32_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin f32
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_f64_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for the builtin f64
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_ptr_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for pointers
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_cnx_string_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for CnxString
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
CnxString cnx_format_cnx_stringview_with_allocator(const CnxFormat*restrict self, CnxFormatContext context, CnxAllocator allocator)
implementation of CnxFormat.format_with_allocator
for CnxStringView
Parameters | |
---|---|
self | - The CnxFormat Trait object to format |
context | - The format specifier to follow |
allocator | - The CnxAllocator to allocate the format string with |
Returns | a formatted string associated with self |
static ImplTraitFor(CnxFormat,
cstring,
cnx_ format_ is_ specifier_ valid_ cstring,
cnx_ format_ cstring,
cnx_ format_ cstring_ with_ allocator)
implementation of CnxFormat
for the builtin cstring
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
bool,
cnx_ format_ is_ specifier_ valid_ bool,
cnx_ format_ bool,
cnx_ format_ bool_ with_ allocator)
implementation of CnxFormat
for the builtin bool
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
char,
cnx_ format_ is_ specifier_ valid_ char,
cnx_ format_ char,
cnx_ format_ char_ with_ allocator)
implementation of CnxFormat
for the builtin char
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
u8,
cnx_ format_ is_ specifier_ valid_ u8,
cnx_ format_ u8,
cnx_ format_ u8_ with_ allocator)
implementation of CnxFormat
for the builtin u8
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
u16,
cnx_ format_ is_ specifier_ valid_ u16,
cnx_ format_ u16,
cnx_ format_ u16_ with_ allocator)
implementation of CnxFormat
for the builtin u16
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
u32,
cnx_ format_ is_ specifier_ valid_ u32,
cnx_ format_ u32,
cnx_ format_ u32_ with_ allocator)
implementation of CnxFormat
for the builtin u32
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
u64,
cnx_ format_ is_ specifier_ valid_ u64,
cnx_ format_ u64,
cnx_ format_ u64_ with_ allocator)
implementation of CnxFormat
for the builtin u64
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
i8,
cnx_ format_ is_ specifier_ valid_ i8,
cnx_ format_ i8,
cnx_ format_ i8_ with_ allocator)
implementation of CnxFormat
for the builtin i8
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
i16,
cnx_ format_ is_ specifier_ valid_ i16,
cnx_ format_ i16,
cnx_ format_ i16_ with_ allocator)
implementation of CnxFormat
for the builtin i16
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
i32,
cnx_ format_ is_ specifier_ valid_ i32,
cnx_ format_ i32,
cnx_ format_ i32_ with_ allocator)
implementation of CnxFormat
for the builtin i32
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
i64,
cnx_ format_ is_ specifier_ valid_ i64,
cnx_ format_ i64,
cnx_ format_ i64_ with_ allocator)
implementation of CnxFormat
for the builtin i64
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
f32,
cnx_ format_ is_ specifier_ valid_ f32,
cnx_ format_ f32,
cnx_ format_ f32_ with_ allocator)
implementation of CnxFormat
for the builtin f32
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
f64,
cnx_ format_ is_ specifier_ valid_ f64,
cnx_ format_ f64,
cnx_ format_ f64_ with_ allocator)
implementation of CnxFormat
for the builtin f64
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
nullptr_ t,
cnx_ format_ is_ specifier_ valid_ ptr,
cnx_ format_ ptr,
cnx_ format_ ptr_ with_ allocator)
implementation of CnxFormat
for pointers
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
CnxString,
cnx_ format_ is_ specifier_ valid_ cnx_ string,
cnx_ format_ cnx_ string,
cnx_ format_ cnx_ string_ with_ allocator)
implementation of CnxFormat
for CnxString
Returns | The CnxFormat implementation |
---|
static ImplTraitFor(CnxFormat,
CnxStringView,
cnx_ format_ is_ specifier_ valid_ cnx_ stringview,
cnx_ format_ cnx_ stringview,
cnx_ format_ cnx_ stringview_ with_ allocator)
implementation of CnxFormat
for CnxStringView
Returns | The CnxFormat implementation |
---|