diff options
author | Peng Wu <alexepico@gmail.com> | 2011-12-09 14:28:50 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-09 14:29:51 +0800 |
commit | e19783cb89742ada08d65d0232eed8bbd19793df (patch) | |
tree | fd4758c5a6d9cd0bdb423caf13c5163299d20151 /src/storage | |
parent | 83faf2027fffe8cba367edd9b33905cba1ceb900 (diff) | |
download | libpinyin-e19783cb89742ada08d65d0232eed8bbd19793df.tar.gz libpinyin-e19783cb89742ada08d65d0232eed8bbd19793df.tar.xz libpinyin-e19783cb89742ada08d65d0232eed8bbd19793df.zip |
add operator == to ChewingKey
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/chewing_key.h | 12 |
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. */ |