mirror of
https://github.com/nemtrif/utfcpp.git
synced 2025-04-06 05:55:08 +00:00
remove tabulation
This commit is contained in:
parent
4be82b0e00
commit
78cfc95ffa
4 changed files with 30 additions and 30 deletions
|
@ -166,8 +166,8 @@ namespace utf8
|
|||
uint32_t next(octet_iterator& it, octet_iterator end)
|
||||
{
|
||||
uint32_t cp = next_impl(it, end);//throw if error
|
||||
++it;
|
||||
return cp;
|
||||
++it;
|
||||
return cp;
|
||||
}
|
||||
|
||||
template <typename octet_iterator>
|
||||
|
@ -342,10 +342,10 @@ namespace utf8
|
|||
uint32_t cp{};
|
||||
bool ok{};
|
||||
void read() {
|
||||
ok = it != range_end;
|
||||
if(ok) {
|
||||
cp = utf8::next_impl(it, range_end);
|
||||
}
|
||||
ok = it != range_end;
|
||||
if(ok) {
|
||||
cp = utf8::next_impl(it, range_end);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -361,7 +361,7 @@ namespace utf8
|
|||
uint32_t operator * () const
|
||||
{
|
||||
if(!ok) {
|
||||
throw std::runtime_error("no such element");
|
||||
throw std::runtime_error("no such element");
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
@ -394,8 +394,8 @@ namespace utf8
|
|||
template <typename octet_iterator>
|
||||
struct get_iterator_class {
|
||||
private:
|
||||
static input_iterator<octet_iterator> get(std::input_iterator_tag);
|
||||
static bidirectional_iterator<octet_iterator> get(std::bidirectional_iterator_tag);
|
||||
static input_iterator<octet_iterator> get(std::input_iterator_tag);
|
||||
static bidirectional_iterator<octet_iterator> get(std::bidirectional_iterator_tag);
|
||||
public:
|
||||
using type = decltype(get(Iterator_category<octet_iterator>{}));
|
||||
};
|
||||
|
@ -429,11 +429,11 @@ namespace utf8
|
|||
}
|
||||
|
||||
inline std::pair<iterator<std::istream_iterator<char>>, iterator<std::istream_iterator<char>>> make_iterator_pair(std::istream& is) {
|
||||
using Is_iter = std::istream_iterator<char>;
|
||||
using Iter = iterator<Is_iter>;
|
||||
auto it = Is_iter{is};
|
||||
auto end = Is_iter{};
|
||||
return std::make_pair(Iter{it, it, end}, Iter{end, it, end});
|
||||
using Is_iter = std::istream_iterator<char>;
|
||||
using Iter = iterator<Is_iter>;
|
||||
auto it = Is_iter{is};
|
||||
auto end = Is_iter{};
|
||||
return std::make_pair(Iter{it, it, end}, Iter{end, it, end});
|
||||
}
|
||||
|
||||
} // namespace utf8
|
||||
|
|
|
@ -296,7 +296,7 @@ namespace internal
|
|||
if(err == UTF8_OK) {
|
||||
++it;
|
||||
}
|
||||
return err;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
@ -339,7 +339,7 @@ namespace internal
|
|||
((it != end) && (utf8::internal::mask8(*it++)) == bom[1]) &&
|
||||
((it != end) && (utf8::internal::mask8(*it)) == bom[2])
|
||||
);
|
||||
}
|
||||
}
|
||||
} // namespace utf8
|
||||
|
||||
#endif // header guard
|
||||
|
|
|
@ -29,8 +29,8 @@ DEALINGS IN THE SOFTWARE.
|
|||
|
||||
namespace utf8
|
||||
{
|
||||
template<typename T>
|
||||
using Iterator_category = typename std::iterator_traits<T>::iterator_category;
|
||||
template<typename T>
|
||||
using Iterator_category = typename std::iterator_traits<T>::iterator_category;
|
||||
|
||||
} // namespace utf8
|
||||
|
||||
|
|
|
@ -131,9 +131,9 @@ namespace utf8
|
|||
|
||||
template <typename octet_iterator>
|
||||
inline uint32_t next(octet_iterator& it) {
|
||||
uint32_t cp{next_impl(it)};
|
||||
++it;
|
||||
return cp;
|
||||
uint32_t cp{next_impl(it)};
|
||||
++it;
|
||||
return cp;
|
||||
}
|
||||
|
||||
template <typename octet_iterator>
|
||||
|
@ -276,7 +276,7 @@ namespace utf8
|
|||
octet_iterator it;
|
||||
uint32_t cp{};
|
||||
void read() {
|
||||
cp = utf8::unchecked::next_impl(it);
|
||||
cp = utf8::unchecked::next_impl(it);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -317,12 +317,12 @@ namespace utf8
|
|||
template <typename octet_iterator>
|
||||
struct get_iterator_class {
|
||||
private:
|
||||
static input_iterator<octet_iterator> get(std::input_iterator_tag);
|
||||
static bidirectional_iterator<octet_iterator> get(std::bidirectional_iterator_tag);
|
||||
static input_iterator<octet_iterator> get(std::input_iterator_tag);
|
||||
static bidirectional_iterator<octet_iterator> get(std::bidirectional_iterator_tag);
|
||||
public:
|
||||
using type = decltype(get(Iterator_category<octet_iterator>{}));
|
||||
};
|
||||
}//internal
|
||||
}//internal
|
||||
|
||||
template <typename octet_iterator>
|
||||
using iterator = typename utf8::unchecked::internal::get_iterator_class<octet_iterator>::type;
|
||||
|
@ -351,11 +351,11 @@ namespace utf8
|
|||
}
|
||||
|
||||
inline std::pair<iterator<std::istream_iterator<char>>, iterator<std::istream_iterator<char>>> make_iterator_pair(std::istream& is) {
|
||||
using Is_iter = std::istream_iterator<char>;
|
||||
using Iter = iterator<Is_iter>;
|
||||
auto it = Is_iter{is};
|
||||
auto end = Is_iter{};
|
||||
return std::make_pair(Iter{it}, Iter{end});
|
||||
using Is_iter = std::istream_iterator<char>;
|
||||
using Iter = iterator<Is_iter>;
|
||||
auto it = Is_iter{is};
|
||||
auto end = Is_iter{};
|
||||
return std::make_pair(Iter{it}, Iter{end});
|
||||
}
|
||||
|
||||
} // namespace utf8::unchecked
|
||||
|
|
Loading…
Add table
Reference in a new issue