|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
字符串格式化功能 更多...
类 | |
| struct | format_options |
| 格式选项 更多... | |
| struct | formatter< Number, Dummy > |
| 格式化器主模板 更多... | |
| struct | formatter< T, enable_if_t< is_floating_point_v< T > > > |
| 浮点数类型的格式化器特化 更多... | |
| struct | formatter< T, enable_if_t< is_standard_integral_v< T > &&is_signed_v< T > > > |
| 有符号整数类型的格式化器特化 更多... | |
| struct | formatter< T, enable_if_t< is_standard_integral_v< T > &&is_unsigned_v< T > > > |
| 无符号整数类型的格式化器特化 更多... | |
| struct | formatter< char > |
| 单个字符的格式化器特化 更多... | |
| struct | formatter< bool > |
| 布尔类型的格式化器特化 更多... | |
| struct | formatter< string > |
| 字符串类型的格式化器特化 更多... | |
| struct | formatter< string_view > |
| 字符串视图的格式化器特化 更多... | |
| struct | formatter< const char * > |
| C风格字符串的格式化器特化 更多... | |
| struct | formatter< nullptr_t > |
| nullptr_t 格式化器 更多... | |
| struct | formatter< T *, enable_if_t<!is_cstring_v< T * > > > |
| 指针格式化器 更多... | |
| struct | formatter< char * > |
| 非const C风格字符串的格式化器特化 更多... | |
枚举 | |
| enum class | format_align { format_align::DEFAULT , format_align::LEFT , format_align::RIGHT , format_align::CENTER , format_align::NUMERIC } |
| 对齐方式枚举 更多... | |
| enum class | format_type : uint8_t { format_type::DEFAULT , format_type::DECIMAL , format_type::BINARY , format_type::OCTAL , format_type::HEX , format_type::SCIENTIFIC , format_type::FIXED , format_type::GENERAL , format_type::CHAR } |
| 数值类型格式枚举 更多... | |
函数 | |
| template<typename... Args, enable_if_t<(sizeof...(Args) > 0), int > = 0> | |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | format (const string_view fmt, Args &&... args) |
| 格式化字符串 | |
字符串格式化功能
|
strong |
对齐方式枚举
| 枚举值 | |
|---|---|
| DEFAULT | 默认(数字右对齐,其他左对齐) |
| LEFT | 左对齐 '<' |
| RIGHT | 右对齐 '>' |
| CENTER | 居中 '^' |
| NUMERIC | 符号感知填充 '=' |
在文件 format.hpp 第 25 行定义.
|
strong |
数值类型格式枚举
| 枚举值 | |
|---|---|
| DEFAULT | 默认(由类型决定) |
| DECIMAL | 十进制 'd' / 'f' / 'g' |
| BINARY | 二进制 'b' |
| OCTAL | 八进制 'o' |
| HEX | 十六进制 'x' / 'X' |
| SCIENTIFIC | 科学计数法 'e' / 'E' |
| FIXED | 固定小数 'f' |
| GENERAL | 通用浮点 'g' / 'G' |
| CHAR | 字符 'c' |
在文件 format.hpp 第 37 行定义.
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string format | ( | const string_view | fmt, |
| Args &&... | args ) |
格式化字符串
| Args | 参数类型 |
| fmt | 格式字符串 |
| args | 要格式化的参数 |
| value_exception | 如果格式错误 |
在文件 format.hpp 第 680 行定义.
引用了 forward(), basic_string< CharT, Traits, Alloc >::reserve() , 以及 basic_string_view< CharT, Traits >::size().
被这些函数引用 zlib_compressor::compress(), zlib_compressor::compress(), zlib_compressor::compress(), zlib_compressor::decompress(), zlib_compressor::decompress(), sys_console::printcf(), sys_console::printcfln(), sys_console::printf(), sys_console::printfln(), zlib_compressor::stream_compressor::reset(), zlib_compressor::stream_decompressor::reset(), zlib_compressor::stream_compressor::stream_compressor(), zlib_compressor::stream_decompressor::stream_decompressor(), datetime::to_offset_string(), color::to_string(), date::to_string(), time::to_string() , 以及 datetime::to_string_GMT().