From ac20c12603e9d933b14977aa63e0a64a602fcfd1 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Sun, 17 Jun 2018 22:32:32 +0200 Subject: Add getNamePrefix to get the prefix before any '.' --- searchcommon/src/vespa/searchcommon/attribute/iattributevector.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'searchcommon') diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h index c7993503107..c432606f7f0 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h +++ b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h @@ -71,6 +71,11 @@ public: **/ virtual const vespalib::string & getName() const = 0; + vespalib::stringref getNamePrefix() const { + vespalib::stringref name = getName(); + return name.substr(0, name.find('.')); + } + /** * Returns the number of documents stored in this attribute vector. * -- cgit v1.2.3