@@ -131,16 +131,56 @@ namespace web { namespace json
131
131
// / Constructor creating a JSON string value
132
132
// / </summary>
133
133
// / <param name="value">The C++ value to create a JSON value from, a C++ STL string of the platform-native character width</param>
134
- _ASYNCRTIMP explicit value (utility::string_t );
134
+ // / <remarks>
135
+ // / This constructor has O(n) performance because it tries to determine if
136
+ // / specified string has characters that should be properly escaped in JSON.
137
+ // / <remarks>
138
+ _ASYNCRTIMP explicit value (utility::string_t value);
139
+
140
+ // / <summary>
141
+ // / Constructor creating a JSON string value specifying if the string contains characters to escape
142
+ // / </summary>
143
+ // / <param name="value">The C++ value to create a JSON value from, a C++ STL string of the platform-native character width</param>
144
+ // / <param name="has_escape_chars">Whether <paramref name="value" /> contains characters
145
+ // / that should be escaped in JSON value</param>
146
+ // / <remarks>
147
+ // / This constructor has O(1) performance.
148
+ // / </remarks>
149
+ _ASYNCRTIMP explicit value (utility::string_t value, bool has_escape_chars);
150
+
151
+ // / <summary>
152
+ // / Constructor creating a JSON string value
153
+ // / </summary>
154
+ // / <param name="value">The C++ value to create a JSON value from, a C++ STL string of the platform-native character width</param>
155
+ // / <remarks>
156
+ // / <para>
157
+ // / This constructor has O(n) performance because it tries to determine if
158
+ // / specified string has characters that should be properly escaped in JSON.
159
+ // / </para>
160
+ // / <para>
161
+ // / This constructor exists in order to avoid string literals matching another constructor,
162
+ // / as is very likely. For example, conversion to bool does not require a user-defined conversion,
163
+ // / and will therefore match first, which means that the JSON value turns up as a boolean.
164
+ // / </para>
165
+ // / </remarks>
166
+ _ASYNCRTIMP explicit value (const utility::char_t * value);
135
167
136
168
// / <summary>
137
169
// / Constructor creating a JSON string value
138
170
// / </summary>
139
171
// / <param name="value">The C++ value to create a JSON value from, a C++ STL string of the platform-native character width</param>
140
- // / <remarks>This constructor exists in order to avoid string literals matching another constructor,
172
+ // / <param name="has_escape_chars">Whether <paramref name="value" /> contains characters
173
+ // / <remarks>
174
+ // / <para>
175
+ // / This overload has O(1) performance.
176
+ // / </para>
177
+ // / <para>
178
+ // / This constructor exists in order to avoid string literals matching another constructor,
141
179
// / as is very likely. For example, conversion to bool does not require a user-defined conversion,
142
- // / and will therefore match first, which means that the JSON value turns up as a boolean.</remarks>
143
- _ASYNCRTIMP explicit value (const utility::char_t *);
180
+ // / and will therefore match first, which means that the JSON value turns up as a boolean.
181
+ // / </para>
182
+ // / </remarks>
183
+ _ASYNCRTIMP explicit value (const utility::char_t * value, bool has_escape_chars);
144
184
145
185
// / <summary>
146
186
// / Copy constructor
0 commit comments