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

All fields end up with quotes and string end up double quoted. #115

Open
ItsGarand opened this issue Mar 14, 2022 · 0 comments
Open

All fields end up with quotes and string end up double quoted. #115

ItsGarand opened this issue Mar 14, 2022 · 0 comments

Comments

@ItsGarand
Copy link

ItsGarand commented Mar 14, 2022

In BoostSupport.cxx queryImpl(), the response to the query (const auto response = transport->query(querty);) returns a JSON string and then loaded into a ptree.
so, all field data is represented as a string in the ptree.

See ticket #113!

If you agree with the changes in #113, all fields will end up being stored as a string with actual strings being inserted double quoted.

So the following code int Point.cxx will need to change:
convert << field.first << "=";
std::visit(overloaded {
[&convert](int v) { convert << v << 'i'; },
[&convert](long long int v) { convert << v << 'i'; },
[&convert](double v) { convert << std::fixed << v; },
[&convert](const std::string& v) { convert << '"' << v << '"'; },
}, field.second);

at a minimum { convert << '"' << v << '"'; } needs to change to { convert << v; }
So, all fields will be string representations. Let the consumer of the field data do the conversion.

Or add code to BoostSupport.cxx to decide the data types and convert prior to insertion in the point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants