NIMFileObject.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // NIMFileObject.h
  3. // NIMLib
  4. //
  5. // Created by Netease.
  6. // Copyright (c) 2015年 Netease. All rights reserved.
  7. //
  8. #import "NIMMessageObjectProtocol.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * 文件的实例对象
  12. */
  13. @interface NIMFileObject : NSObject<NIMMessageObject>
  14. /**
  15. * 文件对象初始化方法(根据文件路径)
  16. *
  17. * @param sourcePath 文件路径
  18. *
  19. * @return 文件实例对象
  20. */
  21. - (instancetype)initWithSourcePath:(NSString *)sourcePath;
  22. /**
  23. * 文件对象初始化方法(根据文件数据)
  24. *
  25. * @param data 文件数据
  26. * @param extension 文件拓展名
  27. * @return 文件实例对象
  28. */
  29. - (instancetype)initWithData:(NSData*)data extension:(NSString*)extension;
  30. /**
  31. * 文件对象初始化方法(根据文件路径)
  32. *
  33. * @param sourcePath 文件路径
  34. * @param scene 场景类别
  35. *
  36. * @return 文件实例对象
  37. */
  38. - (instancetype)initWithSourcePath:(NSString *)sourcePath scene:(NSString *)scene;
  39. /**
  40. * 文件对象初始化方法(根据文件数据)
  41. *
  42. * @param data 文件数据
  43. * @param extension 文件拓展名
  44. * @param scene 场景类别
  45. * @return 文件实例对象
  46. */
  47. - (instancetype)initWithData:(NSData*)data extension:(NSString*)extension scene:(NSString *)scene;
  48. /**
  49. * 文件显示名
  50. */
  51. @property (nullable, nonatomic, copy) NSString *displayName;
  52. /**
  53. * 文件的本地路径
  54. */
  55. @property (nullable ,nonatomic, copy, readonly) NSString *path;
  56. /**
  57. * 文件的远程路径
  58. */
  59. @property (nullable,nonatomic, copy, readonly) NSString *url;
  60. /**
  61. * 文件MD5
  62. */
  63. @property (nullable,nonatomic, copy, readonly) NSString *md5;
  64. /**
  65. * 文件大小
  66. */
  67. @property (nonatomic, assign, readonly) long long fileLength;
  68. @end
  69. NS_ASSUME_NONNULL_END