📄 globalstorage.cpp
字号:
#include <lang/GlobalStorage.h>
#ifdef __SYMBIAN32__
#include <e32std.h>
#endif
#ifdef __SERIES60_3X__
#include <e32svr.h>
#endif
#include <string.h>
#include <config.h>
namespace lang
{
#ifndef __SYMBIAN32__
GlobalStorage GlobalStorage::sm_instance;
#elif defined(__SERIES60_3X__)
static GlobalStorage s_instance;
#endif
GlobalStorage::GlobalStorage()
{
// a bit ugly but this class contains only regular pointers
// and we don't want to end up forgetting to initialize some pointer
memset( this, 0, sizeof(GlobalStorage) );
}
#ifdef __SYMBIAN32__
GlobalStorage& GlobalStorage::get()
{
#ifdef __SERIES60_3X__
return s_instance;
#else
GlobalStorage* gs = reinterpret_cast<GlobalStorage*>( Dll::Tls() );
if ( !gs )
{
gs = new GlobalStorage;
Dll::SetTls( gs );
}
return *gs;
#endif
}
#endif // __SYMBIAN32__
} // lang
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -