Vuo  2.0.0
VuoCompilerInputDataClass.cc
Go to the documentation of this file.
1 
11 #include "VuoCompilerInputData.hh"
12 #include "VuoType.hh"
13 
19 VuoCompilerInputDataClass::VuoCompilerInputDataClass(string name, Type *type, bool twoParameters) :
20  VuoCompilerDataClass(name, type)
21 {
22  this->twoParameters = twoParameters;
23 }
24 
29 {
30  return new VuoCompilerInputData(this);
31 }
32 
38 {
39  if (details)
40  {
41  json_object *value = NULL;
42  if (json_object_object_get_ex(details, "default", &value))
43  {
44  return json_object_to_json_string_ext(value, JSON_C_TO_STRING_PLAIN);
45  }
46  else if (json_object_object_get_ex(details, "defaults", &value))
47  {
48  json_object *valueForType = NULL;
49  if (json_object_object_get_ex(value, getVuoType()->getModuleKey().c_str(), &valueForType))
50  return json_object_to_json_string_ext(valueForType, JSON_C_TO_STRING_PLAIN);
51  }
52  }
53 
54  return "";
55 }
56 
62 {
63  if (details)
64  {
65  json_object *value = NULL;
66  if (json_object_object_get_ex(details, "auto", &value))
67  return json_object_to_json_string_ext(value, JSON_C_TO_STRING_PLAIN);
68  }
69 
70  return "";
71 }
72 
78 {
79  if (details)
80  {
81  json_object *value = NULL;
82  if (json_object_object_get_ex(details, "autoSupersedesDefault", &value))
83  return json_object_get_boolean(value);
84  }
85 
86  return false;
87 }
88 
94 {
95  return twoParameters;
96 }