-
Notifications
You must be signed in to change notification settings - Fork 10
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
able to get inner content by utilizing GetJsonValueByPath #115
base: master
Are you sure you want to change the base?
Conversation
|
if(path[0]!='/') { | ||
path = std::string("/")+field; | ||
} | ||
std::string fieldToConstraint = path.substr(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cielavenir looks pretty inefficient with creating all these strings on the heap, especially when rapidjson doesn't require std::string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, alternative ideas are:
- use GetJsonValueByPath only when field contains "/"
- add a new API named GetPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added GetPath now
@ziyan could you check https://github.com/mujin/controllerclientcpp/blob/savebackup/samples/mujinupdatepulseoffset.cpp#L204 ? /cc @kanbouchou Should I add GetPath()? |
btw I realized |
these will be possible
note that we cannot do
object->Get<map<string, map<string, vector<int>>>>("robot_motion_parameters");
. This is C++ limitation.We will use GetJsonValueByPath, so we add leading / to field variable (after copying to temporary variable).