• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE Support
  • Sitemap
  • Contact Us
 

strigi/src/streams

mailinputstream.h

Go to the documentation of this file.
00001 /* This file is part of Strigi Desktop Search
00002  *
00003  * Copyright (C) 2006 Jos van den Oever <jos@vandenoever.info>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 #ifndef STRIGI_MAILINPUTSTREAM_H
00021 #define STRIGI_MAILINPUTSTREAM_H
00022 
00023 #include <strigi/strigiconfig.h>
00024 #include "streambase.h"
00025 #include "substreamprovider.h"
00026 #include <stack>
00027 
00028 namespace Strigi {
00029 
00030 class StringTerminatedSubStream;
00031 
00037 class STREAMS_EXPORT MailInputStream : public SubStreamProvider {
00038 private:
00039     class Private;
00040     int64_t old1;
00041     // variables that record the current read state
00042     int32_t old2;
00043     int old3;
00044     const char* old4;
00045     const char* old5;
00046 
00047     Private* const p;
00048     std::string m_subject;
00049     std::string m_from;
00050     std::string m_to;
00051     std::string m_cc;
00052     std::string m_bcc;
00053     std::string m_messageid;
00054     std::string m_inreplyto;
00055     std::string m_references;
00056     std::string m_contenttype;
00057     std::string old6;
00058     std::string old7;
00059 
00060     std::stack<std::string> old8;
00061 
00062     void readHeaderLine();
00063     void readHeader();
00064     void scanBody();
00065     void handleHeaderLine();
00066     bool handleBodyLine();
00067     bool lineIsEndOfBlock();
00068     bool checkHeaderLine() const;
00069     void clearHeaders();
00070     void ensureFileName();
00071     std::string value(const char* n, const std::string& headerline) const;
00072 public:
00073     explicit MailInputStream(InputStream* input);
00074     ~MailInputStream();
00075     InputStream* nextEntry();
00076     static bool checkHeader(const char* data, int32_t datasize);
00077     static SubStreamProvider* factory(InputStream* input) {
00078         return new MailInputStream(input);
00079     }
00080     const std::string& subject() { return m_subject; }
00081     const std::string& from() { return m_from; }
00082     const std::string& to() { return m_to; }
00083     const std::string& cc() { return m_cc; }
00084     const std::string& bcc() { return m_bcc; }
00085     const std::string& messageid() { return m_messageid; }
00086     const std::string& inreplyto() { return m_inreplyto; }
00087     const std::string& references() { return m_references; }
00088     const std::string& contentType() { return m_contenttype; }
00089 };
00090 
00091 } // end namespace Strigi
00092 
00093 #endif

strigi/src/streams

Skip menu "strigi/src/streams"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDE Support

Skip menu "KDE Support"
  • akonadi
  • Decibel
  • grantlee
  • kdewin
  • phonon
  •     Backend
  • polkit-qt
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for KDE Support by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal