tool.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * 文件名: tool.h
  3. * 目标: aFun tool公共API
  4. * aFunTool是aFun实用工具库, 内含aFun调用的实用函数
  5. */
  6. #ifndef AFUN_TOOL_HPP
  7. #define AFUN_TOOL_HPP
  8. #include "macro.hpp"
  9. #include "aFunToolExport.h"
  10. namespace aFuntool {
  11. class FileOpenException : public std::exception {
  12. std::string msg;
  13. public:
  14. explicit FileOpenException(ConstFilePath file) {msg = std::string("File cannot open") + file;}
  15. virtual const char *what() {return "File cannot open";}
  16. };
  17. class RegexException : public std::exception
  18. {
  19. std::string message;
  20. public:
  21. explicit RegexException(const std::string &msg) { this->message = "Regex Error: " + msg;}
  22. virtual const char *what() {return message.c_str();}
  23. };
  24. class LogFatalError : public std::exception {
  25. std::string message;
  26. public:
  27. explicit LogFatalError(const char *msg) {message = msg;}
  28. virtual const char *what() {return message.c_str();}
  29. };
  30. }
  31. #include "mem.hpp"
  32. #include "stdio_.hpp"
  33. #include "exit_.hpp"
  34. #include "btye.hpp"
  35. #include "dlc.hpp"
  36. #include "file.hpp"
  37. #include "hash.hpp"
  38. #include "md5.hpp"
  39. #include "path.hpp"
  40. #include "regex.hpp"
  41. #include "str.hpp"
  42. #include "time_.hpp"
  43. #include "log.hpp"
  44. #include "pthread.h"
  45. #include "fflags.h"
  46. #include "aFun_ht.h"
  47. #endif //AFUN_TOOL_HPP