7 #ifndef _MIMETIC_BODY_H_
8 #define _MIMETIC_BODY_H_
11 #include <mimetic/rfc822/body.h>
12 #include <mimetic/codec/code.h>
13 #include <mimetic/mimeentitylist.h>
14 #include <mimetic/os/file.h>
30 void set(
const std::string&);
35 bool load(
const std::string&);
40 template<
typename Codec>
41 bool load(
const std::string&,
const Codec&);
46 template<
typename Codec>
47 bool code(
const Codec&);
94 std::string m_preamble, m_epilogue;
97 template<
typename Codec>
104 File::iterator beg = in.begin(), end = in.end();
107 if(codec.codeSizeMultiplier() > 1.0)
111 if(::stat(fqn.c_str(), &st))
113 reserve((size_type)(::ceil(st.st_size * codec.codeSizeMultiplier())));
117 mimetic::code(beg, end, codec, back_inserter(*
this) );
122 template<
typename Codec>
129 if(codec.codeSizeMultiplier() > 1.0)
130 coded.reserve((size_type)::ceil(size() * codec.codeSizeMultiplier()));
132 mimetic::code(begin(), end(), codec, back_inserter(coded) );