remove tabulation

This commit is contained in:
Jean-Prost Frédéric 2019-11-19 22:12:48 +01:00
parent 4be82b0e00
commit 78cfc95ffa
4 changed files with 30 additions and 30 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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