|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
MSTL内存操作函数 更多...
#include "MSTL/core/typeinfo/type_traits.hpp"函数 | |
| MSTL_CONSTEXPR14 void * | memory_copy (void *MSTL_RESTRICT dest, const void *MSTL_RESTRICT src, size_t count) noexcept |
| 从源内存复制到目标内存 | |
| template<typename T> | |
| MSTL_CONSTEXPR14 void * | memory_copy (T *MSTL_RESTRICT dest, const T *MSTL_RESTRICT src) noexcept |
| 从源内存复制到目标内存 | |
| MSTL_CONSTEXPR14 void * | memory_copy_offset (void *MSTL_RESTRICT dest, const void *MSTL_RESTRICT src, size_t count) noexcept |
| 从源内存复制到目标内存并返回复制结束位置 | |
| MSTL_CONSTEXPR14 void * | memory_copy_until (void *dest, const void *src, const byte_t value, size_t count) noexcept |
| 从源内存复制到目标内存,直到遇到特定字节 | |
| MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 int | memory_compare (const void *lhs, const void *rhs, size_t count) noexcept |
| 比较两个内存区域的内容 | |
| template<typename T> | |
| MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 int | memory_compare (const T &lhs, const T &rhs) noexcept |
| 比较两个内存区域的内容 | |
| MSTL_CONSTEXPR14 void * | memory_move (void *dest, const void *src, size_t count) noexcept |
| 从源内存移动数据到目标内存 | |
| MSTL_CONSTEXPR14 void * | memory_set (void *dest, const byte_t value, size_t count) noexcept |
| 使用指定字节填充内存区域 | |
| MSTL_CONSTEXPR14 void | memory_zero (void *dest, const size_t count) noexcept |
| 将内存区域清零 | |
| template<typename T> | |
| MSTL_CONSTEXPR14 void | memory_zero (T *dest) noexcept |
| 将内存区域清零 | |
| MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 const void * | memory_find (const void *dest, const byte_t value, size_t count) noexcept |
| 在内存中搜索特定字节 | |
| MSTL_CONSTEXPR14 const void * | memory_find_pattern (const void *data, const size_t data_len, const void *pattern, const size_t pattern_len) noexcept |
| 在内存中搜索子模式 | |
| template<typename To, typename From> | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 To | memory_cast (const From &value) noexcept |
| 执行内存层的类型转换 | |
| template<typename CharT> | |
| MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 CharT | to_lowercase (const CharT c) noexcept |
| 将字符转换为小写 | |
| template<typename CharT> | |
| MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 CharT | to_uppercase (const CharT c) noexcept |
| 将字符转换为大写 | |
| template<typename CharT> | |
| constexpr CharT * | string_copy (CharT *MSTL_RESTRICT dest, const CharT *MSTL_RESTRICT src) noexcept |
| 复制字符串 | |
| template<typename CharT> | |
| constexpr CharT * | string_copy (CharT *MSTL_RESTRICT dest, const CharT *MSTL_RESTRICT src, const size_t count) noexcept |
| 复制指定长度的字符串 | |
| template<typename CharT> | |
| constexpr CharT * | string_copy_offset (CharT *MSTL_RESTRICT dest, const CharT *MSTL_RESTRICT src) noexcept |
| 复制字符串并返回指向结尾的指针 | |
| template<typename CharT> | |
| constexpr CharT * | string_copy_offset (CharT *MSTL_RESTRICT dest, const CharT *MSTL_RESTRICT src, const size_t count) noexcept |
| 复制指定长度的字符串并返回指向结尾的指针 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr int | string_compare (const CharT *dest, const CharT *src) noexcept |
| 比较两个字符串 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr int | string_compare (const CharT *dest, const CharT *src, const size_t count) noexcept |
| 比较两个字符串的前n个字符 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr int | string_compare_ignore_case (const CharT *s1, const CharT *s2) |
| 忽略大小写比较两个字符串 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr int | string_compare_ignore_case (const CharT *s1, const CharT *s2, const size_t count) noexcept |
| 忽略大小写比较两个字符串的前n个字符 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr size_t | string_length (const CharT *str) noexcept |
| 计算字符串长度 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr size_t | string_length (const CharT *str, const size_t max_len) noexcept |
| 计算字符串的最大长度 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr const CharT * | string_find (const CharT *str, const CharT chr) noexcept |
| 查找字符在字符串中首次出现的位置 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr const CharT * | string_find (const CharT *str, const CharT chr, const size_t count) noexcept |
| 在前n个字符中查找字符首次出现的位置 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr const CharT * | string_find_last (const CharT *str, const CharT chr) noexcept |
| 查找字符在字符串中最后出现的位置 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr CharT * | string_find_any (CharT *str, const CharT *accept) noexcept |
| 查找字符串中第一个出现在指定字符集中的字符 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr const CharT * | string_find_pattern (const CharT *dest, const CharT *src) noexcept |
| 查找子字符串在字符串中首次出现的位置 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr const CharT * | string_find_pattern_ignored_case (const CharT *dest, const CharT *src) noexcept |
| 忽略大小写查找子字符串在字符串中首次出现的位置 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr size_t | string_span_in (const CharT *str, const CharT *accept) noexcept |
| 计算字符串开头包含在指定字符集中的字符数 | |
| template<typename CharT> | |
| MSTL_PURE_FUNCTION constexpr size_t | string_span_not_in (const CharT *str, const CharT *reject) noexcept |
| 计算字符串开头不包含在指定字符集中的字符数 | |
| template<typename CharT> | |
| constexpr CharT * | string_set (CharT *str, const CharT value) noexcept |
| 将字符串中的所有字符设置为指定值 | |
| template<typename CharT> | |
| constexpr CharT * | string_set (CharT *str, const CharT value, const size_t count) noexcept |
| 将字符串中的前n个字符设置为指定值 | |
| template<typename CharT> | |
| constexpr CharT * | string_reverse (CharT *str) noexcept |
| 反转字符串 | |
| template<typename CharT> | |
| constexpr CharT * | string_concatenate (CharT *MSTL_RESTRICT dest, const CharT *MSTL_RESTRICT src) noexcept |
| 连接两个字符串 | |
| template<typename CharT> | |
| constexpr CharT * | string_concatenate (CharT *MSTL_RESTRICT dest, const CharT *MSTL_RESTRICT src, const size_t count) noexcept |
| 连接源字符串的前n个字符到目标字符串 | |
MSTL内存操作函数
此文件提供了低级别内存操作函数的实现,包括内存拷贝、移动、比较、填充等操作。 这些函数类似于标准C库的memory函数,但提供constexpr支持和其他增强功能。
在文件 memory.hpp 中定义.