From 3d95277dff2e91ce436874bee5e51315f7fc4462 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 1 Dec 2011 15:33:27 +0800 Subject: add const modifiers --- src/storage/chewing_large_table.cpp | 13 +++++++------ src/storage/chewing_large_table.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp index f267a91..680983d 100644 --- a/src/storage/chewing_large_table.cpp +++ b/src/storage/chewing_large_table.cpp @@ -45,7 +45,7 @@ public: /* search method */ int search(pinyin_option_t options, int phrase_length, /* in */ ChewingKey keys[], - /* out */ PhraseIndexRanges ranges); + /* out */ PhraseIndexRanges ranges) const; /* add/remove index method */ int add_index(int phrase_length, /* in */ ChewingKey keys[], @@ -65,7 +65,7 @@ protected: ChewingKey keys[], PinyinIndexItem2 * begin, PinyinIndexItem2 * end, - PhraseIndexRanges ranges); + PhraseIndexRanges ranges) const; public: /* load/store method */ @@ -75,7 +75,7 @@ public: /* search method */ int search(pinyin_option_t options, /* in */ChewingKey keys[], - /* out */ PhraseIndexRanges ranges); + /* out */ PhraseIndexRanges ranges) const; /* add/remove index method */ int add_index(/* in */ ChewingKey keys[], /* in */ phrase_token_t token); @@ -332,7 +332,7 @@ ChewingLengthIndexLevel::~ChewingLengthIndexLevel() { int ChewingLengthIndexLevel::search(pinyin_option_t options, int phrase_length, /* in */ ChewingKey keys[], - /* out */ PhraseIndexRanges ranges) { + /* out */ PhraseIndexRanges ranges) const { int result = SEARCH_NONE; if (m_chewing_array_indexes->len < phrase_length + 1) return result; @@ -376,7 +376,8 @@ int ChewingLengthIndexLevel::search(pinyin_option_t options, int phrase_length, template int ChewingArrayIndexLevel::search -(pinyin_option_t options, /* in */ChewingKey keys[], /* out */ PhraseIndexRanges ranges) { +(pinyin_option_t options, /* in */ChewingKey keys[], + /* out */ PhraseIndexRanges ranges) const { PinyinIndexItem2 * chunk_begin = NULL, * chunk_end = NULL; chunk_begin = (PinyinIndexItem2 *) m_chunk.begin(); chunk_end = (PinyinIndexItem2 *) m_chunk.end(); @@ -404,7 +405,7 @@ int ChewingArrayIndexLevel::convert (pinyin_option_t options, ChewingKey keys[], PinyinIndexItem2 * begin, PinyinIndexItem2 * end, - PhraseIndexRanges ranges) { + PhraseIndexRanges ranges) const { PinyinIndexItem2 * iter = NULL; PhraseIndexRange cursor; GArray * head, * cursor_head = NULL; diff --git a/src/storage/chewing_large_table.h b/src/storage/chewing_large_table.h index 2a6e5ca..746c18d 100644 --- a/src/storage/chewing_large_table.h +++ b/src/storage/chewing_large_table.h @@ -123,7 +123,7 @@ public: /* search method */ int search(int phrase_length, /* in */ ChewingKey keys[], - /* out */ PhraseIndexRanges ranges) { + /* out */ PhraseIndexRanges ranges) const { return m_bitmap_table.search(phrase_length, keys, ranges); } -- cgit