pointed by id is the empty string.
This is way faster than testing whether
GetText(id) == "".
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@24
3cdefd35-fc62-479d-8e8d-
bae585ffb9ca
maketables();
}
+bool CSA::EmptyText(DocId k) const
+{
+ assert(k < (DocId)textLength.size());
+ return (1 == textLength[k].first);
+}
uchar* CSA::GetText(DocId k) const
{
*/
void InsertText(uchar const *);
void MakeStatic();
+ bool EmptyText(DocId) const;
uchar* GetText(DocId) const;
uchar* GetText(DocId, TextPosition, TextPosition) const;
* New texts can not be inserted after this operation.
*/
virtual void MakeStatic() = 0;
-
+
+ /**
+ tests if the string pointed to by DocId is empty
+ */
+
+ virtual bool EmptyText(DocId) const = 0;
+
/**
* Displaying content
*