diff options
author | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-08-18 10:57:50 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-08-21 13:21:21 +0000 |
commit | aa66c70849525a299c9f97a964cb34bf8dff5e7f (patch) | |
tree | 71937bb061d9f6392b1ea67368076e214e6a0f89 /searchcommon | |
parent | 58ff15e924349116d14b630f5f15facf1cfd9a77 (diff) |
Add string from enum lookup to IAttributeVector
Diffstat (limited to 'searchcommon')
-rw-r--r-- | searchcommon/src/vespa/searchcommon/attribute/iattributevector.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h index 22ba5c646ea..f8ab03fdabb 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h +++ b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h @@ -241,6 +241,18 @@ public: **/ virtual bool findEnum(const char * value, EnumHandle & e) const = 0; + /** + * Given an enum handle, returns the string it refers to. + * This method will only have effect if @ref getBasicType() returns BasicType::STRING and + * @ref hasEnum() returns true. + * + * Effectively functions as the inverse of @ref findEnum(value, handle) + * + * @param e a valid enum handle + * @return enum string value, or nullptr if attribute type does + * not support enum handle lookups. + */ + virtual const char * getStringFromEnum(EnumHandle e) const = 0; /** * Creates a context for searching this attribute with the given term. |