Vuo  2.3.2
VuoSortOrder.c
Go to the documentation of this file.
1 
10 #include "type.h"
11 
13 #ifdef VUO_COMPILER
15  "title" : "Sort Order",
16  "description" : "Ascending or descending order.",
17  "keywords" : [ ],
18  "version" : "1.0.0",
19  "dependencies" : [
20  "VuoList_VuoSortOrder"
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  if (strcmp(valueAsString, "descending") == 0)
37  return VuoSortOrder_Descending;
38 
39  return VuoSortOrder_Ascending;
40 }
41 
47 {
48  char *valueAsString = "ascending";
49 
50  if (value == VuoSortOrder_Descending)
51  valueAsString = "descending";
52 
53  return json_object_new_string(valueAsString);
54 }
55 
60 {
62  VuoListAppendValue_VuoSortOrder(l, VuoSortOrder_Ascending);
63  VuoListAppendValue_VuoSortOrder(l, VuoSortOrder_Descending);
64  return l;
65 }
66 
72 {
73  char *valueAsString = "Ascending";
74 
75  if (value == VuoSortOrder_Descending)
76  valueAsString = "Descending";
77 
78  return strdup(valueAsString);
79 }