Removed length from parse_result_t
This commit is contained in:
22
src/main.cpp
22
src/main.cpp
@@ -13,11 +13,25 @@ private:
|
||||
|
||||
|
||||
int main() {
|
||||
//Uart uart;
|
||||
Uart uart;
|
||||
|
||||
// Logger logger(uart);
|
||||
// logger.log<"Test:{:8.2}">(1, 2, 3);
|
||||
Logger logger(uart);
|
||||
logger.log<"Test:{}">(1, 2, 3);
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
constexpr auto ast = detail::parse_string<"Test: {:16.8} {:03.5} {:08.2}">();
|
||||
static_assert(ast.is_valid);
|
||||
|
||||
for (const auto& format_node : ast.result) {
|
||||
std::cout << "\tFormat Node:" << std::endl;
|
||||
std::cout << "\t\thas_zero_padding:\t" << format_node.has_zero_padding << std::endl;
|
||||
std::cout << "\t\tlength:\t\t\t\t" << format_node.length << std::endl;
|
||||
std::cout << "\t\tprecision:\t\t\t" << format_node.precision << std::endl;
|
||||
std::cout << "\t\ttype:\t\t\t\t" << static_cast<int>(format_node.type) << std::endl;
|
||||
}
|
||||
|
||||
/*
|
||||
constexpr detail::ConstString s = "{:8.14c}";
|
||||
|
||||
constexpr auto result = detail::parse_fmt_string<s>(2);
|
||||
@@ -28,7 +42,7 @@ int main() {
|
||||
std::cout << "\tresult.length: " << result.result.length << std::endl;
|
||||
std::cout << "\tresult.precision: " << result.result.precision << std::endl;
|
||||
std::cout << "\tresult.type: " << static_cast<int>(result.result.type) << std::endl;
|
||||
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user