Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/herumi/mie
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/herumi/mie
- Owner: herumi
- License: other
- Created: 2012-08-21T01:51:48.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-07-01T08:06:31.000Z (over 6 years ago)
- Last Synced: 2024-05-09T07:32:13.173Z (6 months ago)
- Language: C++
- Size: 587 KB
- Stars: 11
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme-string.md
Awesome Lists containing this project
README
# C++ header library
## Abstract
collection of C++ header library
# fast string library with SSE4.2
* include/mie/string.hpp ; fast strstr, findStr and other functions with SSE4.2
>Note: These codes requires Xbyak(https://github.com/herumi/xbyak) and "-fno-operator-names" option is required on gcc to avoid analyzing "and", "or", etc. as operators.
## Functions
All funcionts are declared within a namespace mie. All functions may access max 16 bytes beyond end of text.
/*
fast strstr
*/
const char *strstr(const char *str, const char *key);/*
strstr(case insensitive version)
@note key must not have capital characters [A-Z]
*/
const char *strcasestr(const char *str, const char *key);/*
find key[0] or key[1], ... in str
@note strlen(key) <= 16, key[i] != 0
@note almost same as strbpk excluding restriction with key size
*/
const char *strchr_any(const char *str, const char *key);/*
find c such that key[0] <= c && c <= key[1], key[2] <= c && c <= key[3], ... in str
@note strlen(key) <= 16, key[i] != 0
@note strchr_range(str, "az09") means to find string with a regular expression [a-z0-9] in str
*/
const char *strchr_range(const char *str, const char *key);/*
find c in [begin, end)
if c is not found then return end
*/
const char *findChar(const char *begin, const char *end, char c);/*
find any of key[0..keySize - 1] in [begin, end)
if char is not found then return end
@note keySize <= 16
*/
const char *findChar_any(const char *begin, const char *end, const char *key, size_t keySize);/*
find character in range [key[0]..key[1]], [key[2]..key[3]], ... in [begin, end)
if char is not found then return end
@note keySize <= 16
*/
const char *findChar_range(const char *begin, const char *end, const char *key, size_t keySize);/*
find [key, key + keySize) in [begin, end)
*/
const char *findStr(const char*begin, const char *end, const char *key, size_t keySize);/*
case insensitive find [key, key + keySize) in [begin, end)
@note key must not have capital characters [A-Z]
*/
const char *findCaseStr(const char*begin, const char *end, const char *key, size_t keySize);## Reference
* http://slideshare.com/herumi/x86opti3
* http://www.ustream.tv/recorded/21484472 (Japanese)## License
modified new BSD License (http://opensource.org/licenses/BSD-3-Clause)
## Author
MITSUNARI Shigeo
* mail:[email protected]
* twitter:@herumi
* facebook:https://www.facebook.com/mitsunari.shigeo