From 9e4419826b3e23c63567591701a2834a837da98e Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 17 Oct 2025 09:46:56 +0800 Subject: Toml remove String. --- include/cru/toml/TomlDocument.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'include/cru/toml/TomlDocument.h') 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 #include @@ -16,9 +15,9 @@ class CRU_TOML_API TomlSection { CRU_DEFAULT_MOVE(TomlSection) public: - std::optional GetValue(const String& key) const; - void SetValue(const String& key, String value); - void DeleteValue(const String& key); + std::optional 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 values_; + std::unordered_map 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 sections_; + std::unordered_map sections_; }; } // namespace cru::toml -- cgit v1.2.3