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/storage.hpp

37 lines
637 B
C++
Raw Normal View History

2016-10-15 18:12:01 +05:00
#ifndef NNTPCHAN_STORAGE_HPP
#define NNTPCHAN_STORAGE_HPP
#include <string>
#include "message.hpp"
namespace nntpchan
{
class ArticleStorage
{
public:
ArticleStorage();
2016-10-15 21:37:59 +05:00
ArticleStorage(const std::string & fpath);
2016-10-15 18:12:01 +05:00
~ArticleStorage();
void SetPath(const std::string & fpath);
std::ostream & OpenWrite(const MessageID & msgid);
std::istream & OpenRead(const MessageID & msgid);
/**
return true if we should accept a new message give its message id
*/
bool Accept(const MessageID & msgid);
private:
static char GetPathSep();
std::string basedir;
};
}
#endif