/* * Copyright (C) 2021-2022 Riyyi * * SPDX-License-Identifier: MIT */ #ifndef DOTFILE_H #define DOTFILE_H #include // size_t #include #include // function #include #include #include "util/singleton.h" class Dotfile : public Util::Singleton { public: Dotfile(s); virtual ~Dotfile(); enum class SyncType { Pull, Push, }; void add(const std::vector& targets = {}); void list(const std::vector& targets = {}); void pull(const std::vector& targets = {}); void push(const std::vector& targets = {}); bool match(const std::string& path, const std::vector& patterns); private: void pullOrPush(SyncType type, const std::vector& targets = {}); void sync(SyncType type, const std::vector& paths, const std::vector& homeIndices, const std::vector& systemIndices, const std::function& generateHomePaths, const std::function& generateSystemPaths); void selectivelyCommentOrUncomment(const std::string& path); void forEachDotfile(const std::vector& targets, const std::function& callback); }; #endif // DOTFILE_H