BBS2chProxyBoardManager.h 693 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <map>
  3. #include <string>
  4. #include <pthread.h>
  5. #include <time.h>
  6. class BBS2chProxyBoardManager {
  7. private:
  8. std::map<std::string, std::string> _boardToServer;
  9. pthread_mutex_t _mutex;
  10. time_t _lastUpdated;
  11. void updateMap();
  12. public:
  13. BBS2chProxyBoardManager() : _lastUpdated(0) {
  14. pthread_mutex_init(&_mutex, NULL);
  15. }
  16. ~BBS2chProxyBoardManager() {
  17. pthread_mutex_destroy(&_mutex);
  18. }
  19. std::string getServerForBoard(const std::string &name);
  20. std::string getBoardJSONForTalkAndFake5ch();
  21. std::string getBoardHTML(bool shouldUseHttp, bool shouldUse2ch, bool shouldIncludeTalk);
  22. std::string getBoardJSON(bool shouldUseHttp, bool shouldUse2ch, bool shouldIncludeTalk);
  23. };