-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add more apis to query vector types from a reference #4823
Conversation
include/flatbuffers/flexbuffers.h
Outdated
@@ -367,7 +367,11 @@ class Reference { | |||
bool IsNumeric() const { return IsIntOrUint() || IsFloat(); } | |||
bool IsString() const { return type_ == FBT_STRING; } | |||
bool IsKey() const { return type_ == FBT_KEY; } | |||
bool IsTypedVectorElementType() const { return flexbuffers::IsTypedVectorElementType(type_); } |
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.
can you put these in the opposite order? First IsVector
etc. It is nice if the reader can go from most general to most specific for vectors.
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.
Ok will do that.. but IsAnyVector will still be at the end as it is using other apis.
So new order.
IsVector
IsTypedVector
IsFixedTypedVector
IsAnyVector
Seems fine?
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.
IsTypedVectorElementType
is still in the wrong order?
@aardappel: changed the order again. |
include/flatbuffers/flexbuffers.h
Outdated
@@ -368,6 +368,10 @@ class Reference { | |||
bool IsString() const { return type_ == FBT_STRING; } | |||
bool IsKey() const { return type_ == FBT_KEY; } | |||
bool IsVector() const { return type_ == FBT_VECTOR || type_ == FBT_MAP; } | |||
bool IsTypedVector() const { return flexbuffers::IsTypedVector(type_); } | |||
bool IsTypedVectorElementType() const { return flexbuffers::IsTypedVectorElementType(type_); } |
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.
IsTypedVectorElementType
doesn't seem of concern to the user most of the time?
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.
don't know.. not useful for me at this time. removing it completely. can add that separately if clients need it.
Would be good to add the use of these functions in the string output? |
Ok, merging for now. Using these functions in the string output would still be a good idea. |
* Add more apis to query vector types from a reference google#4818 * changing order of apis * another reordering * removed vector element type api as not needed as for now
* Add more apis to query vector types from a reference google#4818 * changing order of apis * another reordering * removed vector element type api as not needed as for now
#4818