alstring.h 715 B

123456789101112131415161718192021222324252627282930
  1. #ifndef AL_STRING_H
  2. #define AL_STRING_H
  3. #include <cstddef>
  4. #include <cstring>
  5. #include <string>
  6. #include "almalloc.h"
  7. namespace al {
  8. template<typename T, typename Tr=std::char_traits<T>>
  9. using basic_string = std::basic_string<T, Tr, al::allocator<T>>;
  10. using string = basic_string<char>;
  11. using wstring = basic_string<wchar_t>;
  12. using u16string = basic_string<char16_t>;
  13. using u32string = basic_string<char32_t>;
  14. /* These would be better served by using a string_view-like span/view with
  15. * case-insensitive char traits.
  16. */
  17. int strcasecmp(const char *str0, const char *str1) noexcept;
  18. int strncasecmp(const char *str0, const char *str1, std::size_t len) noexcept;
  19. } // namespace al
  20. #endif /* AL_STRING_H */