-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added more keywords to the C++ syntax, allowed debugging the highligher XPC service, preserving the original entitlements when force-resigning, fixed the double-releasing of failed XPC connections, allowed comments in the lexer settings. * Moved FileSettingsStorage to a separate file, clang-format * Added some unit tests for FileSettingsStorage
- Loading branch information
1 parent
6f461d1
commit 36e7255
Showing
25 changed files
with
408 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Source/Viewer/include/Viewer/Highlighting/FileSettingsStorage.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (C) 2024 Michael Kazakov. Subject to GNU General Public License version 3. | ||
#pragma once | ||
#include "SettingsStorage.h" | ||
#include <Base/RobinHoodUtil.h> | ||
#include <Utility/FileMask.h> | ||
#include <filesystem> | ||
#include <vector> | ||
|
||
namespace nc::viewer::hl { | ||
|
||
class FileSettingsStorage : public SettingsStorage | ||
{ | ||
public: | ||
FileSettingsStorage(const std::filesystem::path &_base_dir, const std::filesystem::path &_overrides_dir); | ||
|
||
std::optional<std::string> Language(std::string_view _filename) noexcept override; | ||
|
||
std::shared_ptr<const std::string> Settings(std::string_view _lang) override; | ||
|
||
private: | ||
struct Lang { | ||
std::string name; | ||
std::string settings_filename; | ||
nc::utility::FileMask mask; | ||
}; | ||
|
||
std::vector<Lang> LoadLangs(); | ||
|
||
std::filesystem::path m_BaseDir; | ||
std::vector<Lang> m_Langs; | ||
robin_hood::unordered_flat_map<std::string, | ||
std::shared_ptr<const std::string>, | ||
RHTransparentStringHashEqual, | ||
RHTransparentStringHashEqual> | ||
m_Settings; | ||
}; | ||
|
||
} // namespace nc::viewer::hl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.