summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-01 15:33:27 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-01 15:33:27 +0800
commit3d95277dff2e91ce436874bee5e51315f7fc4462 (patch)
tree2af50c543d30c45d6fcfa354683420d0e12d3484
parent024dc9396afe9041af46b7ab8d91c68752054679 (diff)
downloadlibpinyin-3d95277dff2e91ce436874bee5e51315f7fc4462.tar.gz
libpinyin-3d95277dff2e91ce436874bee5e51315f7fc4462.tar.xz
libpinyin-3d95277dff2e91ce436874bee5e51315f7fc4462.zip
add const modifiers
-rw-r--r--src/storage/chewing_large_table.cpp13
-rw-r--r--src/storage/chewing_large_table.h2
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<phrase_length> * begin,
PinyinIndexItem2<phrase_length> * 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 phrase_length>
int ChewingArrayIndexLevel<phrase_length>::search
-(pinyin_option_t options, /* in */ChewingKey keys[], /* out */ PhraseIndexRanges ranges) {
+(pinyin_option_t options, /* in */ChewingKey keys[],
+ /* out */ PhraseIndexRanges ranges) const {
PinyinIndexItem2<phrase_length> * chunk_begin = NULL, * chunk_end = NULL;
chunk_begin = (PinyinIndexItem2<phrase_length> *) m_chunk.begin();
chunk_end = (PinyinIndexItem2<phrase_length> *) m_chunk.end();
@@ -404,7 +405,7 @@ int ChewingArrayIndexLevel<phrase_length>::convert
(pinyin_option_t options, ChewingKey keys[],
PinyinIndexItem2<phrase_length> * begin,
PinyinIndexItem2<phrase_length> * end,
- PhraseIndexRanges ranges) {
+ PhraseIndexRanges ranges) const {
PinyinIndexItem2<phrase_length> * 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);
}