• R/O
  • SSH
  • HTTPS

qrobosdk: コミット


コミットメタ情報

リビジョン1794 (tree)
日時2010-04-20 06:12:12
作者satofumi

ログメッセージ

add Utf8::ch() method

変更サマリ

差分

--- trunk/libs/lua/luabindInput.cpp (revision 1793)
+++ trunk/libs/lua/luabindInput.cpp (revision 1794)
@@ -23,9 +23,13 @@
2323 [
2424 class_<Utf8>("Utf8")
2525 .def(constructor<const char*>())
26+ .def("size", &Utf8::size)
27+ .def("ch", &Utf8::ch)
2628 .def("c_str", &Utf8::c_str)
29+ .def("substr", &Utf8::substr)
2730 .def("pop_back", &Utf8::pop_back),
2831
32+
2933 def("convertToRoman", &convertToRoman),
3034 def("convertToJp", &convertToJp)
3135 ];
--- trunk/libs/input/Utf8.cpp (revision 1793)
+++ trunk/libs/input/Utf8.cpp (revision 1794)
@@ -101,7 +101,7 @@
101101 }
102102
103103
104-unsigned short Utf8::operator[](size_t index)
104+unsigned short Utf8::ch(size_t index)
105105 {
106106 size_t first_index = pimpl->utf8_index(index);
107107 size_t last_index = pimpl->utf8_index(index + 1);
@@ -120,6 +120,12 @@
120120 }
121121
122122
123+unsigned short Utf8::operator[](size_t index)
124+{
125+ return ch(index);
126+}
127+
128+
123129 const char* Utf8::c_str(void)
124130 {
125131 pimpl->c_string_.clear();
@@ -140,6 +146,17 @@
140146 }
141147
142148
149+Utf8 Utf8::substr(size_t first_index, size_t n)
150+{
151+ (void)first_index;
152+ (void)n;
153+
154+ // !!!
155+
156+ return Utf8("");
157+}
158+
159+
143160 void Utf8::pop_back(void)
144161 {
145162 if (! pimpl->index_.empty()) {
--- trunk/libs/input/Utf8.h (revision 1793)
+++ trunk/libs/input/Utf8.h (revision 1794)
@@ -33,10 +33,14 @@
3333 bool empty(void);
3434 void clear(void);
3535 size_t size(void);
36+
37+ unsigned short ch(size_t index);
3638 unsigned short operator[](size_t index);
3739
3840 const char* c_str(void);
3941
42+ Utf8 substr(size_t first_index, size_t n);
43+
4044 void pop_back(void);
4145
4246 //Utf8& substr(size_t first, size_t last = std::string::npos);
--- trunk/programs/UrgViewer/print_timestamp.py (revision 1793)
+++ trunk/programs/UrgViewer/print_timestamp.py (revision 1794)
@@ -20,9 +20,9 @@
2020 pre_timestamp = -1
2121 for line in open("mConnection_0_recv.txt"):
2222 if pre_line == '99b':
23- timestamp_string = line[:-2]
23+ timestamp_string = line[:-2] # ignore checksum
2424 timestamp = decode(timestamp_string)
25- print str(timestamp) + "(" + str(pre_timestamp - timestamp) + ")"
25+ print str(timestamp) + "(" + str(timestamp - pre_timestamp) + ")"
2626 pre_timestamp = timestamp
2727
2828 pre_line = line[:-1]
旧リポジトリブラウザで表示