MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / attachmentWithData

Method attachmentWithData

src/core/rfc822/MCAttachment.cpp:166–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166Attachment * Attachment::attachmentWithData(String * filename, Data * data)
167{
168 Attachment * attachment;
169 String * mimeType;
170
171 attachment = new Attachment();
172 mimeType = Attachment::mimeTypeForFilename(filename);
173 if (mimeType != NULL) {
174 attachment->setMimeType(mimeType);
175 }
176 if (filename != NULL) {
177 attachment->setFilename(filename->lastPathComponent());
178 }
179 attachment->setData(data);
180
181 return (Attachment *) attachment->autorelease();
182}
183
184Attachment * Attachment::attachmentWithHTMLString(String * htmlString)
185{

Callers

nothing calls this directly

Calls 5

lastPathComponentMethod · 0.80
setMimeTypeMethod · 0.45
setFilenameMethod · 0.45
setDataMethod · 0.45
autoreleaseMethod · 0.45

Tested by

no test coverage detected