From 57810ff7577922c3e06af3a769b104613d112db1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 8 Jan 2006 05:30:59 +0000 Subject: [PATCH] CString -> RString --- stepmania/src/ThemeMetric.h | 58 ++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/stepmania/src/ThemeMetric.h b/stepmania/src/ThemeMetric.h index 1f24df96a4..53c5f8a802 100644 --- a/stepmania/src/ThemeMetric.h +++ b/stepmania/src/ThemeMetric.h @@ -18,9 +18,9 @@ public: template class ThemeMetric : public IThemeMetric { -private: - CString m_sGroup; - CString m_sName; +protected: + RString m_sGroup; + RString m_sName; T m_currentValue; bool m_bIsLoaded; @@ -34,7 +34,7 @@ public: * call Load() to set them. This is done to allow initializing cached metrics * in one place for classes that don't receive their m_sName in the constructor * (everything except screens). */ - ThemeMetric( const CString& sGroup = "", const CString& sName = "", bool bAlwaysReload = false ): + ThemeMetric( const RString& sGroup = "", const RString& sName = "", bool bAlwaysReload = false ): m_sGroup( sGroup ), m_sName( sName ), m_bIsLoaded( false ), @@ -60,14 +60,14 @@ public: ThemeManager::Unsubscribe( this ); } - void Load( const CString &sGroup, const CString& sName ) + void Load( const RString &sGroup, const RString& sName ) { m_sGroup = sGroup; m_sName = sName; Read(); } - void ChangeGroup( const CString &sGroup ) + void ChangeGroup( const RString &sGroup ) { m_sGroup = sGroup; Read(); @@ -112,7 +112,7 @@ public: bool operator == ( const T& input ) const { return GetValue() == input; } }; -typedef CString (*MetricName1D)(size_t N); +typedef RString (*MetricName1D)(size_t N); template class ThemeMetric1D : public IThemeMetric @@ -121,15 +121,15 @@ class ThemeMetric1D : public IThemeMetric vector m_metric; public: - ThemeMetric1D( const CString& sGroup, MetricName1D pfn, size_t N ) + ThemeMetric1D( const RString& sGroup, MetricName1D pfn, size_t N ) { Load( sGroup, pfn, N ); } ThemeMetric1D() { - Load( CString(), NULL, 0 ); + Load( RString(), NULL, 0 ); } - void Load( const CString& sGroup, MetricName1D pfn, size_t N ) + void Load( const RString& sGroup, MetricName1D pfn, size_t N ) { m_metric.resize( N ); for( unsigned i=0; i class ThemeMetric2D : public IThemeMetric @@ -156,11 +156,11 @@ class ThemeMetric2D : public IThemeMetric vector m_metric; public: - ThemeMetric2D( const CString& sGroup = "", MetricName2D pfn = NULL, size_t N = 0, size_t M = 0 ) + ThemeMetric2D( const RString& sGroup = "", MetricName2D pfn = NULL, size_t N = 0, size_t M = 0 ) { Load( sGroup, pfn, N, M ); } - void Load( const CString& sGroup, MetricName2D pfn, size_t N, size_t M ) + void Load( const RString& sGroup, MetricName2D pfn, size_t N, size_t M ) { m_metric.resize( N ); for( unsigned i=0; i class ThemeMetricMap : public IThemeMetric { typedef ThemeMetric ThemeMetricT; - map m_metric; + map m_metric; public: - ThemeMetricMap( const CString& sGroup = "", MetricNameMap pfn = NULL, const vector vsValueNames = vector() ) + ThemeMetricMap( const RString& sGroup = "", MetricNameMap pfn = NULL, const vector vsValueNames = vector() ) { Load( sGroup, pfn, vsValueNames ); } - void Load( const CString& sGroup, MetricNameMap pfn, const vector vsValueNames ) + void Load( const RString& sGroup, MetricNameMap pfn, const vector vsValueNames ) { m_metric.clear(); - FOREACH_CONST( CString, vsValueNames, s ) + FOREACH_CONST( RString, vsValueNames, s ) m_metric[*s].Load( sGroup, pfn(*s) ); } void Read() { // HACK: GCC (3.4) takes this and pretty much nothing else. // I don't know why. - for( typename map >::iterator m = m_metric.begin(); m != m_metric.end(); ++m ) + for( typename map >::iterator m = m_metric.begin(); m != m_metric.end(); ++m ) m->second.Read(); } - const T& GetValue( CString s ) const + const T& GetValue( RString s ) const { // HACK: GCC (3.4) takes this and pretty much nothing else. // I don't know why. - typename map >::const_iterator iter = m_metric.find(s); + typename map >::const_iterator iter = m_metric.find(s); ASSERT( iter != m_metric.end() ); return iter->second.GetValue(); } @@ -223,7 +223,7 @@ class ThemeMetricEnum : public ThemeMetric { public: ThemeMetricEnum() : ThemeMetric() {} - ThemeMetricEnum( const CString& sGroup, const CString& sName ) : ThemeMetric(sGroup,sName) {} + ThemeMetricEnum( const RString& sGroup, const RString& sName ) : ThemeMetric(sGroup,sName) {} T GetValue() const { return (T)ThemeMetric::GetValue(); } bool operator ==( T other ) const { return GetValue() == other; } }; @@ -242,9 +242,9 @@ public: template class DynamicThemeMetric : public IThemeMetric { -private: - CString m_sGroup; - CString m_sName; +protected: + RString m_sGroup; + RString m_sName; mutable T m_currentValue; bool m_bIsLoaded; LuaReference m_Value; @@ -254,7 +254,7 @@ public: * call Load() to set them. This is done to allow initializing cached metrics * in one place for classes that don't receive their m_sName in the constructor * (everything except screens). */ - DynamicThemeMetric( const CString& sGroup = "", const CString& sName = "" ): + DynamicThemeMetric( const RString& sGroup = "", const RString& sName = "" ): m_sGroup( sGroup ), m_sName( sName ), m_bIsLoaded( false ) @@ -279,14 +279,14 @@ public: ThemeManager::Unsubscribe( this ); } - void Load( const CString &sGroup, const CString& sName ) + void Load( const RString &sGroup, const RString& sName ) { m_sGroup = sGroup; m_sName = sName; Read(); } - void ChangeGroup( const CString &sGroup ) + void ChangeGroup( const RString &sGroup ) { m_sGroup = sGroup; Read(); @@ -296,7 +296,7 @@ public: { if( m_sName != "" && THEME && THEME->IsThemeLoaded() ) { - CString sExpression; + RString sExpression; THEME->GetMetric( m_sGroup, m_sName, sExpression ); Lua *L = LUA->Get();