strutil.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // strutil.h :
  2. //
  3. #if !defined(AGD_STRUTIL_H__63CB60B8_AF48_4ACA_BCB7_188E70BB5286__INCLUDED_)
  4. #define AGD_STRUTIL_H__63CB60B8_AF48_4ACA_BCB7_188E70BB5286__INCLUDED_
  5. #ifdef __cplusplus
  6. #include <stdint.h>
  7. #include <string>
  8. #include <vector>
  9. #include <regex>
  10. /////////////////////////////////////////////////////////////////////////////
  11. // strutil.h - Declarations:
  12. std::string & strucase(std::string &s);
  13. std::string strucase(std::string s);
  14. std::string strucase(const char *ps);
  15. std::string & strlcase(std::string &s);
  16. std::string strlcase(std::string s);
  17. std::string strlcase(const char *ps);
  18. std::string & ltrim(std::string &s);
  19. std::string & ltrim(std::string &s, const char *sep);
  20. std::string & rtrim(std::string &s);
  21. std::string & rtrim(std::string &s, const char *sep);
  22. std::string & trim(std::string &s);
  23. std::string & trim(std::string &s, const char *sep);
  24. std::string trim(const std::string &s);
  25. std::string trim(const std::string &s, const char *sep);
  26. int strsplit(const std::string &str, const char *sep, std::vector<std::string> &vec);
  27. std::string strFormatByteSize(uint64_t s, unsigned int dec = 1);
  28. std::string formatString(const char *fmt, ...);
  29. /////////////////////////////////////////////////////////////////////////////
  30. #endif // __cplusplus
  31. #endif // !defined(AGD_STRUTIL_H__63CB60B8_AF48_4ACA_BCB7_188E70BB5286__INCLUDED_)