当前位置: 首页>>代码示例>>C++>>正文


C++ PString::Delete方法代码示例

本文整理汇总了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);
}
开发者ID:gawadepd,项目名称:kh323phone,代码行数:10,代码来源:stdlibx.cpp

示例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);
}
开发者ID:gawadepd,项目名称:kh323phone,代码行数:11,代码来源:stdlibx.cpp

示例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);
//.........这里部分代码省略.........
开发者ID:cubemoon,项目名称:myphone3,代码行数:101,代码来源:MyPhoneEndPoint.cpp


注:本文中的PString::Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。