Mercurial > thymian
comparison 3rdparty/vmime/src/vmime/fileContentHandler.cpp @ 0:a4671277546c tip
created the repository for the thymian project
| author | ferencd |
|---|---|
| date | Tue, 17 Aug 2021 11:19:54 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:a4671277546c |
|---|---|
| 1 // | |
| 2 // VMime library (http://www.vmime.org) | |
| 3 // Copyright (C) 2002-2013 Vincent Richard <vincent@vmime.org> | |
| 4 // | |
| 5 // This program is free software; you can redistribute it and/or | |
| 6 // modify it under the terms of the GNU General Public License as | |
| 7 // published by the Free Software Foundation; either version 3 of | |
| 8 // the License, or (at your option) any later version. | |
| 9 // | |
| 10 // This program is distributed in the hope that it will be useful, | |
| 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 // General Public License for more details. | |
| 14 // | |
| 15 // You should have received a copy of the GNU General Public License along | |
| 16 // with this program; if not, write to the Free Software Foundation, Inc., | |
| 17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 18 // | |
| 19 // Linking this library statically or dynamically with other modules is making | |
| 20 // a combined work based on this library. Thus, the terms and conditions of | |
| 21 // the GNU General Public License cover the whole combination. | |
| 22 // | |
| 23 | |
| 24 #include "vmime/fileContentHandler.hpp" | |
| 25 | |
| 26 | |
| 27 namespace vmime | |
| 28 { | |
| 29 | |
| 30 | |
| 31 fileContentHandler::fileContentHandler() | |
| 32 : streamContentHandler() | |
| 33 { | |
| 34 } | |
| 35 | |
| 36 | |
| 37 fileContentHandler::fileContentHandler | |
| 38 (shared_ptr <utility::file> file, const vmime::encoding& enc) | |
| 39 { | |
| 40 setData(file, enc); | |
| 41 } | |
| 42 | |
| 43 | |
| 44 fileContentHandler::~fileContentHandler() | |
| 45 { | |
| 46 } | |
| 47 | |
| 48 | |
| 49 fileContentHandler::fileContentHandler(const fileContentHandler& cts) | |
| 50 : streamContentHandler() | |
| 51 { | |
| 52 setData(cts.m_file, cts.m_encoding); | |
| 53 } | |
| 54 | |
| 55 | |
| 56 fileContentHandler& fileContentHandler::operator=(const fileContentHandler& cts) | |
| 57 { | |
| 58 setData(cts.m_file, cts.m_encoding); | |
| 59 | |
| 60 return *this; | |
| 61 } | |
| 62 | |
| 63 | |
| 64 shared_ptr <contentHandler> fileContentHandler::clone() const | |
| 65 { | |
| 66 return make_shared <fileContentHandler>(*this); | |
| 67 } | |
| 68 | |
| 69 | |
| 70 void fileContentHandler::setData | |
| 71 (shared_ptr <utility::file> file, const vmime::encoding& enc) | |
| 72 { | |
| 73 m_file = file; | |
| 74 m_encoding = enc; | |
| 75 | |
| 76 streamContentHandler::setData | |
| 77 (file->getFileReader()->getInputStream(), file->getLength(), enc); | |
| 78 } | |
| 79 | |
| 80 | |
| 81 } // vmime |
