本文整理汇总了C++中PString::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ PString::Delete方法的具体用法?C++ PString::Delete怎么用?C++ PString::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PString
的用法示例。
在下文中一共展示了PString::Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _mkdir
int _mkdir(const char *sDir)
{
PString folderName = sDir;
if (folderName[folderName.GetLength() - 1] == PDIR_SEPARATOR) {
folderName.Delete(folderName.GetLength() - 1, 1);
}
return (CreateDirectory(folderName.AsUCS2(),NULL) ? 0 : -1);
}
示例2: _rmdir
int _rmdir(const char *sDir)
{
USES_CONVERSION;
PString folderName = sDir;
if (folderName[folderName.GetLength() - 1] == PDIR_SEPARATOR) {
folderName.Delete(folderName.GetLength() - 1, 1);
}
return (RemoveDirectory(A2T(folderName)) ? 0 : -1);
}
示例3: LoadCapabilities
void CMyPhoneEndPoint::LoadCapabilities()
{
BOOL sizeChange = FALSE;
capabilities.RemoveAll();
// Add the codecs we know about
AddAllCapabilities(0, 0, "*");
// Удаляю не поддерживаемые видео кодеки из реестра
PINDEX videoNum = 0;
for (;;)
{
PString key = psprintf("%u", ++videoNum);
PString name = config.GetString(VideoCodecsConfigSection, key, "");
if (name.IsEmpty()) break;
PINDEX suffixPos = name.Find(OnCodecSuffix);
if (suffixPos != P_MAX_INDEX)
name.Delete(suffixPos, P_MAX_INDEX);
else
{
suffixPos = name.Find(OffCodecSuffix);
name.Delete(suffixPos, P_MAX_INDEX);
}
int res = 0;
for (PINDEX i = 0; i < capabilities.GetSize(); i++)
{
if (capabilities[i].GetMainType() == H323Capability::e_Video)
{
if(capabilities[i].GetFormatName() == name)
{ res = 1; break; }
}
}
if(res == 0)
{
PINDEX j = videoNum; videoNum--;
for (;;)
{
PString key1 = psprintf("%u", ++j);
PString name1 = config.GetString(VideoCodecsConfigSection, key1, "");
if (name1.IsEmpty()) break;
config.SetString(VideoCodecsConfigSection, psprintf("%u", j-2), name1);
}
config.DeleteKey(VideoCodecsConfigSection, psprintf("%u", j-1));
}
}
// добавляю новые видео кодеки если их нет в конфигурации
for (PINDEX i = 0; i < capabilities.GetSize(); i++)
{
if (capabilities[i].GetMainType() == H323Capability::e_Video)
{
PINDEX codecNum=0;
int res = 0;
int suffix = 0;
for (;;)
{
PString key = psprintf("%u", ++codecNum);
PString name = config.GetString(VideoCodecsConfigSection, key, "");
if (name.IsEmpty()) break;
suffix = 0;
PINDEX suffixPos = name.Find(OnCodecSuffix);
if (suffixPos != P_MAX_INDEX)
name.Delete(suffixPos, P_MAX_INDEX);
else
{
suffix = 1;
suffixPos = name.Find(OffCodecSuffix);
name.Delete(suffixPos, P_MAX_INDEX);
}
if(capabilities[i].GetFormatName() == name) { res = 1; break; }
}
if(res == 0)
{
config.SetString(VideoCodecsConfigSection,
psprintf("%u", codecNum),
capabilities[i].GetFormatName() + ((suffix==0)?OnCodecSuffix:OffCodecSuffix));
}
}
}
PINDEX audioNum = 0;
for (;;)
{
PString key = psprintf("%u", ++audioNum);
PString name = config.GetString(CodecsConfigSection, key, "");
if (name.IsEmpty()) break;
PINDEX suffixPos = name.Find(OnCodecSuffix);
if (suffixPos != P_MAX_INDEX)
name.Delete(suffixPos, P_MAX_INDEX);
else
{
suffixPos = name.Find(OffCodecSuffix);
//.........这里部分代码省略.........