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/libnntpchan/storage.hpp
Jeff Becker e67e7a20bd
* more nntpchan-daemon code
* fix keepalive
2017-10-09 11:48:10 -04:00

41 lines
740 B
C++

#ifndef NNTPCHAN_STORAGE_HPP
#define NNTPCHAN_STORAGE_HPP
#include <experimental/filesystem>
#include <string>
#include "file_handle.hpp"
namespace nntpchan
{
namespace fs = std::experimental::filesystem;
class ArticleStorage
{
public:
ArticleStorage();
ArticleStorage(const fs::path & fpath);
~ArticleStorage();
void SetPath(const fs::path & fpath);
FileHandle_ptr OpenWrite(const std::string & msgid);
FileHandle_ptr OpenRead(const std::string & msgid);
/**
return true if we should accept a new message give its message id
*/
bool Accept(const std::string & msgid);
private:
fs::path MessagePath(const std::string & msgid);
fs::path basedir;
};
}
#endif