C++ Any getValue
Posted: Wed Dec 19, 2012 8:08 pm
Hello,
I am trying to determine the type of information present in an any variable and extract it.The problem is I do not know how to use getValue. It returns a void *, but how to I convert it to string or double. Is it as simple as deferencing it??
The code I have below -- need the code for the ???
Saleem
I am trying to determine the type of information present in an any variable and extract it.The problem is I do not know how to use getValue. It returns a void *, but how to I convert it to string or double. Is it as simple as deferencing it??
The code I have below -- need the code for the ???
Saleem
Code: Select all
value AnyToValue( const Any &val )
{
value result;
if( val.hasValue() )
{
string value_type ==OUStringToString( val.getValueTypeName() );
if( value_type == "string" )
{
return ??????;
}
else
{
return ?????;
}
}
else
{
return value("");
}
}