summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-09 14:28:50 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-09 14:29:51 +0800
commite19783cb89742ada08d65d0232eed8bbd19793df (patch)
treefd4758c5a6d9cd0bdb423caf13c5163299d20151
parent83faf2027fffe8cba367edd9b33905cba1ceb900 (diff)
downloadlibpinyin-e19783cb89742ada08d65d0232eed8bbd19793df.zip
libpinyin-e19783cb89742ada08d65d0232eed8bbd19793df.tar.gz
libpinyin-e19783cb89742ada08d65d0232eed8bbd19793df.tar.xz
add operator == to ChewingKey
-rw-r--r--src/storage/chewing_key.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/storage/chewing_key.h b/src/storage/chewing_key.h
index 05b6949..ec8c7a3 100644
--- a/src/storage/chewing_key.h
+++ b/src/storage/chewing_key.h
@@ -176,6 +176,18 @@ struct ChewingKey
}
};
+static inline bool operator == (ChewingKey lhs, ChewingKey rhs) {
+ if (lhs.m_initial != rhs.m_initial)
+ return false;
+ if (lhs.m_middle != rhs.m_middle)
+ return false;
+ if (lhs.m_final != rhs.m_final)
+ return false;
+ if (lhs.m_tone != rhs.m_tone)
+ return false;
+ return true;
+}
+
struct ChewingKeyRest
{
guint16 m_table_index; /* the index in pinyin parser table. */