2013-09-05 09:58:35 +09:00
|
|
|
.. _sprout-string-char_traits:
|
2014-08-15 21:27:31 +09:00
|
|
|
|
2013-09-05 09:58:35 +09:00
|
|
|
###############################################################################
|
|
|
|
char_traits
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
2013-09-05 13:09:04 +09:00
|
|
|
assign
|
2013-09-05 15:31:02 +09:00
|
|
|
eq
|
2013-09-05 13:09:04 +09:00
|
|
|
lt
|
|
|
|
compare
|
|
|
|
length
|
|
|
|
find
|
2013-09-05 14:09:23 +09:00
|
|
|
move
|
|
|
|
copy
|
|
|
|
assign-string
|
2013-09-05 15:31:02 +09:00
|
|
|
not_eof
|
|
|
|
to_char_type
|
|
|
|
to_int_type
|
|
|
|
eq_int_type
|
|
|
|
eof
|
2013-09-05 17:16:56 +09:00
|
|
|
compare-iterator
|
|
|
|
length-iterator
|
|
|
|
find-iterator
|
|
|
|
move-iterator
|
|
|
|
copy-iterator
|
|
|
|
assign-iterator
|
2013-09-05 13:09:04 +09:00
|
|
|
|
2013-09-05 09:58:35 +09:00
|
|
|
Interface
|
|
|
|
========================================
|
|
|
|
.. sourcecode:: c++
|
|
|
|
|
|
|
|
template<typename Char>
|
2013-09-06 14:27:44 +09:00
|
|
|
struct char_traits;
|
2013-09-05 09:58:35 +09:00
|
|
|
|
|
|
|
Description
|
|
|
|
========================================
|
|
|
|
|
|
|
|
Member types
|
|
|
|
----------------------------------------
|
|
|
|
|
2014-08-15 21:27:31 +09:00
|
|
|
.. csv-table::
|
|
|
|
:header: type, definition
|
|
|
|
:widths: 4, 8
|
|
|
|
|
|
|
|
char_type, std::char_traits<Char>::char_type
|
|
|
|
int_type, std::char_traits<Char>::int_type
|
|
|
|
off_type, std::char_traits<Char>::off_type
|
|
|
|
pos_type, std::char_traits<Char>::pos_type
|
|
|
|
state_type, std::char_traits<Char>::state_type
|
2013-09-05 09:58:35 +09:00
|
|
|
|
2013-09-05 13:09:04 +09:00
|
|
|
Static member functions
|
2013-09-05 09:58:35 +09:00
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
character operations
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2014-08-15 21:27:31 +09:00
|
|
|
.. csv-table::
|
|
|
|
:header: function
|
|
|
|
:widths: 4, 8
|
|
|
|
|
|
|
|
:doc:`assign <./assign>`, ""
|
|
|
|
:doc:`eq <./eq>`, ""
|
|
|
|
:doc:`lt <./lt>`, ""
|
2013-09-05 09:58:35 +09:00
|
|
|
|
|
|
|
string operations
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2014-08-15 21:27:31 +09:00
|
|
|
.. csv-table::
|
|
|
|
:header: function
|
|
|
|
:widths: 4, 8
|
|
|
|
|
|
|
|
:doc:`compare <./compare>`, ""
|
|
|
|
:doc:`length<./length>`, ""
|
|
|
|
:doc:`find <./find>`, ""
|
|
|
|
:doc:`move <./move>`, ""
|
|
|
|
:doc:`copy <./copy>`, ""
|
|
|
|
:doc:`assign <./assign-string>`, ""
|
2013-09-05 09:58:35 +09:00
|
|
|
|
|
|
|
integer type operations
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2014-08-15 21:27:31 +09:00
|
|
|
.. csv-table::
|
|
|
|
:header: function
|
|
|
|
:widths: 4, 8
|
|
|
|
|
|
|
|
:doc:`not_eof <./not_eof>`, ""
|
|
|
|
:doc:`to_char_type <./to_char_type>`, ""
|
|
|
|
:doc:`to_int_type <./to_int_type>`, ""
|
|
|
|
:doc:`eq_int_type <./eq_int_type>`, ""
|
|
|
|
:doc:`eof <./eof>`, ""
|
2013-09-05 09:58:35 +09:00
|
|
|
|
|
|
|
string operations (for iterator)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2014-08-15 21:27:31 +09:00
|
|
|
.. csv-table::
|
|
|
|
:header: function
|
|
|
|
:widths: 4, 8
|
|
|
|
|
|
|
|
:doc:`compare <./compare-iterator>`, ""
|
|
|
|
:doc:`length<./length-iterator>`, ""
|
|
|
|
:doc:`find <./find-iterator>`, ""
|
|
|
|
:doc:`move <./move-iterator>`, ""
|
|
|
|
:doc:`copy <./copy-iterator>`, ""
|
|
|
|
:doc:`assign <./assign-iterator>`, ""
|
2013-09-05 09:58:35 +09:00
|
|
|
|
|
|
|
Header
|
|
|
|
========================================
|
|
|
|
|
|
|
|
``sprout/string/char_traits.hpp``
|
|
|
|
|
|
|
|
Convenience header: ``sprout/string.hpp``
|
|
|
|
|
2013-09-06 14:27:44 +09:00
|
|
|
Interface of all
|
|
|
|
========================================
|
|
|
|
.. sourcecode:: c++
|
|
|
|
|
|
|
|
template<typename Char>
|
|
|
|
struct char_traits {
|
|
|
|
// types:
|
|
|
|
typedef typename std::char_traits<Char>::char_type char_type;
|
|
|
|
typedef typename std::char_traits<Char>::int_type int_type;
|
|
|
|
typedef typename std::char_traits<Char>::off_type off_type;
|
|
|
|
typedef typename std::char_traits<Char>::pos_type pos_type;
|
|
|
|
typedef typename std::char_traits<Char>::state_type state_type;
|
|
|
|
|
|
|
|
// character operations:
|
2013-11-04 14:31:03 +09:00
|
|
|
static SPROUT_CXX14_CONSTEXPR void assign(char_type& c1, char_type const& c2) SPROUT_NOEXCEPT;
|
2013-09-06 14:27:44 +09:00
|
|
|
static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT;
|
|
|
|
static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT;
|
|
|
|
|
|
|
|
// string operations:
|
|
|
|
static SPROUT_CONSTEXPR int compare(char_type const* s1, char_type const* s2, std::size_t n);
|
|
|
|
static SPROUT_CONSTEXPR std::size_t length(char_type const* s);
|
|
|
|
static SPROUT_CONSTEXPR char_type const* find(char_type const* s, std::size_t n, char_type const& a);
|
2013-11-04 14:31:03 +09:00
|
|
|
static SPROUT_CXX14_CONSTEXPR char_type* move(char_type* s1, char_type const* s2, std::size_t n);
|
|
|
|
static SPROUT_CXX14_CONSTEXPR char_type* copy(char_type* s1, char_type const* s2, std::size_t n);
|
|
|
|
static SPROUT_CXX14_CONSTEXPR char_type* assign(char_type* s, std::size_t n, char_type a);
|
2013-09-06 14:27:44 +09:00
|
|
|
|
|
|
|
// integer type operations:
|
|
|
|
static SPROUT_CONSTEXPR int_type not_eof(int_type c) SPROUT_NOEXCEPT;
|
|
|
|
static SPROUT_CONSTEXPR char_type to_char_type(int_type c) SPROUT_NOEXCEPT;
|
|
|
|
static SPROUT_CONSTEXPR int_type to_int_type(char_type c) SPROUT_NOEXCEPT;
|
|
|
|
static SPROUT_CONSTEXPR bool eq_int_type(int_type c1, int_type c2) SPROUT_NOEXCEPT;
|
|
|
|
static SPROUT_CONSTEXPR int_type eof() SPROUT_NOEXCEPT;
|
|
|
|
|
|
|
|
// string operations (for iterator):
|
|
|
|
template<typename ConstInputIterator>
|
|
|
|
static SPROUT_CONSTEXPR int compare(char_type const* s1, ConstInputIterator s2, std::size_t n);
|
|
|
|
template<typename ConstInputIterator>
|
|
|
|
static SPROUT_CONSTEXPR int compare(ConstInputIterator s1, char_type const* s2, std::size_t n);
|
|
|
|
template<typename ConstInputIterator1, typename ConstInputIterator2>
|
|
|
|
static SPROUT_CONSTEXPR int compare(ConstInputIterator1 s1, ConstInputIterator2 s2, std::size_t n);
|
|
|
|
template<typename ConstInputIterator>
|
|
|
|
static SPROUT_CONSTEXPR std::size_t length(ConstInputIterator s);
|
|
|
|
template<typename ConstInputIterator>
|
|
|
|
static SPROUT_CONSTEXPR ConstInputIterator find(ConstInputIterator s, std::size_t n, char_type const& a);
|
|
|
|
template<typename OutputIterator, typename ConstInputIterator>
|
2013-11-04 14:31:03 +09:00
|
|
|
static SPROUT_CXX14_CONSTEXPR OutputIterator move(OutputIterator s1, ConstInputIterator s2, std::size_t n);
|
2013-09-06 14:27:44 +09:00
|
|
|
template<typename OutputIterator, typename ConstInputIterator>
|
2013-11-04 14:31:03 +09:00
|
|
|
static SPROUT_CXX14_CONSTEXPR OutputIterator copy(OutputIterator s1, ConstInputIterator s2, std::size_t n);
|
2013-09-06 14:27:44 +09:00
|
|
|
template<typename OutputIterator>
|
2013-11-04 14:31:03 +09:00
|
|
|
static SPROUT_CXX14_CONSTEXPR OutputIterator assign(OutputIterator s, std::size_t n, char_type a);
|
2013-09-06 14:27:44 +09:00
|
|
|
};
|