#include <string.h>
using namespace std;
string GetValue(UF_ATTR_value_p_t value)
{
string val;
if (NULL == value)
{
return val;
}
switch (value->type)
{
case UF_ATTR_bool:
{
val = value->value.boolean?"1":"0";
}
break;
case UF_ATTR_integer:
{
val = to_string(value->value.integer);
}
break;
case UF_ATTR_real:
{
val = to_string(value->value.real);
}
break;
case UF_ATTR_time:
{
char date_string[20] = {0};
char time[20] = {0};
uc4582(value->value.time, 7, date_string, time);
val = date_string;
val += " ";
val += time;
}
break;
case UF_ATTR_string:
{
val = value->value.string;
}
break;
case UF_ATTR_null:
{
}
break;
case UF_ATTR_reference:
{
val = value->value.reference;
}
break;
default:
break;
}
return val;
}