You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StringUtils.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // Created by robin on 6/20/16.
  3. //
  4. #ifndef MIFARE_TOOLS_HEX_H
  5. #define MIFARE_TOOLS_HEX_H
  6. #include <string>
  7. #include <DBO/Result.h>
  8. class StringUtils
  9. {
  10. public:
  11. static const std::string hex;
  12. static std::string rawToHuman(unsigned char c);
  13. static std::string rawToHuman(char c);
  14. static std::string rawToHuman(unsigned short c);
  15. static std::string rawToHuman(short c);
  16. static std::string rawToHuman(unsigned int c);
  17. static std::string rawToHuman(int c);
  18. static std::string rawToHuman(unsigned long c);
  19. static std::string rawToHuman(long c);
  20. static std::string rawToHuman(const std::string& raw);
  21. static ResultString humanToRaw(const std::string& human);
  22. static std::string toLower(const std::string& str);
  23. static char toLower(char c);
  24. static std::string toUpper(const std::string& str);
  25. static char toUpper(char c);
  26. static std::string ensureSize(const std::string& data, int size);
  27. static std::string ltrim(const std::string& s);
  28. static std::string rtrim(const std::string& s);
  29. static std::string trim(const std::string& s);
  30. static std::string removeSpaces(const std::string& s);
  31. };
  32. #endif //MIFARE_TOOLS_HEX_H