Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for floating point #6109

Merged
merged 3 commits into from
Mar 23, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions tools/fw-logger/string-formatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ namespace fw_logger

for (size_t i = 0; i < num_of_params; i++)
{
string regular_exp[3];
string replacement[3];
stringstream st_regular_exp[3];
stringstream st_replacement[3];
string regular_exp[4];
string replacement[4];
stringstream st_regular_exp[4];
stringstream st_replacement[4];

st_regular_exp[0] << "\\{\\b(" << i << ")\\}";
regular_exp[0] = st_regular_exp[0].str();
Expand All @@ -52,10 +52,17 @@ namespace fw_logger

exp_replace_map[regular_exp[1]] = replacement[1];

st_regular_exp[2] << "\\{\\b(" << i << "),[a-zA-Z]+\\}";
st_regular_exp[2] << "\\{\\b(" << i << "):f\\}";
regular_exp[2] = st_regular_exp[2].str();
st_replacement[2] << static_cast<float_t>(params[i]);
replacement[2] = st_replacement[2].str();
exp_replace_map[regular_exp[2]] = replacement[2];

enum_replace_map[regular_exp[2]] = params[i];

st_regular_exp[3] << "\\{\\b(" << i << "),[a-zA-Z]+\\}";
regular_exp[3] = st_regular_exp[3].str();

enum_replace_map[regular_exp[3]] = params[i];
}

return replace_params(source, exp_replace_map, enum_replace_map, dest);
Expand Down