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

Streamline API for property access #9

Open
trogmaniac opened this issue Aug 3, 2023 · 2 comments
Open

Streamline API for property access #9

trogmaniac opened this issue Aug 3, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@trogmaniac
Copy link

Use the [] operator to shorten the code. E.g. instead of:

auto width = resolution->GetProperty("width")->GetValueNumber();

i would prefer something short(er) like:

auto width = resolution["width"].AsInt();

This was just a single example, this should work where ever possible.

@mtangoo
Copy link
Contributor

mtangoo commented Aug 3, 2023

I see. It is common in many languages and so it will be great to have it.
Also I like that naming. I think I will deprecate both GetValueXX and add []/ASXX

@mtangoo mtangoo self-assigned this Aug 3, 2023
@mtangoo mtangoo added the enhancement New feature or request label Aug 3, 2023
@mtangoo mtangoo added this to the 1.1.0 milestone Aug 3, 2023
@mtangoo
Copy link
Contributor

mtangoo commented Nov 3, 2024

@trogmaniac would you mind making PR with those additions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants