mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Compiling and working test application
This commit is contained in:
parent
2f86743b44
commit
26227dbcfc
@ -36,8 +36,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafAppEnumMapper.h"
|
||||
#include "cafAssert.h"
|
||||
|
||||
#include "cafTypeNameHelper.h"
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
@ -102,7 +104,11 @@ template <class T>
|
||||
class AppEnum
|
||||
{
|
||||
public:
|
||||
AppEnum() { m_value = EnumMapper::instance()->defaultValue(); }
|
||||
AppEnum()
|
||||
{
|
||||
auto enumInteger = EnumMapper::instance()->defaultEnumValue( caf::cafTypeName<T>() );
|
||||
m_value = caf::convertToEnum<T>( enumInteger );
|
||||
}
|
||||
AppEnum( T value )
|
||||
: m_value( value )
|
||||
{
|
||||
@ -110,42 +116,66 @@ public:
|
||||
|
||||
operator T() const { return m_value; }
|
||||
|
||||
T value() const { return m_value; }
|
||||
size_t index() const { return EnumMapper::instance()->index( m_value ); }
|
||||
QString text() const { return EnumMapper::instance()->text( m_value ); }
|
||||
QString uiText() const { return EnumMapper::instance()->uiText( m_value ); }
|
||||
T value() const { return m_value; }
|
||||
size_t index() const
|
||||
{
|
||||
return EnumMapper::instance()->index( caf::cafTypeName<T>(), caf::convertToInteger( m_value ) );
|
||||
}
|
||||
QString text() const
|
||||
{
|
||||
return EnumMapper::instance()->text( caf::cafTypeName<T>(), caf::convertToInteger( m_value ) );
|
||||
}
|
||||
QString uiText() const
|
||||
{
|
||||
return EnumMapper::instance()->uiText( caf::cafTypeName<T>(), caf::convertToInteger( m_value ) );
|
||||
}
|
||||
|
||||
AppEnum& operator=( T value )
|
||||
{
|
||||
m_value = value;
|
||||
return *this;
|
||||
}
|
||||
bool setFromText( const QString& text ) { return EnumMapper::instance()->enumVal( m_value, text ); }
|
||||
bool setFromIndex( size_t index ) { return EnumMapper::instance()->enumVal( m_value, index ); }
|
||||
bool setFromText( const QString& text )
|
||||
{
|
||||
m_value = fromText( text );
|
||||
return true;
|
||||
}
|
||||
bool setFromIndex( size_t index )
|
||||
{
|
||||
m_value = fromIndex( index );
|
||||
return true;
|
||||
}
|
||||
|
||||
// Static interface to access the properties of the enum definition
|
||||
|
||||
static bool isValid( const QString& text ) { return EnumMapper::instance()->isValid( text ); }
|
||||
static bool isValid( size_t index ) { return index < EnumMapper::instance()->size(); }
|
||||
static size_t size() { return EnumMapper::instance()->size(); }
|
||||
static size_t size() { return EnumMapper::instance()->size( caf::cafTypeName<T>() ); }
|
||||
|
||||
static QStringList uiTexts() { return EnumMapper::instance()->uiTexts(); }
|
||||
static T fromIndex( size_t idx )
|
||||
{
|
||||
T val;
|
||||
EnumMapper::instance()->enumVal( val, idx );
|
||||
return val;
|
||||
auto enumInteger = EnumMapper::instance()->fromIndex( caf::cafTypeName<T>(), idx );
|
||||
return caf::convertToEnum<T>( enumInteger );
|
||||
}
|
||||
static T fromText( const QString& text )
|
||||
{
|
||||
T val;
|
||||
EnumMapper::instance()->enumVal( val, text );
|
||||
return val;
|
||||
auto enumInteger = EnumMapper::instance()->fromText( caf::cafTypeName<T>(), text );
|
||||
return caf::convertToEnum<T>( enumInteger );
|
||||
}
|
||||
static size_t index( T enumValue )
|
||||
{
|
||||
return EnumMapper::instance()->index( caf::cafTypeName<T>(), caf::convertToInteger( enumValue ) );
|
||||
}
|
||||
static QString text( T enumValue )
|
||||
{
|
||||
return EnumMapper::instance()->text( caf::cafTypeName<T>(), caf::convertToInteger( enumValue ) );
|
||||
}
|
||||
static size_t index( T enumValue ) { return EnumMapper::instance()->index( enumValue ); }
|
||||
static QString text( T enumValue ) { return EnumMapper::instance()->text( enumValue ); }
|
||||
static QString textFromIndex( size_t idx ) { return text( fromIndex( idx ) ); }
|
||||
static QString uiText( T enumValue ) { return EnumMapper::instance()->uiText( enumValue ); }
|
||||
static QString uiText( T enumValue )
|
||||
{
|
||||
return EnumMapper::instance()->uiText( caf::cafTypeName<T>(), caf::convertToInteger( enumValue ) );
|
||||
}
|
||||
static QString uiTextFromIndex( size_t idx ) { return uiText( fromIndex( idx ) ); }
|
||||
|
||||
private:
|
||||
@ -157,10 +187,15 @@ private:
|
||||
static void setUp();
|
||||
static void addItem( T enumVal, const QString& text, const QString& uiText, const QStringList& aliases = {} )
|
||||
{
|
||||
EnumMapper::instance()->addItem( enumVal, text, uiText, aliases );
|
||||
auto key = caf::cafTypeName<T>();
|
||||
auto enumInteger = caf::convertToInteger<T>( enumVal );
|
||||
EnumMapper::instance()->addItem( key, enumInteger, text, uiText, aliases );
|
||||
}
|
||||
|
||||
static void setDefault( T defaultEnumValue ) { EnumMapper::instance()->setDefault( defaultEnumValue ); }
|
||||
static void setDefault( T defaultEnumValue )
|
||||
{
|
||||
EnumMapper::instance()->setDefault( caf::cafTypeName<T>(), caf::convertToInteger<T>( defaultEnumValue ) );
|
||||
}
|
||||
|
||||
T m_value;
|
||||
|
||||
@ -173,172 +208,198 @@ private:
|
||||
|
||||
class EnumMapper
|
||||
{
|
||||
private:
|
||||
class EnumData
|
||||
{
|
||||
public:
|
||||
EnumData( T enumVal, const QString& text, const QString& uiText, const QStringList& aliases )
|
||||
: m_enumVal( enumVal )
|
||||
, m_text( text )
|
||||
, m_uiText( uiText )
|
||||
, m_aliases( aliases )
|
||||
{
|
||||
}
|
||||
/*
|
||||
private:
|
||||
class EnumData
|
||||
{
|
||||
public:
|
||||
EnumData( T enumVal, const QString& text, const QString& uiText, const QStringList& aliases )
|
||||
: m_enumVal( enumVal )
|
||||
, m_text( text )
|
||||
, m_uiText( uiText )
|
||||
, m_aliases( aliases )
|
||||
{
|
||||
}
|
||||
|
||||
bool isMatching( const QString& text ) const { return ( text == m_text || m_aliases.contains( text ) ); }
|
||||
bool isMatching( const QString& text ) const { return ( text == m_text || m_aliases.contains( text )
|
||||
); }
|
||||
|
||||
T m_enumVal;
|
||||
QString m_text;
|
||||
QString m_uiText;
|
||||
QStringList m_aliases;
|
||||
};
|
||||
T m_enumVal;
|
||||
QString m_text;
|
||||
QString m_uiText;
|
||||
QStringList m_aliases;
|
||||
};
|
||||
*/
|
||||
|
||||
public:
|
||||
void addItem( T enumVal, const QString& text, QString uiText, const QStringList& aliases )
|
||||
{
|
||||
// Make sure the alias text is unique for enum
|
||||
for ( const auto& alias : aliases )
|
||||
{
|
||||
for ( const auto& enumData : instance()->m_mapping )
|
||||
{
|
||||
CAF_ASSERT( !enumData.isMatching( alias ) );
|
||||
}
|
||||
}
|
||||
caf::AppEnumMapper::instance()->addItem( caf::cafTypeName<T>(),
|
||||
caf::convertToInteger<T>( enumVal ),
|
||||
text,
|
||||
uiText,
|
||||
aliases );
|
||||
|
||||
// Make sure the text is trimmed, as this text is streamed to XML and will be trimmed when read back
|
||||
// from XML text https://github.com/OPM/ResInsight/issues/7829
|
||||
instance()->m_mapping.push_back( EnumData( enumVal, text.trimmed(), uiText, aliases ) );
|
||||
/*
|
||||
// Make sure the alias text is unique for enum
|
||||
for ( const auto& alias : aliases )
|
||||
{
|
||||
for ( const auto& enumData : instance()->m_mapping )
|
||||
{
|
||||
CAF_ASSERT( !enumData.isMatching( alias ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the text is trimmed, as this text is streamed to XML and will be trimmed when read
|
||||
back
|
||||
// from XML text https://github.com/OPM/ResInsight/issues/7829
|
||||
instance()->m_mapping.push_back( EnumData( enumVal, text.trimmed(), uiText, aliases ) );
|
||||
*/
|
||||
}
|
||||
|
||||
static EnumMapper* instance()
|
||||
/*
|
||||
static EnumMapper* instance()
|
||||
{
|
||||
static EnumMapper storedInstance;
|
||||
static bool isInitialized = false;
|
||||
if ( !isInitialized )
|
||||
{
|
||||
isInitialized = true;
|
||||
AppEnum<T>::setUp();
|
||||
}
|
||||
return &storedInstance;
|
||||
}
|
||||
*/
|
||||
static caf::AppEnumMapper* instance()
|
||||
{
|
||||
static EnumMapper storedInstance;
|
||||
static bool isInitialized = false;
|
||||
static bool isInitialized = false;
|
||||
if ( !isInitialized )
|
||||
{
|
||||
isInitialized = true;
|
||||
AppEnum<T>::setUp();
|
||||
}
|
||||
return &storedInstance;
|
||||
return caf::AppEnumMapper::instance();
|
||||
}
|
||||
/*
|
||||
|
||||
void setDefault( T defaultEnumValue )
|
||||
{
|
||||
m_defaultValue = defaultEnumValue;
|
||||
m_defaultValueIsSet = true;
|
||||
}
|
||||
|
||||
T defaultValue() const
|
||||
{
|
||||
if ( m_defaultValueIsSet )
|
||||
{
|
||||
return m_defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// CAF_ASSERT(m_mapping.size());
|
||||
return m_mapping[0].m_enumVal;
|
||||
}
|
||||
}
|
||||
|
||||
bool isValid( const QString& text ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( text == m_mapping[idx].m_text ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t size() const { return m_mapping.size(); }
|
||||
|
||||
bool enumVal( T& value, const QString& text ) const
|
||||
{
|
||||
value = defaultValue();
|
||||
|
||||
QString trimmedText = text.trimmed();
|
||||
|
||||
for ( size_t idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
// Make sure the text parsed from a text stream is trimmed
|
||||
// https://github.com/OPM/ResInsight/issues/7829
|
||||
if ( m_mapping[idx].isMatching( trimmedText ) )
|
||||
void setDefault( T defaultEnumValue )
|
||||
{
|
||||
value = m_mapping[idx].m_enumVal;
|
||||
return true;
|
||||
m_defaultValue = defaultEnumValue;
|
||||
m_defaultValueIsSet = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enumVal( T& value, size_t index ) const
|
||||
{
|
||||
value = defaultValue();
|
||||
if ( index < m_mapping.size() )
|
||||
{
|
||||
value = m_mapping[index].m_enumVal;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
T defaultValue() const
|
||||
{
|
||||
if ( m_defaultValueIsSet )
|
||||
{
|
||||
return m_defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// CAF_ASSERT(m_mapping.size());
|
||||
return m_mapping[0].m_enumVal;
|
||||
}
|
||||
}
|
||||
|
||||
size_t index( T enumValue ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( enumValue == m_mapping[idx].m_enumVal ) return idx;
|
||||
}
|
||||
bool isValid( const QString& text ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( text == m_mapping[idx].m_text ) return true;
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString uiText( T value ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( value == m_mapping[idx].m_enumVal ) return m_mapping[idx].m_uiText;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
size_t size() const { return m_mapping.size(); }
|
||||
|
||||
QStringList uiTexts() const
|
||||
{
|
||||
QStringList uiTextList;
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
uiTextList.append( m_mapping[idx].m_uiText );
|
||||
}
|
||||
return uiTextList;
|
||||
}
|
||||
bool enumVal( T& value, const QString& text ) const
|
||||
{
|
||||
value = defaultValue();
|
||||
|
||||
QString text( T value ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( value == m_mapping[idx].m_enumVal ) return m_mapping[idx].m_text;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
QString trimmedText = text.trimmed();
|
||||
|
||||
private:
|
||||
EnumMapper()
|
||||
: m_defaultValue( T() )
|
||||
, m_defaultValueIsSet( false )
|
||||
{
|
||||
}
|
||||
for ( size_t idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
// Make sure the text parsed from a text stream is trimmed
|
||||
// https://github.com/OPM/ResInsight/issues/7829
|
||||
if ( m_mapping[idx].isMatching( trimmedText ) )
|
||||
{
|
||||
value = m_mapping[idx].m_enumVal;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
friend class AppEnum<T>;
|
||||
bool enumVal( T& value, size_t index ) const
|
||||
{
|
||||
value = defaultValue();
|
||||
if ( index < m_mapping.size() )
|
||||
{
|
||||
value = m_mapping[index].m_enumVal;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<EnumData> m_mapping;
|
||||
T m_defaultValue;
|
||||
bool m_defaultValueIsSet;
|
||||
size_t index( T enumValue ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( enumValue == m_mapping[idx].m_enumVal ) return idx;
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
QString uiText( T value ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( value == m_mapping[idx].m_enumVal ) return m_mapping[idx].m_uiText;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
QStringList uiTexts() const
|
||||
{
|
||||
QStringList uiTextList;
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
uiTextList.append( m_mapping[idx].m_uiText );
|
||||
}
|
||||
return uiTextList;
|
||||
}
|
||||
|
||||
QString text( T value ) const
|
||||
{
|
||||
size_t idx;
|
||||
for ( idx = 0; idx < m_mapping.size(); ++idx )
|
||||
{
|
||||
if ( value == m_mapping[idx].m_enumVal ) return m_mapping[idx].m_text;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private:
|
||||
EnumMapper()
|
||||
: m_defaultValue( T() )
|
||||
, m_defaultValueIsSet( false )
|
||||
{
|
||||
}
|
||||
|
||||
friend class AppEnum<T>;
|
||||
|
||||
std::vector<EnumData> m_mapping;
|
||||
T m_defaultValue;
|
||||
bool m_defaultValueIsSet;
|
||||
*/
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -28,18 +28,23 @@ void AppEnumMapper::addItem( const std::string& enumKey,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void AppEnumMapper::addDefaultItem( const std::string& enumKey,
|
||||
int enumValue,
|
||||
const QString& text,
|
||||
const QString& uiText,
|
||||
const QStringList& aliases /*= {} */ )
|
||||
void AppEnumMapper::setDefault( const std::string& enumKey, int enumValue )
|
||||
{
|
||||
// Make sure the text is trimmed, as this text is streamed to XML and will be trimmed when read back
|
||||
// from XML text https://github.com/OPM/ResInsight/issues/7829
|
||||
auto enumData = AppEnumMapper::EnumData( enumValue, text.trimmed(), uiText, aliases );
|
||||
enumData.m_isDefault = true;
|
||||
|
||||
m_enumMap[enumKey].emplace_back( enumData );
|
||||
auto it = m_enumMap.find( enumKey );
|
||||
if ( it != m_enumMap.end() )
|
||||
{
|
||||
for ( auto& enumData : it->second )
|
||||
{
|
||||
if ( enumData.m_enumVal == enumValue )
|
||||
{
|
||||
enumData.m_isDefault = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
enumData.m_isDefault = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -70,8 +75,13 @@ int AppEnumMapper::defaultEnumValue( const std::string& enumKey ) const
|
||||
return enumData.m_enumVal;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !it->second.empty() )
|
||||
{
|
||||
return it->second.front().m_enumVal;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -134,7 +144,7 @@ QString AppEnumMapper::uiText( const std::string& enumKey, int enumValue ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int AppEnumMapper::enumValue( const std::string& enumKey, const QString& text ) const
|
||||
int AppEnumMapper::fromText( const std::string& enumKey, const QString& text ) const
|
||||
{
|
||||
auto it = m_enumMap.find( enumKey );
|
||||
if ( it != m_enumMap.end() )
|
||||
@ -147,13 +157,13 @@ int AppEnumMapper::enumValue( const std::string& enumKey, const QString& text )
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return defaultEnumValue( enumKey );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int AppEnumMapper::enumValue( const std::string& enumKey, int enumIndex ) const
|
||||
int AppEnumMapper::fromIndex( const std::string& enumKey, size_t enumIndex ) const
|
||||
{
|
||||
auto it = m_enumMap.find( enumKey );
|
||||
if ( it != m_enumMap.end() )
|
||||
@ -163,7 +173,7 @@ int AppEnumMapper::enumValue( const std::string& enumKey, int enumIndex ) const
|
||||
return it->second[enumIndex].m_enumVal;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return defaultEnumValue( enumKey );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -39,11 +39,7 @@ public:
|
||||
const QString& uiText,
|
||||
const QStringList& aliases = {} );
|
||||
|
||||
void addDefaultItem( const std::string& enumKey,
|
||||
int enumValue,
|
||||
const QString& text,
|
||||
const QString& uiText,
|
||||
const QStringList& aliases = {} );
|
||||
void setDefault( const std::string& enumKey, int enumValue );
|
||||
|
||||
size_t size( const std::string& enumKey ) const;
|
||||
size_t index( const std::string& enumKey, int enumValue ) const;
|
||||
@ -51,8 +47,8 @@ public:
|
||||
QString uiText( const std::string& enumKey, int enumValue ) const;
|
||||
|
||||
int defaultEnumValue( const std::string& enumKey ) const;
|
||||
int enumValue( const std::string& enumKey, const QString& text ) const;
|
||||
int enumValue( const std::string& enumKey, int enumIndex ) const;
|
||||
int fromText( const std::string& enumKey, const QString& text ) const;
|
||||
int fromIndex( const std::string& enumKey, size_t enumIndex ) const;
|
||||
|
||||
private:
|
||||
std::map<std::string, std::vector<EnumData>> m_enumMap;
|
||||
|
@ -20,6 +20,8 @@ enum class TestEnum2
|
||||
ValueC
|
||||
};
|
||||
|
||||
//#define addItem( enumValue, text, uiText ) addItem( enumValue, #enumValue, text, uiText )
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
@ -30,6 +32,17 @@ void caf::AppEnum<TestEnum>::setUp()
|
||||
addItem( TestEnum::Value3, "VALUE_3", "Val 3" );
|
||||
addItem( TestEnum::Value4, "VALUE_4", "Val 4" );
|
||||
setDefault( TestEnum::Value2 );
|
||||
|
||||
auto instance = caf::AppEnumMapper::instance();
|
||||
instance->addItem( caf::cafTypeName<TestEnum>(), caf::convertToInteger<TestEnum>( TestEnum::Value1 ), "VALUE_1", "Val 1" );
|
||||
instance->addItem( caf::cafTypeName<TestEnum>(), caf::convertToInteger<TestEnum>( TestEnum::Value2 ), "VALUE_2", "Val 2" );
|
||||
instance->addItem( caf::cafTypeName<TestEnum>(), caf::convertToInteger<TestEnum>( TestEnum::Value3 ), "VALUE_3", "Val 3" );
|
||||
instance->addItem( caf::cafTypeName<TestEnum>(), caf::convertToInteger<TestEnum>( TestEnum::Value4 ), "VALUE_4", "Val 4" );
|
||||
instance->setDefault( caf::cafTypeName<TestEnum>(), caf::convertToInteger<TestEnum>( TestEnum::Value2 ) );
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
}
|
||||
|
||||
template <>
|
||||
@ -92,3 +105,18 @@ TEST( PdmEnumMapperTest, ConverEnumToInteger )
|
||||
EXPECT_EQ( enumValue, sourceEnumValue );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( PdmEnumMapperTest, GetUiText )
|
||||
{
|
||||
caf::AppEnumMapper* instance = caf::AppEnumMapper::instance();
|
||||
|
||||
{
|
||||
auto TestEnum_key = caf::cafTypeName<TestEnum>();
|
||||
auto intValue = caf::convertToInteger( TestEnum::Value1 );
|
||||
|
||||
instance->uiText( TestEnum_key, intValue );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user