comparison Core/FileStorage/FileInfo.h @ 693:01d8611c4a60

md5 for attached files
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Feb 2014 17:52:51 +0100
parents 2d0a347e8cfc
children 6e7e5ed91c2d
comparison
equal deleted inserted replaced
692:1a3f9d90a2dd 693:01d8611c4a60
41 struct FileInfo 41 struct FileInfo
42 { 42 {
43 private: 43 private:
44 std::string uuid_; 44 std::string uuid_;
45 FileContentType contentType_; 45 FileContentType contentType_;
46
46 uint64_t uncompressedSize_; 47 uint64_t uncompressedSize_;
48 std::string uncompressedMD5_;
49
47 CompressionType compressionType_; 50 CompressionType compressionType_;
48 uint64_t compressedSize_; 51 uint64_t compressedSize_;
52 std::string compressedMD5_;
49 53
50 public: 54 public:
51 FileInfo() 55 FileInfo()
52 { 56 {
53 } 57 }
55 /** 59 /**
56 * Constructor for an uncompressed attachment. 60 * Constructor for an uncompressed attachment.
57 **/ 61 **/
58 FileInfo(const std::string& uuid, 62 FileInfo(const std::string& uuid,
59 FileContentType contentType, 63 FileContentType contentType,
60 uint64_t size) : 64 uint64_t size,
65 const std::string& md5) :
61 uuid_(uuid), 66 uuid_(uuid),
62 contentType_(contentType), 67 contentType_(contentType),
63 uncompressedSize_(size), 68 uncompressedSize_(size),
69 uncompressedMD5_(md5),
64 compressionType_(CompressionType_None), 70 compressionType_(CompressionType_None),
65 compressedSize_(size) 71 compressedSize_(size),
72 compressedMD5_(md5)
66 { 73 {
67 } 74 }
68 75
69 /** 76 /**
70 * Constructor for a compressed attachment. 77 * Constructor for a compressed attachment.
71 **/ 78 **/
72 FileInfo(const std::string& uuid, 79 FileInfo(const std::string& uuid,
73 FileContentType contentType, 80 FileContentType contentType,
74 uint64_t uncompressedSize, 81 uint64_t uncompressedSize,
82 const std::string& uncompressedMD5,
75 CompressionType compressionType, 83 CompressionType compressionType,
76 uint64_t compressedSize) : 84 uint64_t compressedSize,
85 const std::string& compressedMD5) :
77 uuid_(uuid), 86 uuid_(uuid),
78 contentType_(contentType), 87 contentType_(contentType),
79 uncompressedSize_(uncompressedSize), 88 uncompressedSize_(uncompressedSize),
89 uncompressedMD5_(uncompressedMD5),
80 compressionType_(compressionType), 90 compressionType_(compressionType),
81 compressedSize_(compressedSize) 91 compressedSize_(compressedSize),
92 compressedMD5_(compressedMD5)
82 { 93 {
83 } 94 }
84 95
85 const std::string& GetUuid() const 96 const std::string& GetUuid() const
86 { 97 {
104 115
105 uint64_t GetCompressedSize() const 116 uint64_t GetCompressedSize() const
106 { 117 {
107 return compressedSize_; 118 return compressedSize_;
108 } 119 }
120
121 const std::string& GetCompressedMD5() const
122 {
123 return compressedMD5_;
124 }
125
126 const std::string& GetUncompressedMD5() const
127 {
128 return uncompressedMD5_;
129 }
109 }; 130 };
110 } 131 }