本文整理汇总了C++中PathString::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PathString::get方法的具体用法?C++ PathString::get怎么用?C++ PathString::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathString
的用法示例。
在下文中一共展示了PathString::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLibraryName
/* static */ bool
FFVPXRuntimeLinker::Init()
{
if (sLinkStatus) {
return sLinkStatus == LinkStatus_SUCCEEDED;
}
MOZ_ASSERT(NS_IsMainThread());
sLinkStatus = LinkStatus_FAILED;
// We retrieve the path of the lgpllibs library as this is where mozavcodec
// and mozavutil libs are located.
PathString lgpllibsname = GetLibraryName(nullptr, "lgpllibs");
if (lgpllibsname.IsEmpty()) {
return false;
}
PathString path =
GetLibraryFilePathname(lgpllibsname.get(),
(PRFuncPtr)&soundtouch::SoundTouch::getVersionId);
if (path.IsEmpty()) {
return false;
}
RefPtr<nsLocalFile> xulFile = new nsLocalFile(path);
if (xulFile->NativePath().IsEmpty()) {
return false;
}
nsCOMPtr<nsIFile> rootDir;
if (NS_FAILED(xulFile->GetParent(getter_AddRefs(rootDir))) || !rootDir) {
return false;
}
PathString rootPath = rootDir->NativePath();
/* Get the platform-dependent library name of the module */
PathString libname = GetLibraryName(rootPath.get(), "mozavutil");
if (libname.IsEmpty()) {
return false;
}
RefPtr<nsLocalFile> libFile = new nsLocalFile(libname);
if (libFile->NativePath().IsEmpty()) {
return false;
}
sFFVPXLib.mAVUtilLib = MozAVLink(libFile);
libname = GetLibraryName(rootPath.get(), "mozavcodec");
if (!libname.IsEmpty()) {
libFile = new nsLocalFile(libname);
if (!libFile->NativePath().IsEmpty()) {
sFFVPXLib.mAVCodecLib = MozAVLink(libFile);
}
}
if (sFFVPXLib.Link() == FFmpegLibWrapper::LinkResult::Success) {
sLinkStatus = LinkStatus_SUCCEEDED;
return true;
}
return false;
}
示例2:
static PRLibrary*
MozAVLink(nsIFile* aFile)
{
PRLibSpec lspec;
PathString path = aFile->NativePath();
#ifdef XP_WIN
lspec.type = PR_LibSpec_PathnameU;
lspec.value.pathname_u = path.get();
#else
lspec.type = PR_LibSpec_Pathname;
lspec.value.pathname = path.get();
#endif
#ifdef MOZ_WIDGET_ANDROID
PRLibrary* lib = PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_GLOBAL);
#else
PRLibrary* lib = PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_LOCAL);
#endif
if (!lib) {
FFMPEG_LOG("unable to load library %s", aFile->HumanReadablePath().get());
}
return lib;
}