mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
add doc: char_traits string operations
This commit is contained in:
parent
b7d68b357d
commit
3107804d87
15 changed files with 797 additions and 14 deletions
39
docs/_sources/libs/string/char_traits/assign-string.txt
Normal file
39
docs/_sources/libs/string/char_traits/assign-string.txt
Normal file
|
@ -0,0 +1,39 @@
|
|||
.. _sprout-string-char_traits-assign-string:
|
||||
###############################################################################
|
||||
assign
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
static char_type* assign(char_type* s, std::size_t n, char_type a);
|
||||
|
||||
Effects
|
||||
========================================
|
||||
|
||||
| Equivalent to ``std::char_traits<Char>::assign(s, n, a)``.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/string.hpp>
|
||||
#include <sprout/assert.hpp>
|
||||
using namespace sprout;
|
||||
|
||||
char x[] = "homuhomu";
|
||||
char_traits<char>::assign(x, 8, 'M');
|
||||
SPROUT_ASSERT_MSG(x[0] == 'M', "x is filled by M.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| linear.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/string/char_traits.hpp``
|
||||
| Convenience header: ``sprout/string.hpp``
|
||||
|
40
docs/_sources/libs/string/char_traits/copy.txt
Normal file
40
docs/_sources/libs/string/char_traits/copy.txt
Normal file
|
@ -0,0 +1,40 @@
|
|||
.. _sprout-string-char_traits-copy:
|
||||
###############################################################################
|
||||
copy
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
static char_type* copy(char_type* s1, char_type const* s2, std::size_t n);
|
||||
|
||||
Effects
|
||||
========================================
|
||||
|
||||
| Equivalent to ``std::char_traits<Char>::copy(s1, s2, n)``.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/string.hpp>
|
||||
#include <sprout/assert.hpp>
|
||||
using namespace sprout;
|
||||
|
||||
char x[] = "homuhomu";
|
||||
SPROUT_STATIC_CONSTEXPR char const* y = "madocchi";
|
||||
char_traits<char>::copy(x, y, 8);
|
||||
SPROUT_ASSERT_MSG(x[0] == y[0], "y is copied to x.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| linear.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/string/char_traits.hpp``
|
||||
| Convenience header: ``sprout/string.hpp``
|
||||
|
|
@ -12,6 +12,9 @@ char_traits
|
|||
compare
|
||||
length
|
||||
find
|
||||
move
|
||||
copy
|
||||
assign-string
|
||||
|
||||
Interface
|
||||
========================================
|
||||
|
|
40
docs/_sources/libs/string/char_traits/move.txt
Normal file
40
docs/_sources/libs/string/char_traits/move.txt
Normal file
|
@ -0,0 +1,40 @@
|
|||
.. _sprout-string-char_traits-move:
|
||||
###############################################################################
|
||||
move
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
static char_type* move(char_type* s1, char_type const* s2, std::size_t n);
|
||||
|
||||
Effects
|
||||
========================================
|
||||
|
||||
| Equivalent to ``std::char_traits<Char>::move(s1, s2, n)``.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/string.hpp>
|
||||
#include <sprout/assert.hpp>
|
||||
using namespace sprout;
|
||||
|
||||
char x[] = "homuhomu";
|
||||
SPROUT_STATIC_CONSTEXPR char const* y = "madocchi";
|
||||
char_traits<char>::move(x, y, 8);
|
||||
SPROUT_ASSERT_MSG(x[0] == y[0], "y is copied to x.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| linear.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/string/char_traits.hpp``
|
||||
| Convenience header: ``sprout/string.hpp``
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue