fx.serial: remove references to obsolete classes
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
#include <fx/bool.h>
|
||||
#include <fx/collections/array.h>
|
||||
#include <fx/collections/datetime.h>
|
||||
#include <fx/collections/dict.h>
|
||||
#include <fx/double.h>
|
||||
#include <fx/float.h>
|
||||
#include <fx/int.h>
|
||||
#include <fx/serial/ctx.h>
|
||||
#include <fx/serial/toml.h>
|
||||
@@ -16,8 +15,10 @@ void write_raw_string(const fx_string *data)
|
||||
fx_stream_write_cstr(fx_stdout, "\"", NULL);
|
||||
|
||||
const fx_iterator *it = fx_iterator_cbegin(data);
|
||||
fx_foreach_c(fx_wchar, c, it)
|
||||
fx_foreach(val, it)
|
||||
{
|
||||
fx_wchar c;
|
||||
fx_value_get_wchar(&val, &c);
|
||||
if (c >= 0x10000) {
|
||||
c -= 0x10000;
|
||||
long hi = 0xD800 | ((c >> 10) & 0x3FF);
|
||||
@@ -55,6 +56,7 @@ void write_tagged_string(fx_string *data)
|
||||
|
||||
void write_tagged_integer(fx_int *data)
|
||||
{
|
||||
#if 0
|
||||
fx_stream_write_cstr(
|
||||
fx_stdout,
|
||||
"{ \"type\": \"integer\", \"value\": \"",
|
||||
@@ -78,10 +80,12 @@ void write_tagged_integer(fx_int *data)
|
||||
}
|
||||
|
||||
fx_stream_write_cstr(fx_stdout, "\" }", NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void write_tagged_float(fx_double *data)
|
||||
{
|
||||
#if 0
|
||||
fx_stream_write_cstr(
|
||||
fx_stdout,
|
||||
"{ \"type\": \"float\", \"value\": \"",
|
||||
@@ -106,16 +110,19 @@ void write_tagged_float(fx_double *data)
|
||||
}
|
||||
|
||||
fx_stream_write_cstr(fx_stdout, "\" }", NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void write_tagged_bool(fx_bool *data)
|
||||
{
|
||||
#if 0
|
||||
fx_stream_write_fmt(
|
||||
fx_stdout,
|
||||
NULL,
|
||||
"{ \"type\": \"bool\", \"value\": \"%s\" }",
|
||||
fx_bool_get_value(data) ? "true" : "false",
|
||||
NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void write_tagged_datetime(fx_datetime *data)
|
||||
@@ -154,6 +161,7 @@ void write_tagged_datetime(fx_datetime *data)
|
||||
fx_string_unref(new_data);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void write_tagged_dict(fx_dict *data)
|
||||
{
|
||||
fx_stream_write_cstr(fx_stdout, "{ ", NULL);
|
||||
@@ -175,6 +183,7 @@ void write_tagged_dict(fx_dict *data)
|
||||
|
||||
fx_stream_write_cstr(fx_stdout, " }", NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
void write_tagged_array(fx_array *data)
|
||||
{
|
||||
@@ -182,8 +191,10 @@ void write_tagged_array(fx_array *data)
|
||||
|
||||
int i = 0;
|
||||
fx_iterator *it = fx_iterator_begin(data);
|
||||
fx_foreach(fx_object *, obj, it)
|
||||
fx_foreach(val, it)
|
||||
{
|
||||
fx_object *obj;
|
||||
fx_value_get_object(&val, &obj);
|
||||
if (i++ > 0) {
|
||||
fx_stream_write_cstr(fx_stdout, ", ", NULL);
|
||||
}
|
||||
@@ -197,20 +208,19 @@ void write_tagged_array(fx_array *data)
|
||||
|
||||
void write_tagged_value(fx_object *data)
|
||||
{
|
||||
#if 0
|
||||
if (fx_object_is_type(data, FX_TYPE_DICT)) {
|
||||
write_tagged_dict(data);
|
||||
} else if (fx_object_is_type(data, FX_TYPE_ARRAY)) {
|
||||
} else
|
||||
#endif
|
||||
if (fx_object_is_type(data, FX_TYPE_ARRAY)) {
|
||||
write_tagged_array(data);
|
||||
} else if (fx_object_is_type(data, FX_TYPE_STRING)) {
|
||||
write_tagged_string(data);
|
||||
} else if (fx_object_is_type(data, FX_TYPE_DATETIME)) {
|
||||
write_tagged_datetime(data);
|
||||
} else if (fx_object_is_type(data, FX_TYPE_INT)) {
|
||||
write_tagged_integer(data);
|
||||
} else if (fx_object_is_type(data, FX_TYPE_BOOL)) {
|
||||
write_tagged_bool(data);
|
||||
} else if (fx_object_is_type(data, FX_TYPE_DOUBLE)) {
|
||||
write_tagged_float(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user