本文整理汇总了C++中SimpleString::CStr方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleString::CStr方法的具体用法?C++ SimpleString::CStr怎么用?C++ SimpleString::CStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleString
的用法示例。
在下文中一共展示了SimpleString::CStr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetColorGradingTexture
void EldritchGame::SetColorGradingTexture( const SimpleString& TextureFilename )
{
XTRACE_FUNCTION;
m_ColorGradingTexture = TextureFilename;
if( m_PostQuad )
{
EldritchFramework* const pFramework = EldritchFramework::GetInstance();
ASSERT( pFramework );
TextureManager* const pTextureManager = pFramework->GetRenderer()->GetTextureManager();
ASSERT( pTextureManager );
m_PostQuad->SetTexture( 1, pTextureManager->GetTexture( TextureFilename.CStr() ) );
}
}
示例2: QueueNextSequence
void MusicManager::QueueNextSequence()
{
FreeSequence( m_NextSequence );
STATICHASH( NextSequence );
STATICHASH( NumTransitions );
STATICHASH( File );
MAKEHASHFROM( DefinitionName, m_CurrentSequence.m_DefinitionName );
SimpleString NextSequence = ConfigManager::GetString( sNextSequence, "", sDefinitionName );
// Try all the mood transitions; if none match, it'll just fall back to NextSequence
int NumTransitions = ConfigManager::GetInt( sNumTransitions, 0, sDefinitionName );
for( int i = 0; i < NumTransitions; ++i )
{
SimpleString TransitionMood = ConfigManager::GetSequenceString( "TransitionMood%d", i, "", sDefinitionName );
SimpleString TransitionSequence = ConfigManager::GetSequenceString( "TransitionSeq%d", i, "", sDefinitionName );
if( TransitionMood == m_Mood )
{
NextSequence = TransitionSequence;
break;
}
}
if( NextSequence != "" )
{
SimpleString NextFilename = ConfigManager::GetString( sFile, "", NextSequence );
if( NextFilename != "" )
{
SSoundInit SoundInit;
SoundInit.m_Filename = NextFilename.CStr();
SoundInit.m_IsStream = true;
SoundInit.m_IsLooping = false;
SoundInit.m_Is3D = false;
SoundInit.m_Category = "Music";
SoundInit.m_Priority = ESP_High;
m_NextSequence.m_Sound = m_AudioSystem->GetSoundManager()->GetSound( SoundInit, NextSequence );
m_NextSequence.m_Instance = m_NextSequence.m_Sound->CreateSoundInstance();
m_AudioSystem->AddSoundInstance( m_NextSequence.m_Instance );
m_NextSequence.m_Instance->Tick(); // Tick to apply all properties in advance
m_NextSequence.m_DefinitionName = NextSequence;
}
}
}
示例3: Surface
/*virtual*/ void Framework3D::Initialize()
{
XTRACE_FUNCTION;
m_IsInitializing = true;
#if BUILD_SDL
const int Error = SDL_Init( SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE );
ASSERT( 0 == Error );
Unused( Error );
if( 0 != Error )
{
PRINTF( "SDL_Init: %s\n", SDL_GetError() );
}
SDL_DisableScreenSaver();
#endif
STATICHASH( Framework );
#if BUILD_WINDOWS
#if BUILD_FINAL
STATICHASH( ShowConsole );
const bool ShowConsole = ConfigManager::GetBool( sShowConsole, false, sFramework );
if( ShowConsole )
#endif
{
Console::GetInstance()->SetPos( 0, 0 );
}
#endif
STATICHASH( UseRandomSeed );
const bool UseRandomSeed = ConfigManager::GetBool( sUseRandomSeed, false, sFramework );
STATICHASH( RandomSeed );
const int RandomSeed = ConfigManager::GetInt( sRandomSeed, 0, sFramework );
if( UseRandomSeed )
{
Math::SeedGenerator( RandomSeed );
}
else
{
Math::SeedGenerator();
}
STATICHASH( UseFixedFrameTime );
m_UseFixedFrameTime = ConfigManager::GetBool( sUseFixedFrameTime, true, sFramework );
STATICHASH( FixedFrameTime );
m_FixedFrameTime = ConfigManager::GetFloat( sFixedFrameTime, 1.0f / 60.0f, sFramework );
STATICHASH( FramesLimit );
const int FramesLimit = ConfigManager::GetInt( sFramesLimit, 5, sFramework );
m_FrameTimeLimit = m_FixedFrameTime * static_cast<float>( FramesLimit );
STATICHASH( DoVideoCapture );
m_DoVideoCapture = ConfigManager::GetBool( sDoVideoCapture, false, sFramework );
STATICHASH( VideoCaptureFixedFrameTime );
m_VideoCaptureFixedFrameTime = ConfigManager::GetFloat( sVideoCaptureFixedFrameTime, 1.0f / 30.0f, sFramework );
uint DisplayWidth = 0;
uint DisplayHeight = 0;
SimpleString WindowTitle;
// Loads display parameters from config, so GetInitialDisplaySize can use that.
m_Display = new Display;
// Make sure that we use a supported resolution regardless of what the config file said.
const SDisplayMode BestDisplayMode = m_Display->GetBestDisplayMode( m_Display->m_Width, m_Display->m_Height );
m_Display->SetResolution( BestDisplayMode.Width, BestDisplayMode.Height );
uint WindowIcon = 0;
GetInitialWindowIcon( WindowIcon );
GetInitialDisplaySize( DisplayWidth, DisplayHeight );
GetInitialWindowTitle( WindowTitle );
CreateSplashWindow( WindowIcon, WindowTitle.CStr() );
m_Window = new Window;
#if BUILD_WINDOWS_NO_SDL
DWORD WindowStyle = 0;
if( m_Display->m_Fullscreen ||
( m_Display->m_ScreenWidth == m_Display->m_Width &&
m_Display->m_ScreenHeight == m_Display->m_Height ) )
{
WindowStyle = WS_POPUP;
}
else
{
WindowStyle = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
}
m_Window->Init( WindowTitle.CStr(), "Class1", WindowStyle, 0, DisplayWidth, DisplayHeight, m_hInstance, WindowProc, WindowIcon, m_Display->m_ScreenWidth, m_Display->m_ScreenHeight );
#elif BUILD_SDL
uint WindowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN;
if( m_Display->m_Fullscreen ||
( m_Display->m_ScreenWidth == m_Display->m_Width &&
//.........这里部分代码省略.........
示例4: Patcher_GetNextPatchFile
void Patcher_GetNextPatchFile()
{
ASSERT( g_FilesInManifest.Size() );
// Iterate to find the next valid patch file
for( ; g_NextPatchFileIndex < g_FilesInManifest.Size(); ++g_NextPatchFileIndex )
{
SManifestFile& PatchFile = g_FilesInManifest[ g_NextPatchFileIndex ];
SimpleString PatchFilename = PatchFile.m_Filename;
if( FileUtil::Exists( PatchFilename.CStr() ) )
{
FileStream ExtantFile( PatchFilename.CStr(), FileStream::EFM_Read );
int ExtantSize = ExtantFile.Size();
uint32 ExtantChecksum = Checksum::Adler32( ExtantFile );
SimpleString ExtantLengthString = SimpleString::PrintF( "%d", ExtantSize );
SimpleString ExtantChecksumString = SimpleString::PrintF( "0x%08X", ExtantChecksum );
if( ExtantLengthString == PatchFile.m_Length && ExtantChecksumString == PatchFile.m_Checksum )
{
AddStatus( SimpleString::PrintF( "%s is up to date.", PatchFilename.CStr() ), g_StatusColor );
}
else
{
// This file isn't up to date. Patch it!
break;
}
}
else
{
// This file isn't on disk. Get it!
break;
}
}
if( g_NextPatchFileIndex < g_FilesInManifest.Size() )
{
SimpleString PatchFile = g_FilesInManifest[ g_NextPatchFileIndex ].m_Filename;
AddStatus( SimpleString::PrintF( "Getting %s...", PatchFile.CStr() ), g_StatusColor );
STATICHASH( ContentSyncer );
STATICHASH( PatcherHost );
STATICHASH( PatcherContentPath );
g_Patcher_GettingVersionNumber = false;
g_Patcher_GettingManifestFile = false;
g_Patcher_GettingNextPatchFile = true;
g_Patcher_WaitingToConnect = true;
g_Patcher_WaitingToReceive = false;
HTTPSocket::SSocketInit SocketInit;
SocketInit.m_CloseConnection = true;
SocketInit.m_HostName = ConfigManager::GetString( sPatcherHost, "", sContentSyncer );
SocketInit.m_Path = SimpleString::PrintF( "%s%s", ConfigManager::GetString( sPatcherContentPath, "", sContentSyncer ), PatchFile.CStr() );
SocketInit.m_Async = true;
g_HTTPSocket->Connect( SocketInit );
}
else
{
// Nothing left to patch! Handle the wrap up.
FinishPatching();
}
}
示例5: DecorateWorldFileName
SimpleString EldritchGame::DecorateWorldFileName( const SimpleString& LevelName ) const
{
XTRACE_FUNCTION;
const SimpleString SaveLoadPath = EldritchFramework::GetInstance()->GetSaveLoadPath();
const SimpleString DecoratedFileName = SimpleString::PrintF( "%s%s.eldritchworldsave", SaveLoadPath.CStr(), LevelName.CStr() );
return DecoratedFileName;
}
示例6: InitializeFromDefinition
void UIWidgetImage::InitializeFromDefinition( const SimpleString& DefinitionName )
{
UIWidget::InitializeFromDefinition( DefinitionName );
MAKEHASH( DefinitionName );
MAKEHASH( m_Archetype );
STATICHASH( DisplayWidth );
const float DisplayWidth = ConfigManager::GetFloat( sDisplayWidth );
const float ParentWidth = m_OriginParent ? m_OriginParent->GetWidth() : DisplayWidth;
const float ParentX = m_OriginParent ? Ceiling( m_OriginParent->GetX() ) : 0.0f;
STATICHASH( DisplayHeight );
const float DisplayHeight = ConfigManager::GetFloat( sDisplayHeight );
const float ParentHeight = m_OriginParent ? m_OriginParent->GetHeight() : DisplayHeight;
const float ParentY = m_OriginParent ? Ceiling( m_OriginParent->GetY() ) : 0.0f;
STATICHASH( PixelX );
STATICHASH( ScreenX );
float X = Pick(
ConfigManager::GetArchetypeFloat( sPixelX, sm_Archetype, 0.0f, sDefinitionName ),
ParentWidth * ConfigManager::GetArchetypeFloat( sScreenX, sm_Archetype, 0.0f, sDefinitionName ) );
STATICHASH( PixelY );
STATICHASH( ScreenY );
float Y = Pick(
ConfigManager::GetArchetypeFloat( sPixelY, sm_Archetype, 0.0f, sDefinitionName ),
ParentHeight * ConfigManager::GetArchetypeFloat( sScreenY, sm_Archetype, 0.0f, sDefinitionName ) );
STATICHASH( PixelWidth );
STATICHASH( ScreenWidth );
float Width = Pick(
ConfigManager::GetArchetypeFloat( sPixelWidth, sm_Archetype, 0.0f, sDefinitionName ),
ParentWidth * ConfigManager::GetArchetypeFloat( sScreenWidth, sm_Archetype, 0.0f, sDefinitionName ) );
STATICHASH( PixelHeight );
STATICHASH( ScreenHeight );
float Height = Pick(
ConfigManager::GetArchetypeFloat( sPixelHeight, sm_Archetype, 0.0f, sDefinitionName ),
ParentHeight * ConfigManager::GetArchetypeFloat( sScreenHeight, sm_Archetype, 0.0f, sDefinitionName ) );
// Adjust for desired aspect ratio if one dimension is not given
// (This is used to size images using ScreenWidth or ScreenHeight
// properly regardless of screen aspect ratio.
STATICHASH( AspectRatio );
const float AspectRatio = ConfigManager::GetArchetypeFloat( sAspectRatio, sm_Archetype, 1.0f, sDefinitionName );
if( Width == 0.0f )
{
Width = Height * AspectRatio;
}
else if( Height == 0.0f )
{
Height = Width / AspectRatio;
}
// Offset relative to resolved image dimensions if specified
STATICHASH( ImageX );
X = Pick( X, ConfigManager::GetArchetypeFloat( sImageX, sm_Archetype, 0.0f, sDefinitionName ) * Width );
STATICHASH( ImageY );
Y = Pick( Y, ConfigManager::GetArchetypeFloat( sImageY, sm_Archetype, 0.0f, sDefinitionName ) * Height );
AdjustDimensionsToParent( X, Y, Width, Height, ParentX, ParentY, ParentWidth, ParentHeight );
GetPositionFromOrigin( X, Y, Width, Height );
STATICHASH( ClampToPixelGrid );
if( ConfigManager::GetArchetypeBool( sClampToPixelGrid, sm_Archetype, true, sDefinitionName ) )
{
m_TopLeft.x = Round( m_TopLeft.x );
m_TopLeft.y = Round( m_TopLeft.y );
}
// Offset to properly align on pixel grid.
const float PixelGridOffset = GetPixelGridOffset();
m_TopLeft.x -= PixelGridOffset;
m_TopLeft.y -= PixelGridOffset;
// If LoadImage is false, we're expecting to dynamically set the texture in code somewhere
STATICHASH( LoadImage );
if( ConfigManager::GetArchetypeBool( sLoadImage, sm_Archetype, true, sDefinitionName ) )
{
STATICHASH( Image );
SetTexture( ConfigManager::GetArchetypeString( sImage, sm_Archetype, DEFAULT_TEXTURE, sDefinitionName ) );
}
m_Dimensions = Vector2( Width, Height );
STATICHASH( Calibration );
m_Calibration = ConfigManager::GetArchetypeBool( sCalibration, sm_Archetype, false, sDefinitionName );
STATICHASH( MaterialOverride );
const SimpleString DefaultMaterial( "Material_HUD" );
m_Material = ConfigManager::GetArchetypeString( sMaterialOverride, sm_Archetype, DefaultMaterial.CStr(), sDefinitionName );
UpdateRender();
}
示例7: View
/*virtual*/ void EldritchFramework::Initialize() {
XTRACE_FUNCTION;
XTRACE_BEGIN(PreFramework3D);
ReverseHash::Initialize();
PackStream::StaticAddPackageFile("eldritch-base.cpk");
FrameworkUtil::MinimalLoadConfigFiles("Config/default.ccf");
InitializePackages();
InitializeDLC();
// Load prefs over anything in the defaults.
LoadPrefsConfig();
LOADPRINTLEVELS;
STATICHASH(Version);
STATICHASH(ContentSyncer);
SimpleString LocalVersion =
ConfigManager::GetString(sVersion, "", sContentSyncer);
PRINTF("Version: %s\n", LocalVersion.CStr());
XTRACE_BEGIN(InitializeFactories);
PRINTF("Initializing factories...\n");
PRINTF("Initializing SDP factories.\n");
SDPFactory::InitializeBaseFactories();
#define ADDSDPFACTORY(type) \
SDPFactory::RegisterSDPFactory(#type, SDP##type::Factory);
#include "eldritchsdps.h"
#undef ADDSDPFACTORY
PRINTF("Initializing UI factories.\n");
UIFactory::InitializeBaseFactories();
#define ADDUISCREENFACTORY(type) \
UIFactory::RegisterUIScreenFactory(#type, UIScreen##type::Factory);
#include "eldritchuiscreens.h"
#undef ADDUISCREENFACTORY
PRINTF("Initializing anim event factories.\n");
#define ADDANIMEVENTFACTORY(type) \
AnimEventFactory::GetInstance()->Register(#type, AnimEvent##type::Factory);
#include "eldritchanimevents.h"
#undef ADDANIMEVENTFACTORY
PRINTF("Initializing PE factories.\n");
WBParamEvaluatorFactory::InitializeBaseFactories();
#define ADDWBPEFACTORY(type) \
WBParamEvaluatorFactory::RegisterFactory(#type, WBPE##type::Factory);
#include "rodinwbpes.h"
#include "eldritchwbpes.h"
#undef ADDWBPEFACTORY
PRINTF("Initializing action factories.\n");
WBActionFactory::InitializeBaseFactories();
#define ADDWBACTIONFACTORY(type) \
WBActionFactory::RegisterFactory(#type, WBAction##type::Factory);
#include "uiwbactions.h"
#include "rodinwbactions.h"
#include "eldritchwbactions.h"
#undef ADDWBPEFACTORY
PRINTF("Initializing BT factories.\n");
RodinBTNodeFactory::InitializeBaseFactories();
#define ADDRODINBTNODEFACTORY(type) \
RodinBTNodeFactory::RegisterFactory(#type, RodinBTNode##type::Factory);
#include "eldritchrodinbtnodes.h"
#undef ADDRODINBTNODEFACTORY
// Initialize core and Eldritch Workbench component factories.
PRINTF("Initializing component factories.\n");
WBComponent::InitializeBaseFactories();
#define ADDWBCOMPONENT(type) \
WBComponent::RegisterWBCompFactory(#type, WBComp##type::Factory);
#include "rodinwbcomponents.h"
#include "eldritchwbcomponents.h"
#undef ADDWBCOMPONENT
XTRACE_END;
PRINTF("Factories initialized.\n");
// Create input system before framework so it will exist for UI. But don't
// attach devices yet, as they don't exist.
PRINTF("Initializing input system.\n");
m_InputSystem = new InputSystem;
m_InputSystem->Initialize("EldritchInput");
XTRACE_END;
Framework3D::Initialize();
STATICHASH(DisplayWidth);
STATICHASH(DisplayHeight);
m_DisplayWidth = ConfigManager::GetInt(sDisplayWidth);
m_DisplayHeight = ConfigManager::GetInt(sDisplayHeight);
#if BUILD_WINDOWS
m_CheckForUpdates = new CheckForUpdates(m_UIManager);
#endif
//.........这里部分代码省略.........
示例8: InitializeFromDefinition
//.........这里部分代码省略.........
ScreenX = Column0X;
FocusShiftLeft = -RightColumnSize;
FocusShiftRight = LeftColumnSize;
} else {
// Display mode is in right column
ScreenY = YBase + (DisplayModeIndex - LeftColumnSize) * YStep;
ScreenX = Column1X;
FocusShiftLeft = -LeftColumnSize;
FocusShiftRight = RightColumnSize;
}
if (DisplayModeIndex == 0) {
// Display mode is on top left
FocusShiftUp = -(RightColumnSize + 1);
} else if (DisplayModeIndex == (LeftColumnSize - 1)) {
// Display mode is on bottom left
FocusShiftDown = (RightColumnSize + 1);
// If columns are the same size (*including* the back button),
// this widget doesn't have a pair in the right column.
if (LeftColumnSize == RightColumnSize) {
// Setting focus override to 0 uses the screen's shift values, so loop
// instead.
FocusShiftLeft = -(NumDisplayModes + 1);
FocusShiftRight = (NumDisplayModes + 1);
}
} else if (DisplayModeIndex == LeftColumnSize) {
// Display mode is on top right left
FocusShiftUp = -(LeftColumnSize + 1);
}
// Back button shift down is handled below this loop.
const SimpleString NewDefinitionName =
SimpleString::PrintF("_Res%d", DisplayModeIndex);
// HACKHACK: Insert the UTF-8 codes for the U+00D7 (multiplication sign)
const SimpleString ResolutionString = SimpleString::PrintF(
"%d \xc3\x97 %d", DisplayMode.Width, DisplayMode.Height);
MAKEHASH(NewDefinitionName);
STATICHASH(UIWidgetType);
ConfigManager::SetString(sUIWidgetType, "Text", sNewDefinitionName);
ConfigManager::SetString(sArchetype, ArchetypeName, sNewDefinitionName);
ConfigManager::SetString(sParent, Parent, sNewDefinitionName);
STATICHASH(String);
ConfigManager::SetString(sString, ResolutionString.CStr(),
sNewDefinitionName);
STATICHASH(PixelX);
ConfigManager::SetFloat(sPixelX, ScreenX, sNewDefinitionName);
STATICHASH(PixelY);
ConfigManager::SetFloat(sPixelY, ScreenY, sNewDefinitionName);
STATICHASH(FocusShiftUp);
ConfigManager::SetInt(sFocusShiftUp, FocusShiftUp, sNewDefinitionName);
STATICHASH(FocusShiftDown);
ConfigManager::SetInt(sFocusShiftDown, FocusShiftDown, sNewDefinitionName);
STATICHASH(FocusShiftLeft);
ConfigManager::SetInt(sFocusShiftLeft, FocusShiftLeft, sNewDefinitionName);
STATICHASH(FocusShiftRight);
ConfigManager::SetInt(sFocusShiftRight, FocusShiftRight,
sNewDefinitionName);
UIWidget* const pResWidget =
UIFactory::CreateWidget(NewDefinitionName, this);
ASSERT(pResWidget);
pResWidget->m_Callback = m_Callback;
AddWidget(pResWidget);
m_ResMap[NewDefinitionName] = DisplayMode;
}
STATIC_HASHED_STRING(SetResBackButton);
UIWidget* const pBackButtonWidget = GetWidget(sSetResBackButton);
ASSERT(pBackButtonWidget);
pBackButtonWidget->m_FocusShiftLeft = -(NumDisplayModes + 1);
pBackButtonWidget->m_FocusShiftRight = (NumDisplayModes + 1);
pBackButtonWidget->m_FocusShiftDown = (LeftColumnSize + 1);
UpdateRender();
// Initialize focus to the first element (so that we're never unfocused,
// because that doesn't make sense for controllers).
if (m_FocusWidgets.Size() > 0) {
m_FocusedWidget = m_FocusWidgets[0];
// NOTE: Intentionally not calling SetFocus here, so effects don't happen;
// we
// just need an initial focus for controllers, it's not really *getting*
// focus
}
}
示例9: GetInheritedHash
/*static*/ HashedString ConfigManager::GetInheritedSequenceHash( const SimpleString& FormatName, int Index, const HashedString& Default /*= HashedString::NullString*/, const STRING_TYPE& Context /*= EmptyContext*/ )
{
return GetInheritedHash( SimpleString::PrintF( FormatName.CStr(), Index ), Default, Context );
}
示例10: GetInheritedFloat
/*static*/ float ConfigManager::GetInheritedSequenceFloat( const SimpleString& FormatName, int Index, float Default /*= 0.0f*/, const STRING_TYPE& Context /*= EmptyContext*/ )
{
return GetInheritedFloat( SimpleString::PrintF( FormatName.CStr(), Index ), Default, Context );
}
示例11: GetInheritedBool
/*static*/ bool ConfigManager::GetInheritedSequenceBool( const SimpleString& FormatName, int Index, bool Default /*= false*/, const STRING_TYPE& Context /*= EmptyContext*/ )
{
return GetInheritedBool( SimpleString::PrintF( FormatName.CStr(), Index ), Default, Context );
}
示例12: GetArchetypeInt
/*static*/ int ConfigManager::GetArchetypeSequenceInt( const SimpleString& FormatName, int Index, const STRING_TYPE& Archetype, int Default /*= 0*/, const STRING_TYPE& Context /*= EmptyContext*/ )
{
return GetArchetypeInt( SimpleString::PrintF( FormatName.CStr(), Index ), Archetype, Default, Context );
}
示例13: MemoryStream
/*static*/ void ConfigManager::LoadTiny( const SimpleString& TinyString )
{
ConfigParser::ParseTiny( MemoryStream( const_cast< char* >( TinyString.CStr() ), TinyString.Length() + 1 ) );
}
示例14: Parse
//.........这里部分代码省略.........
}
else
{
bool ClosedString = false;
InnerParse( c, StrMark, Token.m_TokenString, LineCount, Token.m_TokenType, &ClosedString );
if( ClosedString )
{
Tokens.PushBack( Token );
DEBUGCATPRINTF( "Core", 2, "%s: %s\n", SToken::m_TokenNames[ Token.m_TokenType ], Token.m_TokenString.GetData() );
Token.m_TokenString.Clear();
Token.m_TokenType = SToken::ET_None;
}
}
}
SimpleString Context = "";
// Tokens are made, now create config vars
for( uint i = 0; i < Tokens.Size(); ++i )
{
SToken& NameToken = Tokens[i];
SimpleString Name = "";
const char* ValueString = NULL;
if( NameToken.m_TokenType == SToken::ET_Name )
{
Name = NameToken.m_TokenString.GetData();
ASSERT( Tokens[ i + 1 ].m_TokenType == SToken::ET_Equals );
SToken& ValueToken = Tokens[ i + 2 ];
ValueString = ValueToken.m_TokenString.GetData();
if( Context != "" )
{
CATPRINTF( "Core", 2, "%s:", Context.CStr() );
}
CATPRINTF( "Core", 2, "%s: %s: %s\n", Name.CStr(), SToken::m_TokenNames[ ValueToken.m_TokenType ], ValueString );
switch( ValueToken.m_TokenType )
{
case SToken::ET_Bool:
{
// Just use the first character to determine truth
bool Value = false;
char first = ValueString[0];
if( first == 't' || first == 'T' )
{
Value = true;
}
ConfigManager::SetBool( Name, Value, Context );
}
break;
case SToken::ET_Int:
{
int Value = atoi( ValueString );
ConfigManager::SetInt( Name, Value, Context );
}
break;
case SToken::ET_Counter:
{
List<int>::Iterator NextCounterIter = ArrayCounters.Front();
( *NextCounterIter )++; // Add one to the last value we incremented, and that's the total for this array
ConfigManager::SetInt( Name, *NextCounterIter, Context );
ArrayCounters.PopFront();
}
break;
case SToken::ET_Float:
示例15: Report
void WBCompState::Report() const {
Super::Report();
const SimpleString State = ReverseHash::ReversedHash(m_State);
PRINTF(WBPROPERTY_REPORT_PREFIX "Current State: %s\n", State.CStr());
}