mirror of
https://github.com/boostorg/detail.git
synced 2025-06-28 05:21:08 +02:00
Compare commits
1 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
3b96c52505 |
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2007 Joaqu<71>n M L<>pez Mu<4D>oz.
|
||||
/* Copyright 2003-2005 Joaqu<71>n M L<>pez Mu<4D>oz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -30,21 +30,13 @@ namespace detail{
|
||||
namespace allocator{
|
||||
|
||||
/* partial_std_allocator_wrapper inherits the functionality of a std
|
||||
* allocator while providing a templatized ctor and other bits missing
|
||||
* in some stdlib implementation or another.
|
||||
* allocator while providing a templatized ctor.
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
class partial_std_allocator_wrapper:public std::allocator<Type>
|
||||
{
|
||||
public:
|
||||
/* Oddly enough, STLport does not define std::allocator<void>::value_type
|
||||
* when configured to work without partial template specialization.
|
||||
* No harm in supplying the definition here unconditionally.
|
||||
*/
|
||||
|
||||
typedef Type value_type;
|
||||
|
||||
partial_std_allocator_wrapper(){};
|
||||
|
||||
template<typename Other>
|
||||
|
@ -139,8 +139,8 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||
int shift_exponent = (cont_octet_count) * 6;
|
||||
|
||||
// Process the first character
|
||||
*to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
|
||||
(unsigned char)(*from / (1 << shift_exponent)));
|
||||
*to++ = octet1_modifier_table[cont_octet_count] +
|
||||
(unsigned char)(*from / (1 << shift_exponent));
|
||||
|
||||
// Process the continuation characters
|
||||
// Invariants: At the start of the loop:
|
||||
@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||
int i = 0;
|
||||
while (i != cont_octet_count && to != to_end) {
|
||||
shift_exponent -= 6;
|
||||
*to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
|
||||
*to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6));
|
||||
++i;
|
||||
}
|
||||
// If we filled up the out buffer before encoding the character
|
||||
@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length(
|
||||
last_octet_count = (get_octet_count(*from_next));
|
||||
++char_count;
|
||||
}
|
||||
return static_cast<int>(from_next-from_end);
|
||||
return from_next-from_end;
|
||||
}
|
||||
|
||||
unsigned int utf8_codecvt_facet::get_octet_count(
|
||||
|
Reference in New Issue
Block a user