No Description

NSData+YLData.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // NSData+YLData.h
  3. // YoungCatogory
  4. //
  5. // Created by kuxuan on 2017/7/14.
  6. // Copyright © 2017年 kuxuan. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface NSData (YLData)
  10. /**
  11. * Convert the given NSData to UTF8 NSString
  12. *
  13. * @param data The NSData to be converted
  14. *
  15. * @return Returns the converted NSData as UTF8 NSString
  16. */
  17. + (NSString * _Nonnull)convertToUTF8String:(NSData * _Nonnull)data;
  18. /**
  19. * Convert self to a UTF8 NSString
  20. *
  21. * @return Returns self as UTF8 NSString
  22. */
  23. - (NSString * _Nonnull)convertToUTF8String;
  24. /**
  25. * Convert the given NSData to ASCII NSString
  26. *
  27. * @param data The NSData to be converted
  28. *
  29. * @return Returns the converted NSData as ASCII NSString
  30. */
  31. + (NSString * _Nonnull)convertToASCIIString:(NSData * _Nonnull)data;
  32. /**
  33. * Convert self to a ASCII NSString
  34. *
  35. * @return Returns self as ASCII NSString
  36. */
  37. - (NSString * _Nonnull)convertToASCIIString;
  38. /**
  39. * Convert self UUID to NSString.
  40. * Useful for push notifications
  41. *
  42. * @return Returns self as NSString from UUID
  43. */
  44. - (NSString * _Nullable)convertUUIDToString;
  45. @end