mime.h
Go to the documentation of this file.
#ifndef WIBBLE_NET_MIME_H
#define WIBBLE_NET_MIME_H
/*
* net/mime - MIME utilities
*
* Copyright (C) 2010 Enrico Zini <enrico@enricozini.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string>
#include <map>
#include <wibble/regexp.h>
#include <iosfwd>
namespace wibble {
namespace net {
namespace mime {
struct Reader
{
wibble::ERegexp header_splitter;
Reader();
bool read_line(int sock, std::string& res);
bool read_headers(int sock, std::map<std::string, std::string>& headers);
bool read_until_boundary(int sock, const std::string& boundary, std::ostream& out, size_t max=0);
bool discard_until_boundary(int sock, const std::string& boundary);
bool readboundarytail(int sock);
};
}
}
}
// vim:set ts=4 sw=4:
#endif
wibble::net::mime::Reader::read_headers
bool read_headers(int sock, std::map< std::string, std::string > &headers)
Read MIME headers.
Definition: mime.cpp:68
wibble::net::mime::Reader::header_splitter
wibble::ERegexp header_splitter
Definition: mime.h:35
wibble::net::mime::Reader::readboundarytail
bool readboundarytail(int sock)
Skip until the end of the boundary line.
Definition: mime.cpp:125
wibble::ERegexp
Definition: regexp.h:82
wibble::net::mime::Reader::Reader
Reader()
Definition: mime.cpp:32
wibble::net::mime::Reader::read_line
bool read_line(int sock, std::string &res)
Read a line from the file descriptor.
Definition: mime.cpp:37
wibble::net::mime::Reader::discard_until_boundary
bool discard_until_boundary(int sock, const std::string &boundary)
Read until boundary is found, sending data to the given ostream.
Definition: mime.cpp:192
regexp.h
wibble
Definition: amorph.h:17
wibble::net::mime::Reader
Definition: mime.h:33
wibble::net::mime::Reader::read_until_boundary
bool read_until_boundary(int sock, const std::string &boundary, std::ostream &out, size_t max=0)
Read until boundary is found, sending data to the given ostream.
Definition: mime.cpp:159