stringManipulation.h 874 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. namespace pika
  5. {
  6. //todo overengineer with restrict and stuff
  7. //dest can be also source
  8. void removeCharacters(char *dest, const char *source, const char *charsToRemove, size_t destSize);
  9. //dest can be also source
  10. void toLower(char *dest, const char *source, size_t size);
  11. //dest can be also source
  12. void toUpper(char *dest, const char *source, size_t size);
  13. //checks if char is in source
  14. bool findChar(const char *source, char c);
  15. //returns char coppied (will be at max size-1)
  16. size_t strlcpy(char *dst, const char *src, size_t size);
  17. size_t strlcpy(char *dst, const std::string &src, size_t size);
  18. //template<size_t N>
  19. //inline size_t strlcpy(char *dst, pika::StaticString<N> &s)
  20. //{
  21. // return strlcpy(dst, s.data(), s.size());
  22. //}
  23. std::vector<std::string> split(const char *source, char c);
  24. }