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


C++ OsPath::getExt方法代码示例

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


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

示例1: testPathInfo

    void testPathInfo()
    {
        UtlString testDir = "../../filename.ext";
        OsPath testPath = testDir;

        UtlString parentPath;
        parentPath.append("..").append(OsPath::separator).append("..").append(OsPath::separator);

        ASSERT_STR_EQUAL_MESSAGE("Extension", ".ext", testPath.getExt().data());
        ASSERT_STR_EQUAL_MESSAGE("Parent Path", parentPath, testPath.getDirName().data());
        ASSERT_STR_EQUAL_MESSAGE("Volume", "", testPath.getVolume().data());
        ASSERT_STR_EQUAL_MESSAGE("Filename no extension", "filename",
                                     testPath.getFilename().data());

        // little risky, may not have permissions, but '../../' is too
        // good a test to not try. Refactor if this is bad assumption
        OsFile file(testPath);
        file.touch();

        OsPath nativePath;
        testPath.getNativePath(nativePath);

        // dont' know what's right, but know whats wrong
        CPPUNIT_ASSERT_MESSAGE("Resolved relative path", !nativePath.contains(".."));
        //printf("Native path is %s\n", nativePath.data());

        file.remove();
    }
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:28,代码来源:OsPathTest.cpp

示例2: OsTask

ACDAudio::ACDAudio(ACDAudioManager* pAcdAudioManager,
                   const char*      pName,
                   bool             localStore,
                   const char*      pAudioUriString,
                   const char*      pDescription)
: OsTask("ACDAudio-%d"), mLock(OsMutex::Q_FIFO)
{
   mpAcdAudioManager = pAcdAudioManager;
   mName             = pName;
   mLocalStore       = localStore;
   mUri              = pAudioUriString;
   mUriString        = pAudioUriString;
   mDescription      = pDescription;

   mpAudioBuffer     = NULL;

   if (mLocalStore) {
      // This audio is flagged as local-store
      // Check to see if it has been fetched and stored locally
      mAudioPath = mpAcdAudioManager->getAudioStorePath();
      if (mAudioPath != NULL) {
         // Valid audio store path, append the file
         OsPath uriPath;

         mUri.getPath(uriPath);
         uriPath.Split();
         mAudioPath += OsPath::separator;
         mAudioPath += uriPath.getFilename();
         mAudioPath += uriPath.getExt();

         // Check to see if the file is already there
         if (!OsFileSystem::exists(mAudioPath)) {
            // No, attempt to download it
            Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAudio::ACDAudio - starting download of: %s", mUriString.data());
            start();
         }
      }
   }
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:39,代码来源:ACDAudio.cpp


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