summaryrefslogtreecommitdiffstats
path: root/src/PinyinArray.h
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-05-30 21:04:22 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-05-30 21:17:53 +0800
commit9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7 (patch)
treed60c43f1a360c0a285715c676dc49c4d895c8ebb /src/PinyinArray.h
parent44f4960fb84fbb3643d523932bc8612bff5ff18c (diff)
downloadibus-libpinyin-9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7.tar.gz
ibus-libpinyin-9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7.tar.xz
ibus-libpinyin-9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7.zip
Refine coding style
Diffstat (limited to 'src/PinyinArray.h')
-rw-r--r--src/PinyinArray.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/PinyinArray.h b/src/PinyinArray.h
index 5dbc21b..2377ae6 100644
--- a/src/PinyinArray.h
+++ b/src/PinyinArray.h
@@ -32,32 +32,38 @@ struct PinyinSegment {
guint len;
PinyinSegment (const Pinyin *pinyin = NULL, guint begin = 0, guint len = 0)
- : pinyin (pinyin), begin (begin), len (len) {}
+ : pinyin (pinyin), begin (begin), len (len) { }
- operator const Pinyin * (void) const {
+ operator const Pinyin * (void) const
+ {
return pinyin;
}
- const Pinyin * operator-> (void) const {
+ const Pinyin * operator-> (void) const
+ {
return pinyin;
}
- gboolean operator == (const PinyinSegment & p) const {
+ gboolean operator == (const PinyinSegment & p) const
+ {
return (pinyin == p.pinyin) && (begin == p.begin) && (len == p.len);
}
- gboolean operator == (const Pinyin *p) const {
+ gboolean operator == (const Pinyin *p) const
+ {
return pinyin == p;
}
};
class PinyinArray: public std::vector<PinyinSegment> {
public:
- PinyinArray (guint init_size = 0) {
+ PinyinArray (guint init_size = 0)
+ {
std::vector<PinyinSegment>::reserve (init_size);
}
- void append (const Pinyin *pinyin, guint begin, guint len) {
+ void append (const Pinyin *pinyin, guint begin, guint len)
+ {
push_back (PinyinSegment (pinyin, begin, len));
}
};