MtFmt 1.0.0
MtFmt is a format library on embed. system and wrote by pure C.
载入中...
搜索中...
未找到
mm_fmt.h
浏览该文件的文档.
1// SPDX-License-Identifier: LGPL-3.0
12#if !defined(_INCLUDE_MM_FMT_H_)
13#define _INCLUDE_MM_FMT_H_
14#include "mm_cfg.h"
15#include "mm_parser.h"
16#include "mm_result.h"
17#include "mm_string.h"
18#include "mm_type.h"
19
29
40
68
80mstr_format(MString* res_str, const char* fmt, usize_t fmt_place, ...);
81
95 const char* fmt,
96 MString* res_str,
97 usize_t fmt_place,
98 va_list* ap_ptr
99);
100
111 MString* res_str, const char* fmt, MStrFmtArgsContext* ctx
112);
113
125 MString* str,
126 int32_t value,
127 MStrFmtIntIndex index,
129);
130
140mstr_fmt_utoa(MString* res_str, uint32_t value, MStrFmtIntIndex index);
141
153 MString* res_str,
154 int32_t value,
155 uint32_t quat,
157);
158
168mstr_fmt_uqtoa(MString* res_str, uint32_t value, uint32_t quat);
169
180 MString* res_str,
181 const MStrTime* tm,
182 const MStrFmtChronoFormatSpec* spec
183);
184#endif // !_INCLUDE_MM_FMT_H_
配置选项
#define MSTR_EXPORT_API(ret)
Definition mm_cfg.h:421
struct tagMStrFmtFormatArgument MStrFmtFormatArgument
格式化参数
mstr_fmt_itoa(MString *str, int32_t value, MStrFmtIntIndex index, MStrFmtSignDisplay sign)
将有符号整数转换为字符串
Definition mm_into.c:34
mstr_fmt_uqtoa(MString *res_str, uint32_t value, uint32_t quat)
将无符号量化值转换为字符串
Definition mm_into.c:115
mstr_fmt_ttoa(MString *res_str, const MStrTime *tm, const MStrFmtChronoFormatSpec *spec)
将日期时间值转换为字符串
Definition mm_into.c:139
mstr_fmt_iqtoa(MString *res_str, int32_t value, uint32_t quat, MStrFmtSignDisplay sign)
将有符号量化值转换为字符串
Definition mm_into.c:96
mstr_format(MString *res_str, const char *fmt, usize_t fmt_place,...)
格式化字符串
Definition mm_fmt.c:66
mstr_fmt_utoa(MString *res_str, uint32_t value, MStrFmtIntIndex index)
将无符号整数转换为字符串
Definition mm_into.c:51
tagMStrFmtIntIndex
转换整数时采用的进制
Definition mm_fmt.h:46
@ MStrFmtIntIndex_Hex_WithPrefix
转换为小写的十六进制值字符串, 带0x前缀
Definition mm_fmt.h:63
@ MStrFmtIntIndex_Dec
转换为十进制字符串
Definition mm_fmt.h:54
@ MStrFmtIntIndex_Hex_UpperCase
转换为大写的十六进制值字符串
Definition mm_fmt.h:60
@ MStrFmtIntIndex_Bin
转换为二进制字符串
Definition mm_fmt.h:48
@ MStrFmtIntIndex_Hex_UpperCase_WithPrefix
转换为大写的十六进制值字符串, 带0X前缀
Definition mm_fmt.h:66
@ MStrFmtIntIndex_Hex
转换为小写的十六进制值字符串
Definition mm_fmt.h:57
@ MStrFmtIntIndex_Oct
转换为八进制字符串
Definition mm_fmt.h:51
mstr_vformat(const char *fmt, MString *res_str, usize_t fmt_place, va_list *ap_ptr)
格式化字符串
Definition mm_fmt.c:77
mstr_context_format(MString *res_str, const char *fmt, MStrFmtArgsContext *ctx)
按照上下文进行格式化
Definition mm_fmt.c:91
enum tagMStrFmtIntIndex MStrFmtIntIndex
转换整数时采用的进制
struct tagMStrFmtArgsContext MStrFmtArgsContext
格式化参数的context
分析器
enum tagMStrFmtSignDisplay MStrFmtSignDisplay
格式化值时候的符号显示方式
#define MFMT_PLACE_MAX_NUM
格式化最多支持的参数个数
Definition mm_parser.h:23
enum tagMStrFmtArgType MStrFmtArgType
格式化参数的类型
结果类型
enum tagMStrResult mstr_result_t
结果类型
字符串
const MString * str
Definition mm_string.h:440
type alias和type def
intptr_t iptr_t
Definition mm_type.h:39
size_t usize_t
尺寸(无符号)
Definition mm_type.h:32
格式化参数的context
Definition mm_fmt.h:35
usize_t max_place
Definition mm_fmt.h:37
va_list * p_ap
Definition mm_fmt.h:36
MStrFmtFormatArgument cache[MFMT_PLACE_MAX_NUM]
Definition mm_fmt.h:38
时间的格式化描述标记
Definition mm_parser.h:275
格式化参数
Definition mm_fmt.h:25
iptr_t value
Definition mm_fmt.h:26
MStrFmtArgType type
Definition mm_fmt.h:27
RTC时间
Definition mm_type.h:81
字符串
Definition mm_string.h:79