MCPcopy Create free account
hub / github.com/acl-dev/acl / save_to

Method save_to

lib_acl_cpp/src/smtp/mail_attach.cpp:63–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool mail_attach::save_to(mime_code* coder, string& out) {
64 if (coder) {
65 build_header(coder->get_encoding_type(), out);
66 } else {
67 build_header(NULL, out);
68 }
69
70 string buf;
71 if (!ifstream::load(filepath_.c_str(), &buf)) {
72 logger_error("load %s error %s",
73 filepath_.c_str(), last_serror());
74 return false;
75 }
76
77 if (coder) {
78 coder->reset();
79 coder->encode_update(buf.c_str(), (int) buf.size(), &out);
80 coder->encode_finish(&out);
81 } else {
82 out.append(buf);
83 }
84
85 return true;
86}
87
88bool mail_attach::save_to(mime_code* coder, ostream& out) {
89 string header;

Callers

nothing calls this directly

Calls 13

last_serrorFunction · 0.50
c_strMethod · 0.45
resetMethod · 0.45
encode_updateMethod · 0.45
sizeMethod · 0.45
encode_finishMethod · 0.45
appendMethod · 0.45
writeMethod · 0.45
open_readMethod · 0.45
eofMethod · 0.45
readMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected