Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/backends/nntpchan-daemon/src/message.hpp

35 lines
802 B
C++
Raw Normal View History

2016-10-15 18:12:01 +05:00
#ifndef NNTPCHAN_MESSAGE_HPP
#define NNTPCHAN_MESSAGE_HPP
#include <string>
#include <vector>
#include <map>
#include <functional>
namespace nntpchan
{
2017-05-03 22:33:04 +05:00
bool IsValidMessageID(const std::string & msgid);
2016-10-15 18:12:01 +05:00
typedef std::pair<std::string, std::string> MessageHeader;
2017-05-03 22:33:04 +05:00
2016-10-15 18:12:01 +05:00
typedef std::map<std::string, std::string> MIMEPartHeader;
typedef std::function<bool(const MessageHeader &)> MessageHeaderFilter;
typedef std::function<bool(const MIMEPartHeader &)> MIMEPartFilter;
/**
2017-05-03 22:33:04 +05:00
read MIME message from i,
filter each header with h,
filter each part with p,
2016-10-15 18:12:01 +05:00
store result in o
2017-05-03 22:33:04 +05:00
return true if we read the whole message, return false if there is remaining
2016-10-15 18:12:01 +05:00
*/
bool StoreMIMEMessage(std::istream & i, MessageHeaderFilter h, MIMEPartHeader p, std::ostream & o);
2017-05-03 22:33:04 +05:00
2016-10-15 18:12:01 +05:00
}
#endif