write chewing key rest in progress
authorPeng Wu <alexepico@gmail.com>
Tue, 15 Nov 2011 06:30:07 +0000 (14:30 +0800)
committerPeng Wu <alexepico@gmail.com>
Tue, 15 Nov 2011 06:30:07 +0000 (14:30 +0800)
src/storage/chewing_key.h
src/storage/pinyin_parser2.cpp

index 0fdb3d3..ea086b7 100644 (file)
@@ -190,6 +190,9 @@ struct ChewingKeyRest
         m_pinyin_begin = 0;
         m_pinyin_end = 0;
     }
+
+    const char * get_pinyin_string();
+    const char * get_chewing_string();
 };
 
 };
index 6885812..ea180fe 100644 (file)
@@ -28,7 +28,7 @@
 
 using namespace pinyin;
 
-bool check_pinyin_options(guint32 options, pinyin_index_item_t * item) {
+static bool check_pinyin_options(guint32 options, pinyin_index_item_t * item) {
     guint32 flags = item->m_flags;
     assert (flags & IS_PINYIN);
 
@@ -50,7 +50,7 @@ bool check_pinyin_options(guint32 options, pinyin_index_item_t * item) {
     return true;
 }
 
-bool check_chewing_options(guint32 options, chewing_index_item_t * item) {
+static bool check_chewing_options(guint32 options, chewing_index_item_t * item) {
     guint32 flags = item->m_flags;
     assert (flags & IS_CHEWING);
 
@@ -62,3 +62,21 @@ bool check_chewing_options(guint32 options, chewing_index_item_t * item) {
 
     return true;
 }
+
+const char * ChewingKeyRest::get_pinyin_string(){
+    if (m_index == 0)
+        return NULL;
+
+    /* check end boundary. */
+    assert(m_index < G_N_ELEMENTS(content_table));
+    return content_table[m_index].m_pinyin_str;
+}
+
+const char * ChewingKeyRest::get_chewing_string(){
+    if (m_index == 0)
+        return NULL;
+
+    /* check end boundary. */
+    assert(m_index < G_N_ELEMENTS(content_table));
+    return content_table[m_index].m_chewing_str;
+}