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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <libnfc_cpptools/Result.h>
  8. namespace LibNfc
  9. {
  10. namespace Utils
  11. {
  12. class StringUtils
  13. {
  14. public:
  15. static const std::string hex;
  16. static std::string rawToHuman(uint8_t c);
  17. static std::string rawToHuman(int8_t c);
  18. static std::string rawToHuman(uint16_t c);
  19. static std::string rawToHuman(int16_t c);
  20. static std::string rawToHuman(uint32_t c);
  21. static std::string rawToHuman(int32_t c);
  22. static std::string rawToHuman(uint64_t c);
  23. static std::string rawToHuman(int64_t c);
  24. static std::string rawToHuman(const std::string& raw);
  25. static ResultString humanToRaw(const std::string& human);
  26. static std::string toLower(const std::string& str);
  27. static char toLower(char c);
  28. static std::string toUpper(const std::string& str);
  29. static char toUpper(char c);
  30. static std::string ensureSize(const std::string& data, int size);
  31. static std::string ltrim(const std::string& s);
  32. static std::string rtrim(const std::string& s);
  33. static std::string trim(const std::string& s);
  34. static std::string removeSpaces(const std::string& s);
  35. };
  36. }; // Utils
  37. }; // LibNfc
  38. #endif //MIFARE_TOOLS_HEX_H