aboutsummaryrefslogtreecommitdiff
path: root/dep/include/utf8cpp/utf8/unchecked.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-12 17:09:15 -0600
committermegamage <none@none>2009-02-12 17:09:15 -0600
commit6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch)
tree91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/include/utf8cpp/utf8/unchecked.h
parent2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff)
parentf385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'dep/include/utf8cpp/utf8/unchecked.h')
-rw-r--r--dep/include/utf8cpp/utf8/unchecked.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/dep/include/utf8cpp/utf8/unchecked.h b/dep/include/utf8cpp/utf8/unchecked.h
index 4009cebe6e4..3aa1a5dbd8d 100644
--- a/dep/include/utf8cpp/utf8/unchecked.h
+++ b/dep/include/utf8cpp/utf8/unchecked.h
@@ -32,13 +32,13 @@ DEALINGS IN THE SOFTWARE.
namespace utf8
{
- namespace unchecked
+ namespace unchecked
{
template <typename octet_iterator>
octet_iterator append(uint32_t cp, octet_iterator result)
{
if (cp < 0x80) // one octet
- *(result++) = static_cast<uint8_t>(cp);
+ *(result++) = static_cast<uint8_t>(cp);
else if (cp < 0x800) { // two octets
*(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
@@ -70,28 +70,28 @@ namespace utf8
cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
break;
case 3:
- ++it;
+ ++it;
cp = ((cp << 12) & 0xffff) + ((internal::mask8(*it) << 6) & 0xfff);
++it;
cp += (*it) & 0x3f;
break;
case 4:
++it;
- cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff);
+ cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff);
++it;
cp += (internal::mask8(*it) << 6) & 0xfff;
++it;
- cp += (*it) & 0x3f;
+ cp += (*it) & 0x3f;
break;
}
++it;
- return cp;
+ return cp;
}
template <typename octet_iterator>
uint32_t peek_next(octet_iterator it)
{
- return next(it);
+ return next(it);
}
template <typename octet_iterator>
@@ -121,14 +121,14 @@ namespace utf8
distance (octet_iterator first, octet_iterator last)
{
typename std::iterator_traits<octet_iterator>::difference_type dist;
- for (dist = 0; first < last; ++dist)
+ for (dist = 0; first < last; ++dist)
next(first);
return dist;
}
template <typename u16bit_iterator, typename octet_iterator>
octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
- {
+ {
while (start != end) {
uint32_t cp = internal::mask16(*start++);
// Take care of surrogate pairs first
@@ -138,7 +138,7 @@ namespace utf8
}
result = append(cp, result);
}
- return result;
+ return result;
}
template <typename u16bit_iterator, typename octet_iterator>
@@ -176,7 +176,7 @@ namespace utf8
// The iterator class
template <typename octet_iterator>
- class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
+ class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
octet_iterator it;
public:
iterator () {};
@@ -188,15 +188,15 @@ namespace utf8
octet_iterator temp = it;
return next(temp);
}
- bool operator == (const iterator& rhs) const
- {
+ bool operator == (const iterator& rhs) const
+ {
return (it == rhs.it);
}
bool operator != (const iterator& rhs) const
{
return !(operator == (rhs));
}
- iterator& operator ++ ()
+ iterator& operator ++ ()
{
std::advance(it, internal::sequence_length(it));
return *this;
@@ -206,7 +206,7 @@ namespace utf8
iterator temp = *this;
std::advance(it, internal::sequence_length(it));
return temp;
- }
+ }
iterator& operator -- ()
{
prior(it);
@@ -221,7 +221,7 @@ namespace utf8
}; // class iterator
} // namespace utf8::unchecked
-} // namespace utf8
+} // namespace utf8
#endif // header guard