mini-yaml icon indicating copy to clipboard operation
mini-yaml copied to clipboard

Adding at() or find()?

Open kuangdai opened this issue 6 years ago • 1 comments

Thanks for providing such a wonderful tool.

I am using yaml only for input (and I guess this is the way yaml is used frequently). Currently, random visit is supported only by non-const operator [], which is not available for this purpose. Do you think it is worthwhile to add

const Node & at (const size_t index) const; const Node & at (const std::string & key) const;

Now I am implement this using const iterator, which is lengthy...

Regards

kuangdai avatar Sep 01 '19 23:09 kuangdai

Hi @kuangdai, thank you for your input.

It's a great idea to add new const(and non-const) methods for retrieving nodes by their index or key. I'm currently refactoring the library and will start using branches and releases to mark and track the version of mini-yaml, because this library is becoming pretty popular. I'll make sure to implement this feature while refactoring, thank you.

jimmiebergmann avatar Sep 11 '19 14:09 jimmiebergmann