You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a module that needs to add the words true/false (actual strings, not boolean values) to a Bottle. However I observed that adding the strings true and false to a Bottle then printing it on screen shows quotation marks around these words, while other strings show no quotes. I guess it has to do with true and false being reserved keywords in C++.
In the end, this is not really a problem for our project: the client that reads the Values from my Bottle works whether those quotation marks are present or not.
However, I am still curious about this behaviour, if it is expected of yarp to put those quotes around true/false, do you know @paulfitz@drdanz?
Please feel free to close this issue when you want.
I think this behavior is to keep unquoted true/false free for eventual json compatibility. When converting the entire bottle, each element is serialized in a way that lets it be read again as the original type. You could ask bot.get(1).asString() if you expect a string, and there will be no quoting. Sorry for the confusion and delay responding.
I have a module that needs to add the words true/false (actual strings, not boolean values) to a Bottle. However I observed that adding the strings
true
andfalse
to a Bottle then printing it on screen shows quotation marks around these words, while other strings show no quotes. I guess it has to do with true and false being reserved keywords in C++.Example:
prints
word1 "true" any_other_word
<-- notice quotation marks aroundtrue
. Is it possible to obtainword1 true any_other_word
instead?The text was updated successfully, but these errors were encountered: