summaryrefslogtreecommitdiff
path: root/include/flags.hpp
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:18:06 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:18:06 -0700
commit83d5ba42f8a98fc0df177efef4333f74a0481f61 (patch)
tree6f1fcff64ec9adb2fc51a7cfcc451eb22a103fb3 /include/flags.hpp
Diffstat (limited to 'include/flags.hpp')
-rw-r--r--include/flags.hpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/include/flags.hpp b/include/flags.hpp
new file mode 100644
index 0000000..bf2c0cb
--- /dev/null
+++ b/include/flags.hpp
@@ -0,0 +1,68 @@
+// Display images inside a terminal
+// Copyright (C) 2023 JustKidding
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+#ifndef FLAGS_H
+#define FLAGS_H
+
+#include <filesystem>
+#include <memory>
+#include <string>
+
+// singleton
+class Flags
+{
+ public:
+ static auto instance() -> std::shared_ptr<Flags>
+ {
+ static std::shared_ptr<Flags> instance{new Flags};
+ return instance;
+ }
+
+ Flags(const Flags &) = delete;
+ Flags(Flags &) = delete;
+ auto operator=(const Flags &) -> Flags & = delete;
+ auto operator=(Flags &) -> Flags & = delete;
+
+ bool no_stdin = false;
+ bool silent = false;
+ bool use_escape_codes = false;
+ bool print_version = false;
+ bool no_cache = false;
+ bool no_opencv = false;
+ bool use_opengl = false;
+ std::string output;
+ std::string pid_file;
+ bool origin_center = false;
+ int32_t scale_factor = 1;
+ bool needs_scaling = false;
+
+ std::string cmd_id;
+ std::string cmd_action;
+ std::string cmd_socket;
+ std::string cmd_x;
+ std::string cmd_y;
+ std::string cmd_max_width;
+ std::string cmd_max_height;
+ std::string cmd_file_path;
+
+ private:
+ Flags();
+ std::filesystem::path config_file;
+
+ void read_config_file();
+};
+
+#endif