t-suw****@users*****
t-suw****@users*****
2007年 9月 16日 (日) 09:21:45 JST
Index: AquaSKK/src/utility/utf8util.h diff -u AquaSKK/src/utility/utf8util.h:1.1.2.1 AquaSKK/src/utility/utf8util.h:1.1.2.2 --- AquaSKK/src/utility/utf8util.h:1.1.2.1 Wed Sep 12 22:45:16 2007 +++ AquaSKK/src/utility/utf8util.h Sun Sep 16 09:21:45 2007 @@ -131,12 +131,12 @@ utf8iterator<Iterator> operator-(utf8iterator<Iterator> beg, int count) { return beg -= count; } // åå§çãªæç¶ã -namespace utf8 { +struct utf8 { typedef utf8iterator<std::string::iterator> iterator; typedef utf8iterator<std::string::const_iterator> const_iterator; // UTF8 æååé·åå¾ - unsigned length(const std::string& str) { + static unsigned length(const std::string& str) { return const_iterator(str.end()) - const_iterator(str.begin()); } @@ -147,7 +147,7 @@ // utf8::push(str, "a", -3); // "aæåå"; // utf8::push(str, "b"); // "aæååb"; // - void push(std::string& target, const std::string& str, int offset = 0) { + static void push(std::string& target, const std::string& str, int offset = 0) { if(0 <= offset || target.empty()) { target += str; } else { @@ -168,7 +168,7 @@ // utf8::pop(str); // "æå"; // utf8::pop(str, -1); // "å"; // - void pop(std::string& target, int offset = 0) { + static void pop(std::string& target, int offset = 0) { iterator end(target.end()); iterator pos(end + (0 < offset ? 0 : offset) - 1);