本文整理汇总了C++中stdstr类的典型用法代码示例。如果您正苦于以下问题:C++ stdstr类的具体用法?C++ stdstr怎么用?C++ stdstr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了stdstr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: srcGfxPlugin
bool CPlugins::CopyPlugins(const stdstr & DstDir) const
{
//Copy GFX Plugin
CPath srcGfxPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
CPath dstGfxPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
dstGfxPlugin.SetName(stdstr_f("%s-copy", dstGfxPlugin.GetName().c_str()).c_str());
if (!dstGfxPlugin.DirectoryExists())
{
dstGfxPlugin.DirectoryCreate();
}
if (!srcGfxPlugin.CopyTo(dstGfxPlugin))
{
WriteTrace(TracePlugins, TraceError, "failed to copy %s to %s", (const char *)srcGfxPlugin, (const char *)dstGfxPlugin);
return false;
}
//Copy m_Audio Plugin
CPath srcAudioPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
CPath dstAudioPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
dstAudioPlugin.SetName(stdstr_f("%s-copy", dstAudioPlugin.GetName().c_str()).c_str());
if (!dstAudioPlugin.DirectoryExists())
{
dstAudioPlugin.DirectoryCreate();
}
if (!srcAudioPlugin.CopyTo(dstAudioPlugin))
{
return false;
}
//Copy RSP Plugin
CPath srcRSPPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
CPath dstRSPPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
dstRSPPlugin.SetName(stdstr_f("%s-copy", dstRSPPlugin.GetName().c_str()).c_str());
if (!dstRSPPlugin.DirectoryExists())
{
dstRSPPlugin.DirectoryCreate();
}
if (!srcRSPPlugin.CopyTo(dstRSPPlugin))
{
return false;
}
//Copy Controller Plugin
CPath srcContPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
CPath dstContPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
dstContPlugin.SetName(stdstr_f("%s-copy", dstContPlugin.GetName().c_str()).c_str());
if (!dstContPlugin.DirectoryExists())
{
dstContPlugin.DirectoryCreate();
}
if (!srcContPlugin.CopyTo(dstContPlugin))
{
return false;
}
return true;
}
开发者ID:JunielKatarn,项目名称:Project64CI,代码行数:56,代码来源:PluginClass.cpp
示例2: TraceModule
const char * TraceModule(uint32_t module)
{
ModuleNameMap::const_iterator itr = g_ModuleNames.find(module);
if (itr != g_ModuleNames.end())
{
return itr->second.c_str();
}
static stdstr Unknown;
Unknown.Format("Unknown (%d)", module);
return Unknown.c_str();
}
开发者ID:DaMan69,项目名称:project64,代码行数:11,代码来源:Trace.cpp
示例3: CopyPlugins
bool CPlugins::CopyPlugins ( const stdstr & DstDir ) const
{
//Copy GFX Plugin
CPath srcGfxPlugin(m_PluginDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
CPath dstGfxPlugin(DstDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
if (CopyFile(srcGfxPlugin,dstGfxPlugin,false) == 0)
{
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstGfxPlugin.DirectoryCreate(); }
if (!CopyFile(srcGfxPlugin,dstGfxPlugin,false))
{
return false;
}
}
//Copy m_Audio Plugin
CPath srcAudioPlugin(m_PluginDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
CPath dstAudioPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
if (CopyFile(srcAudioPlugin,dstAudioPlugin,false) == 0) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstAudioPlugin.DirectoryCreate(); }
if (!CopyFile(srcAudioPlugin,dstAudioPlugin,false))
{
return false;
}
}
//Copy RSP Plugin
CPath srcRSPPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
CPath dstRSPPlugin(DstDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
if (CopyFile(srcRSPPlugin,dstRSPPlugin,false) == 0) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstRSPPlugin.DirectoryCreate(); }
if (!CopyFile(srcRSPPlugin,dstRSPPlugin,false))
{
return false;
}
}
//Copy Controller Plugin
CPath srcContPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
CPath dstContPlugin(DstDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
if (!srcContPlugin.CopyTo(dstContPlugin))
{
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstContPlugin.DirectoryCreate(); }
if (!CopyFile(srcContPlugin,dstContPlugin,false))
{
DWORD dwError = GetLastError();
dwError = dwError;
return false;
}
}
return true;
}
开发者ID:aschwant,项目名称:project64,代码行数:52,代码来源:Plugin+Class.cpp
示例4: CopyPlugins
bool CPlugins::CopyPlugins(const stdstr & DstDir) const
{
//Copy GFX Plugin
CPath srcGfxPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
CPath dstGfxPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
if (!dstGfxPlugin.DirectoryExists())
{
dstGfxPlugin.DirectoryCreate();
}
if (!srcGfxPlugin.CopyTo(dstGfxPlugin))
{
return false;
}
//Copy m_Audio Plugin
CPath srcAudioPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
CPath dstAudioPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
if (!dstAudioPlugin.DirectoryExists())
{
dstAudioPlugin.DirectoryCreate();
}
if (!srcAudioPlugin.CopyTo(dstAudioPlugin))
{
return false;
}
//Copy RSP Plugin
CPath srcRSPPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
CPath dstRSPPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
if (!dstRSPPlugin.DirectoryExists())
{
dstRSPPlugin.DirectoryCreate();
}
if (!srcRSPPlugin.CopyTo(dstRSPPlugin))
{
return false;
}
//Copy Controller Plugin
CPath srcContPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
CPath dstContPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
if (!dstContPlugin.DirectoryExists())
{
dstContPlugin.DirectoryCreate();
}
if (!srcContPlugin.CopyTo(dstContPlugin))
{
return false;
}
return true;
}
开发者ID:NickG22293,项目名称:project64,代码行数:52,代码来源:PluginClass.cpp
示例5: TraceSeverity
const char * TraceSeverity(uint8_t severity)
{
switch (severity)
{
case TraceError: return "Error";
case TraceWarning: return "Warning";
case TraceNotice: return "Notice";
case TraceInfo: return "Info";
case TraceDebug: return "Debug";
case TraceVerbose: return "Verbose";
}
static stdstr Unknown;
Unknown.Format("Unknown (%d)", (int32_t)severity);
return Unknown.c_str();
}
开发者ID:DaMan69,项目名称:project64,代码行数:16,代码来源:Trace.cpp
示例6: LoadPlugin
static void LoadPlugin (SettingID PluginSettingID, SettingID PluginVerSettingID, plugin_type * & plugin, const char * PluginDir, stdstr & FileName, TraceType TraceLevel, const char * type)
{
if (plugin != NULL)
{
return;
}
FileName = g_Settings->LoadStringVal(PluginSettingID);
CPath PluginFileName(PluginDir,FileName.c_str());
plugin = new plugin_type();
if (plugin)
{
WriteTraceF(TraceLevel,__FUNCTION__ ": %s Loading (%s): Starting",type,(LPCTSTR)PluginFileName);
if (plugin->Load(PluginFileName))
{
WriteTraceF(TraceLevel,__FUNCTION__ ": %s Current Ver: %s",type,plugin->PluginName());
g_Settings->SaveString(PluginVerSettingID,plugin->PluginName());
}
else
{
WriteTraceF(TraceError,__FUNCTION__ ": Failed to load %s",(LPCTSTR)PluginFileName);
delete plugin;
plugin = NULL;
}
WriteTraceF(TraceLevel,__FUNCTION__ ": %s Loading Done",type);
}
else
{
WriteTraceF(TraceError,__FUNCTION__ ": Failed to allocate %s plugin",type);
}
}
开发者ID:aschwant,项目名称:project64,代码行数:30,代码来源:Plugin+Class.cpp
示例7: CreateFile
stdstr CMainMenu::GetFileLastMod (stdstr FileName)
{
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, FILE_SHARE_READ,NULL,
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
return "";
}
FILETIME CreationTime, LastAccessTime, LastWriteTime;
stdstr LastMod;
if (GetFileTime(hFile,&CreationTime,&LastAccessTime,&LastWriteTime))
{
SYSTEMTIME stUTC, stLocal;
// Convert the last-write time to local time.
FileTimeToSystemTime(&LastWriteTime, &stUTC);
SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
LastMod.Format(" [%d/%02d/%02d %02d:%02d]",
stLocal.wYear, stLocal.wMonth, stLocal.wDay,stLocal.wHour, stLocal.wMinute);
}
CloseHandle(hFile);
return LastMod;
}
开发者ID:Anonymous2,项目名称:project64,代码行数:25,代码来源:Main+Menu+Class.cpp
示例8: LoadPlugin
static void LoadPlugin(SettingID PluginSettingID, SettingID PluginVerSettingID, plugin_type * & plugin, const char * PluginDir, stdstr & FileName, TraceModuleProject64 TraceLevel, const char * type, bool IsCopy)
{
if (plugin != NULL)
{
return;
}
FileName = g_Settings->LoadStringVal(PluginSettingID);
CPath PluginFileName(PluginDir, FileName.c_str());
if (IsCopy)
{
PluginFileName.SetName(stdstr_f("%s-copy", PluginFileName.GetName().c_str()).c_str());
}
plugin = new plugin_type();
if (plugin)
{
WriteTrace(TraceLevel, TraceDebug, "%s Loading (%s): Starting", type, (const char *)PluginFileName);
if (plugin->Load(PluginFileName))
{
WriteTrace(TraceLevel, TraceDebug, "%s Current Ver: %s", type, plugin->PluginName());
g_Settings->SaveString(PluginVerSettingID, plugin->PluginName());
}
else
{
WriteTrace(TraceLevel, TraceError, "Failed to load %s", (const char *)PluginFileName);
delete plugin;
plugin = NULL;
}
WriteTrace(TraceLevel, TraceDebug, "%s Loading Done", type);
}
else
{
WriteTrace(TraceLevel, TraceError, "Failed to allocate %s plugin", type);
}
}
开发者ID:JunielKatarn,项目名称:Project64CI,代码行数:34,代码来源:PluginClass.cpp
示例9: Load
bool CSettingTypeApplicationPath::Load(int Index, stdstr & Value) const
{
bool bRes = CSettingTypeApplication::Load(Index, Value);
if (bRes)
{
if (Value.substr(0, 2) == ".\\" || Value.substr(0, 2) == "./" ||
Value.substr(0, 3) == "..\\" || Value.substr(0, 3) == "../")
{
CPath FullFilePath(g_Settings->LoadStringVal(Cmd_BaseDirectory).c_str(), ""), RelativePath(Value);
FullFilePath.SetNameExtension(RelativePath.GetNameExtension().c_str());
FullFilePath.AppendDirectory(RelativePath.GetDirectory().c_str());
Value = (const std::string &)FullFilePath;
}
}
return bRes;
}
开发者ID:NickG22293,项目名称:project64,代码行数:17,代码来源:SettingsType-ApplicationPath.cpp
示例10: Save
void CSettingTypeApplication::Save ( int /*Index*/, const stdstr & Value )
{
if (!m_UseRegistry)
{
m_SettingsIniFile->SaveString(SectionName(),m_KeyNameIdex.c_str(),Value.c_str());
} else {
g_Notify->BreakPoint(__FILEW__,__LINE__);
}
}
开发者ID:aschwant,项目名称:project64,代码行数:9,代码来源:SettingsType-Application.cpp
示例11: Load
bool CSettingTypeApplicationPath::Load ( int Index, stdstr & Value ) const
{
bool bRes = CSettingTypeApplication::Load(Index,Value);
#ifdef WIN32
if (bRes)
{
if (Value.substr(0,2) == ".\\" || Value.substr(0,2) == "./" ||
Value.substr(0,3) == "..\\" || Value.substr(0,3) == "../")
{
CPath FullFilePath(CPath::MODULE_DIRECTORY), RelativePath(Value);
FullFilePath.SetNameExtension(RelativePath.GetNameExtension().c_str());
FullFilePath.AppendDirectory(RelativePath.GetDirectory().c_str());
Value = (const std::string &)FullFilePath;
}
}
#endif
return bRes;
}
开发者ID:jmarroyo90,项目名称:project64,代码行数:19,代码来源:SettingsType-ApplicationPath.cpp
示例12: _splitpath
void CPlugins::CreatePluginDir ( const stdstr & DstDir ) const {
char path_buffer[_MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR],
fname[_MAX_FNAME], ext[_MAX_EXT];
_splitpath(DstDir.c_str(), drive, dir, fname, ext );
_makepath(path_buffer, drive, dir, "", "" );
if (CreateDirectory(path_buffer,NULL) == 0 && GetLastError() == ERROR_PATH_NOT_FOUND)
{
path_buffer[strlen(path_buffer) - 1] = 0;
CreatePluginDir(stdstr(path_buffer));
CreateDirectory(path_buffer,NULL);
}
}
开发者ID:aschwant,项目名称:project64,代码行数:12,代码来源:Plugin+Class.cpp
示例13: Save
void CSettingTypeGame::Save ( int Index, const stdstr & Value )
{
Save(Index,Value.c_str());
}
开发者ID:Anonymous2,项目名称:project64,代码行数:4,代码来源:SettingsType-GameSetting.cpp
示例14: SaveStringIndex
void CSettings::SaveStringIndex( SettingID Type, int index, const stdstr & Value )
{
SaveStringIndex(Type,index,Value.c_str());
}
开发者ID:Toonerz,项目名称:project64,代码行数:4,代码来源:Settings+Class.cpp
示例15: Save
void CSettingTypeApplication::Save(int /*Index*/, const stdstr & Value)
{
m_SettingsIniFile->SaveString(SectionName(), m_KeyNameIdex.c_str(), Value.c_str());
}
开发者ID:JunielKatarn,项目名称:Project64CI,代码行数:4,代码来源:SettingsType-Application.cpp
注:本文中的stdstr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论