strutil.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #include <functional>
  11. /////////////////////////////////////////////////////////////////////////////
  12. // strutil.h - Declarations:
  13. std::string & strucase(std::string &s);
  14. std::string strucase(std::string s);
  15. std::string strucase(const char *ps);
  16. std::string & strlcase(std::string &s);
  17. std::string strlcase(std::string s);
  18. std::string strlcase(const char *ps);
  19. std::string & ltrim(std::string &s);
  20. std::string & ltrim(std::string &s, const char *sep);
  21. std::string & rtrim(std::string &s);
  22. std::string & rtrim(std::string &s, const char *sep);
  23. std::string & trim(std::string &s);
  24. std::string & trim(std::string &s, const char *sep);
  25. std::string trim(const std::string &s);
  26. std::string trim(const std::string &s, const char *sep);
  27. int strsplit(const std::string &str, const char *sep, std::vector<std::string> &vec);
  28. std::string strFormatByteSize(uint64_t s, unsigned int dec = 1);
  29. std::string formatString(const char *fmt, ...);
  30. bool readFile(const char *pszFilePath, std::string &str);
  31. bool writeFile(const char *pszFilePath, const std::string &str);
  32. /////////////////////////////////////////////////////////////////////////////
  33. #endif // __cplusplus
  34. #endif // !defined(AGD_STRUTIL_H__63CB60B8_AF48_4ACA_BCB7_188E70BB5286__INCLUDED_)