@@ -134,22 +134,34 @@ class TSharedRef
134
134
operator TRef () const ;
135
135
136
136
137
- // ! Creates a TSharedRef from a string .
138
- // ! Since strings are ref-counted, no data is copied.
137
+ // ! Creates a TSharedRef from TString .
138
+ // ! Since strings are ref-counted, no data is being copied.
139
139
// ! The memory is marked with a given tag.
140
140
template <class TTag >
141
141
static TSharedRef FromString (TString str);
142
142
143
- // ! Creates a TSharedRef from a string.
144
- // ! Since strings are ref-counted, no data is copied.
145
- // ! The memory is marked with TDefaultSharedBlobTag.
143
+ // ! Same as above but the memory is marked with TDefaultSharedBlobTag.
146
144
static TSharedRef FromString (TString str);
147
145
148
- // ! Creates a TSharedRef reference from a string.
149
- // ! Since strings are ref-counted, no data is copied.
150
- // ! The memory is marked with a given tag.
146
+ // ! Same as above but the memory tag is specified in #tagCookie.
151
147
static TSharedRef FromString (TString str, TRefCountedTypeCookie tagCookie);
152
148
149
+ // ! Creates a TSharedRef from std::string.
150
+ // ! No data is being copied in #FromString itself but since #str is passed by value
151
+ // ! a copy may occur at caller's side.
152
+ // ! The memory is marked with a given tag.
153
+ template <class TTag >
154
+ static TSharedRef FromString (std::string str);
155
+
156
+ // ! Same as above but the memory is marked with TDefaultSharedBlobTag.
157
+ static TSharedRef FromString (std::string str);
158
+
159
+ // ! Same as above but the memory tag is specified in #tagCookie.
160
+ static TSharedRef FromString (std::string str, TRefCountedTypeCookie tagCookie);
161
+
162
+ // ! Creates a TSharedRef from a zero-terminated C string.
163
+ static TSharedRef FromString (const char * str);
164
+
153
165
// ! Creates a TSharedRef for a given blob taking ownership of its content.
154
166
static TSharedRef FromBlob (TBlob&& blob);
155
167
@@ -176,6 +188,9 @@ class TSharedRef
176
188
177
189
private:
178
190
friend class TSharedRefArrayImpl ;
191
+
192
+ template <class TString >
193
+ static TSharedRef FromStringImpl (TString str, TRefCountedTypeCookie tagCookie);
179
194
};
180
195
181
196
// //////////////////////////////////////////////////////////////////////////////
0 commit comments