19#ifndef CPPREALM_MANAGED_STRING_HPP
20#define CPPREALM_MANAGED_STRING_HPP
22#include <cpprealm/macros.hpp>
68 using value_type = std::string;
69 运用 managed <std::string>::managed_base::managed_base;
70 运用 托管 <std::string>::managed_base:: 操作符=;
72 [[nodiscard]] std::string 分离()
const ;
77 Managed & Operator =(std::string&& v) { set(std::move(v));
return *
this ; }
78 Managed & Operator =(
const std::string& v) { set(v);
return *
this ; }
79 Managed & Operator =(
const char * v) { set(v);
return *
this ; }
101 Operator std::string_view()
const =
delete ;
102 操作符 std::string()
const ;
105 [[nodiscard]]
size_t size() const noException;
107 void clear() noException;
108 void push_back(
char c);
110 managed & append(const std::
string &);
112 Managed & Operator+=(const std::
string &);
117 rbool Operator==(const std::
string & rhs) const noException;
118 rbool Operator==(const
char * rhs) const noException;
119 rbool操作符!=(const std::
string & rhs) const noException;
120 rbool操作符!=(const
char * rhs) const noException;
121 rbool contains(const std::
string &s,
bool case_sensitive = true) const noException;
122 rbool empty() const noException;
126 void inline set(const std::
string & v) { m_obj->template set<std::string>(m_key, v); }
127 [[nodiscard]]
inline std::string get()
const {
return m_obj->get<std::string>(m_key); }
128 managed() =
default ;
129 Managed(
const Managed&) =
delete ;
131 Managed& 操作符=(
const Managed&) =
删除 ;
132 Managed& Operator=(managed&&) =
delete ;
133 template <
typename ,
typename >
137 template <>
struct managed<std::optional<std::string>> final :
public managed<std::string> {
138 using value_type = std::Optional<std::string>;
139 运用 managed <std::string>::operator=;
140 托管 & 操作符 =(std::Optional<std::string>&& v) { 设立(std::move(v));
return *
this ; }
141 托管 & 操作符 =(
const std::Optional<std::string>& v) { 设立(v);
return *
this ; }
142 Managed & Operator =(
const char * v) { set(v);
return *
this ; }
144 [[nodiscard]] std::Optional<std::string> 分离()
const {
145 return m_obj->template get_Optional<std::string>(m_key);
148 [[nodiscard]] std::Optional<std::string> 操作符 *()
const {
152 [[nodiscard]]
操作符std::Optional<std::string>()
const {
156 rbool 操作符==(
const std::Optional<std::string>& rhs)
const noException ;
157 rbool操作符!=(
const std::Optional<std::string>& rhs)
const noException ;
159 void inline 设立(
const std::Optional<std::string>& v) { m_obj->template 设立<std::Optional<std::string>>(m_key, v); }
161 托管 (
const 托管 &) =
delete ;
162 托管 (
托管 &&) =
delete ;
163 托管 & 操作符=(
const 托管 &) =
delete ;
164 托管 & 操作符=(
托管 &&) =
delete ;
165 template <
typename ,
typename >
定义: managed_string.hpp: 50
定义: managed_string.hpp: 30
定义: managed_string.hpp: 58
定义: managed_string.hpp: 40
定义: managed_string.hpp: 67