summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-05-16 14:14:39 +0800
committerPeng Wu <alexepico@gmail.com>2012-05-16 14:14:39 +0800
commit160a73b0d0efae72d2b6232e393897e3aa075811 (patch)
treec51506595c28f4de462c7560d718ffceab1d7427
parent26fa8c335d695379d139cd524d59482bdca7daba (diff)
downloadlibpinyin-160a73b0d0efae72d2b6232e393897e3aa075811.tar.gz
libpinyin-160a73b0d0efae72d2b6232e393897e3aa075811.tar.xz
libpinyin-160a73b0d0efae72d2b6232e393897e3aa075811.zip
write FacadePhraseIndex::clear_ranges
-rw-r--r--src/storage/phrase_index.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/storage/phrase_index.h b/src/storage/phrase_index.h
index d7b8747..7e7739e 100644
--- a/src/storage/phrase_index.h
+++ b/src/storage/phrase_index.h
@@ -670,6 +670,23 @@ 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 * onerange = ranges[i];
+ if (onerange) {
+ g_array_set_size(onerange, 0);
+ }
+ }
+ }
+
+ /**
* FacadePhraseIndex::destroy_ranges:
* @ranges: the ranges to be destroyed.
* @returns: whether the destroy operation is successful.