178 {
180 if (
auto* p = val.
data.template ptr<fl::string>()) {
181 *out_value = *p;
183 }
184 if (
auto* p = val.
data.template ptr<i64>()) {
186 result.addWarning(
fl::string(
"int ") + *out_value +
" converted to string");
188 }
189 if (
auto* p = val.
data.template ptr<float>()) {
190#if FL_PLATFORM_HAS_LARGE_MEMORY
192 result.addWarning(
fl::string(
"float ") + *out_value +
" converted to string");
193#else
194 (void)p;
195 *out_value = "0";
196 result.setError(
"float -> string not supported on Low-memory");
197#endif
199 }
200 if (
auto* p = val.
data.template ptr<bool>()) {
201 *out_value = *p ? "true" : "false";
202 result.addWarning(fl::string(
"bool converted to string '") + *out_value +
"'");
204 }
205 if (val.
data.template ptr<fl::nullptr_t>()) {
206 *out_value = "null";
207 result.addWarning(
"null converted to string 'null'");
209 }
210 result.setError(
"cannot convert array or object to string");
213}
void clear(bool freeMemory=false) FL_NO_EXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)
string to_string(T value) FL_NO_EXCEPT