summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/storage/phrase_index.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/storage/phrase_index.h b/src/storage/phrase_index.h
index d661952..acc7c4a 100644
--- a/src/storage/phrase_index.h
+++ b/src/storage/phrase_index.h
@@ -670,6 +670,24 @@ public:
}
/**
+ * FacadePhraseIndex::clear_ranges:
+ * @ranges: the ranges to be cleared.
+ * @returns: whether the clear operation is successful.
+ *
+ * Clear the ranges.
+ *
+ */
+ bool clear_ranges(PhraseIndexRanges ranges) {
+ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
+ GArray * range = ranges[i];
+ if (range) {
+ g_array_set_size(range, 0);
+ }
+ }
+ return true;
+ }
+
+ /**
* FacadePhraseIndex::destroy_ranges:
* @ranges: the ranges to be destroyed.
* @returns: whether the destroy operation is successful.
@@ -711,6 +729,24 @@ public:
}
/**
+ * FacadePhraseIndex::clear_tokens:
+ * @tokens: the tokens to be cleared.
+ * @return: whether the clear operation is successful.
+ *
+ * Clear the tokens.
+ *
+ */
+ bool clear_tokens(PhraseTokens tokens) {
+ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
+ GArray * token = tokens[i];
+ if (token) {
+ g_array_set_size(token, 0);
+ }
+ }
+ return true;
+ }
+
+ /**
* FacadePhraseIndex::destroy_tokens:
* @tokens: the tokens to be destroyed.
* @returns: whether the destroy operation is successful.