diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-10-17 09:46:56 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-10-17 09:46:56 +0800 |
commit | 9e4419826b3e23c63567591701a2834a837da98e (patch) | |
tree | 763838a83850f5cb07cff43915aa6be3a689bef0 /include/cru/toml/TomlDocument.h | |
parent | a6b5b8b879a9a587ec0ad605722d5d6428d5e68c (diff) | |
download | cru-9e4419826b3e23c63567591701a2834a837da98e.tar.gz cru-9e4419826b3e23c63567591701a2834a837da98e.tar.bz2 cru-9e4419826b3e23c63567591701a2834a837da98e.zip |
Toml remove String.
Diffstat (limited to 'include/cru/toml/TomlDocument.h')
-rw-r--r-- | include/cru/toml/TomlDocument.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/include/cru/toml/TomlDocument.h b/include/cru/toml/TomlDocument.h index d072d384..4cd3ab3e 100644 --- a/include/cru/toml/TomlDocument.h +++ b/include/cru/toml/TomlDocument.h @@ -3,7 +3,6 @@ #include "Base.h" #include "cru/base/Base.h" -#include "cru/base/String.h" #include <optional> #include <unordered_map> @@ -16,9 +15,9 @@ class CRU_TOML_API TomlSection { CRU_DEFAULT_MOVE(TomlSection) public: - std::optional<String> GetValue(const String& key) const; - void SetValue(const String& key, String value); - void DeleteValue(const String& key); + std::optional<std::string> GetValue(const std::string& key) const; + void SetValue(const std::string& key, std::string value); + void DeleteValue(const std::string& key); auto begin() { return values_.begin(); } auto end() { return values_.end(); } @@ -28,7 +27,7 @@ class CRU_TOML_API TomlSection { auto cend() const { return values_.cend(); } private: - std::unordered_map<String, String> values_; + std::unordered_map<std::string, std::string> values_; }; class CRU_TOML_API TomlDocument { @@ -38,11 +37,11 @@ class CRU_TOML_API TomlDocument { CRU_DEFAULT_MOVE(TomlDocument) public: - TomlSection* GetSection(const String& name); - TomlSection* GetSectionOrCreate(const String& name); - const TomlSection* GetSection(const String& name) const; - void SetSection(const String& name, TomlSection section); - void DeleteSection(const String& name); + TomlSection* GetSection(const std::string& name); + TomlSection* GetSectionOrCreate(const std::string& name); + const TomlSection* GetSection(const std::string& name) const; + void SetSection(const std::string& name, TomlSection section); + void DeleteSection(const std::string& name); auto begin() { return sections_.begin(); } auto end() { return sections_.end(); } @@ -52,6 +51,6 @@ class CRU_TOML_API TomlDocument { auto cend() const { return sections_.cend(); } private: - std::unordered_map<String, TomlSection> sections_; + std::unordered_map<std::string, TomlSection> sections_; }; } // namespace cru::toml |