#pragma once #define __DEBUG 1 #include namespace knacki::cd{ class ArgumentException; class AppContext { public: AppContext(char **); static std::string GetAbsolutePath(const std::string &, const std::string &); struct Args { public: bool usageOnly; bool historyOnly; bool getHistoryFile; bool flush; bool verbose; std::string histDir; std::string histFile; std::string histAbsolutePath; std::string pushArg; Args(){}; Args(bool _usageOnly, bool _historyOnly, bool _getHistoryFile, bool _flush, bool _verbose, const std::string &_histDir, const std::string &_histFile, const std::string &_pushArg): usageOnly(_usageOnly), historyOnly(_historyOnly), getHistoryFile(_getHistoryFile), flush(_flush), verbose(_verbose), histDir(_histDir), histFile(_histFile), histAbsolutePath(GetAbsolutePath(histDir, histFile)), pushArg(_pushArg) {}; }; const Args &GetArgs() const; bool IsReadOnly() const; protected: Args fArgs; private: AppContext(); }; }