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


C++ nsAutoCString::IsEmpty方法代码示例

本文整理汇总了C++中nsAutoCString::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAutoCString::IsEmpty方法的具体用法?C++ nsAutoCString::IsEmpty怎么用?C++ nsAutoCString::IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nsAutoCString的用法示例。


在下文中一共展示了nsAutoCString::IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PerformAsyncLaunchInternal

bool
GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts, base::ProcessArchitecture arch)
{
  // If NSPR log files are not requested, we're done.
  const char* origNSPRLogName = PR_GetEnv("NSPR_LOG_FILE");
  const char* origMozLogName = PR_GetEnv("MOZ_LOG_FILE");
  if (!origNSPRLogName && !origMozLogName) {
    return PerformAsyncLaunchInternal(aExtraOpts, arch);
  }

  ++mChildCounter;

  // remember original value so we can restore it.
  // - Note: this code is not called re-entrantly, nor are restoreOrig*LogName
  //   or mChildCounter touched by any other thread, so this is safe.
  static nsAutoCString restoreOrigNSPRLogName;
  static nsAutoCString restoreOrigMozLogName;

  if (origNSPRLogName) {
    if (restoreOrigNSPRLogName.IsEmpty()) {
      restoreOrigNSPRLogName.AssignLiteral("NSPR_LOG_FILE=");
      restoreOrigNSPRLogName.Append(origNSPRLogName);
    }
    SetChildLogName("NSPR_LOG_FILE=", origNSPRLogName);
  }
  if (origMozLogName) {
    if (restoreOrigMozLogName.IsEmpty()) {
      restoreOrigMozLogName.AssignLiteral("MOZ_LOG_FILE=");
      restoreOrigMozLogName.Append(origMozLogName);
    }
    SetChildLogName("MOZ_LOG_FILE=", origMozLogName);
  }

  bool retval = PerformAsyncLaunchInternal(aExtraOpts, arch);

  // Revert to original value
  if (origNSPRLogName) {
    PR_SetEnv(restoreOrigNSPRLogName.get());
  }
  if (origMozLogName) {
    PR_SetEnv(restoreOrigMozLogName.get());
  }

  return retval;
}
开发者ID:linclark,项目名称:gecko-dev,代码行数:45,代码来源:GeckoChildProcessHost.cpp

示例2:

// Charset used by the file system.
const char * nsMsgI18NFileSystemCharset()
{
  /* Get a charset used for the file. */
  static nsAutoCString fileSystemCharset;

  if (fileSystemCharset.IsEmpty()) 
  {
    nsresult rv;
    nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
        if (NS_SUCCEEDED(rv)) {
          rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName,
                                           fileSystemCharset);
        }

    if (NS_FAILED(rv)) 
      fileSystemCharset.Assign("ISO-8859-1");
  }
  return fileSystemCharset.get();
}
开发者ID:cmotc,项目名称:spacehamster,代码行数:20,代码来源:nsMsgI18N.cpp


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