This repository has been archived on 2023-08-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2016-10-15 09:12:01 -04:00
|
|
|
#ifndef NNTPCHAN_STORAGE_HPP
|
|
|
|
|
#define NNTPCHAN_STORAGE_HPP
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include "message.hpp"
|
|
|
|
|
|
|
|
|
|
namespace nntpchan
|
|
|
|
|
{
|
|
|
|
|
class ArticleStorage
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ArticleStorage();
|
2016-10-15 12:37:59 -04:00
|
|
|
ArticleStorage(const std::string & fpath);
|
2016-10-15 09:12:01 -04: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
|