/usr/include/mimetic/mimeentity.h is in libmimetic-dev 0.9.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | /***************************************************************************
copyright : (C) 2002-2008 by Stefano Barbato
email : stefano@codesink.org
$Id: mimeentity.h,v 1.29 2008-10-07 11:06:25 tat Exp $
***************************************************************************/
#ifndef _MIMETIC_MIMEENTITY_H_
#define _MIMETIC_MIMEENTITY_H_
#include <string>
#include <iostream>
#include <streambuf>
#include <fstream>
#include <iterator>
#include <algorithm>
#include <mimetic/strutils.h>
#include <mimetic/utils.h>
#include <mimetic/contenttype.h>
#include <mimetic/contenttransferencoding.h>
#include <mimetic/contentdisposition.h>
#include <mimetic/mimeversion.h>
#include <mimetic/mimeentitylist.h>
#include <mimetic/codec/codec.h>
#include <mimetic/os/file.h>
#include <mimetic/header.h>
#include <mimetic/body.h>
#include <mimetic/parser/itparserdecl.h>
#include <mimetic/streambufs.h>
namespace mimetic
{
class MimeEntity;
/// Represent a MIME entity
class MimeEntity
{
friend class Body;
friend class MimeEntityLoader;
typedef std::list<std::string> BoundaryList;
typedef unsigned long int size_type;
public:
/**
* Blank MIME entity
*/
MimeEntity();
/**
* Parse [beg, end] and build entity based on content
*/
template<typename Iterator>
MimeEntity(Iterator beg, Iterator end, int mask = imNone);
/**
* Parse istream and build entity based on content
*/
MimeEntity(std::istream&);
virtual ~MimeEntity();
/**
* copy text rapresentation of the MimeEntity to the output iterator
*/
template<typename OutputIt>
size_type copy(OutputIt out);
Header& header();
const Header& header() const;
Body& body();
const Body& body() const;
/**
* single step load functions: parse the input provided and build the
* entity
*
* use load(..., mask) to ignore some part of the message when it's
* not needed saving memory space and execution time
*/
template<typename Iterator>
void load(Iterator, Iterator, int mask = imNone);
void load(std::istream&, int mask = imNone);
/**
* helper functions: return header().hasField(str)
*/
bool hasField(const std::string&) const;
/**
* returns entity size
* Note: this function is slow, use it if you really need
*/
size_type size() const;
friend std::ostream& operator<<(std::ostream&, const MimeEntity&);
protected:
void commonInit();
virtual std::ostream& write(std::ostream&, const char* eol = 0) const;
protected:
Header m_header;
Body m_body;
size_type m_lines;
size_type m_size;
private:
//MimeEntity(const MimeEntity&);
//MimeEntity& operator=(const MimeEntity&);
};
template<typename Iterator>
MimeEntity::MimeEntity(Iterator bit, Iterator eit, int mask)
{
commonInit();
load(bit, eit, mask);
}
template<typename Iterator>
void MimeEntity::load(Iterator bit, Iterator eit, int mask)
{
IteratorParser<Iterator,
typename std::iterator_traits<Iterator>::iterator_category> prs(*this);
prs.iMask(mask);
prs.run(bit, eit);
}
template<typename OutputIt>
MimeEntity::size_type MimeEntity::copy(OutputIt out)
{
passthrough_streambuf<OutputIt> psb(out);
std::ostream os(&psb);
os << *this;
return psb.size();
}
}
#endif
|