From David Callu,
"bug fix to reflect the wchar_t in Value and Value.cpp I add the toWString() function. in Type and Type.cpp I just add two function to get a map of propertyList and a map of methodList i need this map in my editor a i think it's could be util to put this functionnality in osgIntrospection,
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
ABSTRACT_OBJECT_REFLECTOR(void)
|
||||
|
||||
ATOMIC_VALUE_REFLECTOR(char)
|
||||
WATOMIC_VALUE_REFLECTOR(wchar_t)
|
||||
ATOMIC_VALUE_REFLECTOR(signed char)
|
||||
ATOMIC_VALUE_REFLECTOR(unsigned char)
|
||||
|
||||
|
||||
@@ -207,6 +207,16 @@ void Type::getAllProperties(PropertyInfoList& props) const
|
||||
}
|
||||
}
|
||||
|
||||
void Type::getPropertiesMap(PropertyInfoMap& props) const
|
||||
{
|
||||
check_defined();
|
||||
props[this] = _props;
|
||||
for (TypeList::const_iterator i=_base.begin(); i!=_base.end(); ++i)
|
||||
{
|
||||
(*i)->getPropertiesMap(props);
|
||||
}
|
||||
}
|
||||
|
||||
void Type::getAllMethods(MethodInfoList& methods) const
|
||||
{
|
||||
check_defined();
|
||||
@@ -217,6 +227,16 @@ void Type::getAllMethods(MethodInfoList& methods) const
|
||||
}
|
||||
}
|
||||
|
||||
void Type::getMethodsMap(MethodInfoMap& methods) const
|
||||
{
|
||||
check_defined();
|
||||
methods[this] = _methods;
|
||||
for (TypeList::const_iterator i=_base.begin(); i!=_base.end(); ++i)
|
||||
{
|
||||
(*i)->getMethodsMap(methods);
|
||||
}
|
||||
}
|
||||
|
||||
Value Type::createInstance(ValueList& args) const
|
||||
{
|
||||
if (isAbstract())
|
||||
|
||||
@@ -82,7 +82,7 @@ Value Value::tryConvertTo(const Type& outtype) const
|
||||
|
||||
std::string Value::toString() const
|
||||
{
|
||||
check_empty();
|
||||
check_empty();
|
||||
|
||||
const ReaderWriter* rw = _type->getReaderWriter();
|
||||
if (rw)
|
||||
@@ -90,7 +90,22 @@ std::string Value::toString() const
|
||||
std::ostringstream oss;
|
||||
if (!rw->writeTextValue(oss, *this))
|
||||
throw StreamWriteErrorException();
|
||||
return oss.str();
|
||||
return oss.str();
|
||||
}
|
||||
throw StreamingNotSupportedException(StreamingNotSupportedException::ANY, _type->getStdTypeInfo());
|
||||
}
|
||||
|
||||
std::wstring Value::toWString() const
|
||||
{
|
||||
check_empty();
|
||||
|
||||
const ReaderWriter* rw = _type->getReaderWriter();
|
||||
if (rw)
|
||||
{
|
||||
std::wostringstream woss;
|
||||
if (!rw->writeTextValue(woss, *this))
|
||||
throw StreamWriteErrorException();
|
||||
return woss.str();
|
||||
}
|
||||
throw StreamingNotSupportedException(StreamingNotSupportedException::ANY, _type->getStdTypeInfo());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user