/usr/include/strigi/mailinputstream.h is in libstreams-dev 0.7.8-1.2+b2.
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 | /* This file is part of Strigi Desktop Search
*
* Copyright (C) 2006 Jos van den Oever <jos@vandenoever.info>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef STRIGI_MAILINPUTSTREAM_H
#define STRIGI_MAILINPUTSTREAM_H
#include <strigi/streambase.h>
#include <strigi/substreamprovider.h>
#include <stack>
namespace Strigi {
class StringTerminatedSubStream;
/**
* This is an implementation for handling email streams as
* archives. It allows one to read the email body and email attachements as
* streams.
**/
class STREAMS_EXPORT MailInputStream : public SubStreamProvider {
private:
class Private;
int64_t old1;
// variables that record the current read state
int32_t old2;
int old3;
const char* old4;
const char* old5;
Private* const p;
std::string m_subject;
std::string m_from;
std::string m_to;
std::string m_cc;
std::string m_bcc;
std::string m_messageid;
std::string m_inreplyto;
std::string m_references;
std::string m_contenttype;
std::string old6;
std::string old7;
std::stack<std::string> old8;
void readHeaderLine();
void readHeader();
void scanBody();
void handleHeaderLine();
bool handleBodyLine();
bool lineIsEndOfBlock();
bool checkHeaderLine() const;
void clearHeaders();
void ensureFileName();
std::string value(const char* n, const std::string& headerline) const;
public:
explicit MailInputStream(InputStream* input);
~MailInputStream();
InputStream* nextEntry();
static bool checkHeader(const char* data, int32_t datasize);
static SubStreamProvider* factory(InputStream* input) {
return new MailInputStream(input);
}
const std::string& subject() { return m_subject; }
const std::string& from() { return m_from; }
const std::string& to() { return m_to; }
const std::string& cc() { return m_cc; }
const std::string& bcc() { return m_bcc; }
const std::string& messageid() { return m_messageid; }
const std::string& inreplyto() { return m_inreplyto; }
const std::string& references() { return m_references; }
const std::string& contentType() { return m_contenttype; }
};
} // end namespace Strigi
#endif
|