Vuo 2.4.4
Loading...
Searching...
No Matches
VuoTableFormat.c
Go to the documentation of this file.
1
10#include "VuoTableFormat.h"
11
13#ifdef VUO_COMPILER
15 "title" : "Table Format",
16 "description" : "A text format for information structured in rows and columns",
17 "keywords" : [],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoList_VuoTableFormat"
21 ]
22 });
23#endif
25
31{
32 const char *valueAsString = "";
33 if (json_object_get_type(js) == json_type_string)
34 valueAsString = json_object_get_string(js);
35
36 VuoTableFormat value = VuoTableFormat_Csv;
37
38 if (! strcmp(valueAsString, "csv")) {
39 value = VuoTableFormat_Csv;
40 } else if (! strcmp(valueAsString, "tsv")) {
41 value = VuoTableFormat_Tsv;
42 }
43
44 return value;
45}
46
51json_object * VuoTableFormat_getJson(const VuoTableFormat value)
52{
53 char *valueAsString = "";
54
55 switch (value) {
56 case VuoTableFormat_Csv:
57 valueAsString = "csv";
58 break;
59 case VuoTableFormat_Tsv:
60 valueAsString = "tsv";
61 break;
62 }
63
64 return json_object_new_string(valueAsString);
65}
66
77
83{
84 char *valueAsString = "";
85
86 switch (value) {
87 case VuoTableFormat_Csv:
88 valueAsString = "CSV (comma-separated)";
89 break;
90 case VuoTableFormat_Tsv:
91 valueAsString = "TSV (tab-separated)";
92 break;
93 }
94
95 return strdup(valueAsString);
96}