本文整理汇总了C++中PathBuffer::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ PathBuffer::Init方法的具体用法?C++ PathBuffer::Init怎么用?C++ PathBuffer::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathBuffer
的用法示例。
在下文中一共展示了PathBuffer::Init方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAlias
VError XLinuxFile::CreateAlias(const VFilePath &inTargetPath, const VFilePath *unused) const
{
PathBuffer targetPath;
targetPath.Init(inTargetPath);
LinkHelper lnkHlp;
VError verr=lnkHlp.Link(fPath, targetPath);
return verr;
}
示例2: Load
bool XLinuxLibrary::Load(const VFilePath &inFilePath)
{
VFile* soFile=RetainExecutableFile(inFilePath);
VFilePath soPath=soFile->GetPath();
soFile->Release();
PathBuffer tmpBuf;
tmpBuf.Init(soPath);
if(fLib.Open(tmpBuf)!=VE_OK)
return false;
return true;
}
示例3: Rename
VError XLinuxFile::Rename(const VFilePath& inDstPath, VFile** outFile) const
{
if(outFile!=NULL)
*outFile=NULL;
PathBuffer dstPath;
dstPath.Init(inDstPath);
RenameHelper rnmHlp;
VError verr=rnmHlp.Rename(fPath, dstPath);
if(verr==VE_OK && outFile!=NULL)
*outFile=new VFile(inDstPath);
return verr;
}
示例4: Copy
VError XLinuxFile::Copy(const VFilePath& inDestination, VFile** outFile, FileCopyOptions inOptions ) const
{
VFilePath tmpPath(inDestination);
if(tmpPath.IsFolder())
{
VStr255 name; //jmo - todo : NAME_MAX ?
fOwner->GetName(name);
tmpPath.SetFileName(name);
}
PathBuffer dstPath;
dstPath.Init(tmpPath);
CopyHelper cpHlp;
return cpHlp.Copy(fPath, dstPath);
}
示例5: fOpts
XLinuxFileIterator::XLinuxFileIterator(const VFolder *inFolder, FileIteratorOptions inOptions)
: fOpts(0)
, fIt(NULL)
, fFileSystem( inFolder->GetFileSystem())
{
//Because Next() returns a VFile ptr, we want files and no folders.
fOpts=inOptions;
fOpts|=FI_WANT_FILES;
fOpts&=~FI_WANT_FOLDERS;
VFilePath tmpPath;
inFolder->GetPath(tmpPath);
PathBuffer path;
path.Init(tmpPath);
fIt=new FsIterator(path, inOptions);
}
示例6: Move
VError XLinuxFile::Move(const VFilePath& inDestinationPath, VFileSystem *inDestinationFileSystem, VFile** outFile, FileCopyOptions /*inOptions*/) const
{
VFilePath dstPath(inDestinationPath);
if (dstPath.IsFolder())
{
VStr255 name; //jmo - todo : NAME_MAX ?
fOwner->GetName(name);
dstPath.SetFileName(name);
}
PathBuffer pathBuffer;
pathBuffer.Init(dstPath);
//First we try to rename the file...
VError verr;
{
RenameHelper rnmHlp;
verr=rnmHlp.Rename(fPath, pathBuffer);
}
//If Rename() fails because src and dst are not on the same fs, we try a Copy()
if(verr!=VE_OK && IS_NATIVE_VERROR(verr) && NATIVE_ERRCODE_FROM_VERROR(verr)==EXDEV)
{
CopyHelper cpHlp;
verr = cpHlp.Copy(fPath, pathBuffer);
// it's a move not a copy, so one must delete the source after a sucessful copy
if (verr == VE_OK)
{
int res=unlink(fPath.GetPath());
verr = (res==0) ? VE_OK : MAKE_NATIVE_VERROR(errno);
}
}
if (outFile != NULL)
{
*outFile = (verr == VE_OK) ? new VFile( dstPath, inDestinationFileSystem) : NULL;
}
return verr;
}
示例7: Rename
VError XLinuxFile::Rename(const VString& inName, VFile** outFile) const
{
//jmo - todo : we should check that inName < NAME_MAX or use PathBuffer
VFilePath newPath(fOwner->GetPath());
newPath.SetFileName(inName);
PathBuffer dstPath;
dstPath.Init(newPath);
RenameHelper rnmHlp;
VError verr=rnmHlp.Rename(fPath, dstPath);
if (outFile != NULL)
{
*outFile = (verr == VE_OK) ? new VFile( newPath, fOwner->GetFileSystem()) : NULL;
}
return verr;
}
示例8: Copy
VError XLinuxFile::Copy(const VFilePath& inDestination, VFileSystem *inDestinationFileSystem, VFile** outFile, FileCopyOptions /*inOptions*/) const
{
VFilePath dstPath(inDestination);
if(dstPath.IsFolder())
{
VStr255 name; //jmo - todo : NAME_MAX ?
fOwner->GetName(name);
dstPath.SetFileName(name);
}
PathBuffer pathBuffer;
pathBuffer.Init(dstPath);
CopyHelper cpHlp;
VError err = cpHlp.Copy(fPath, pathBuffer);
if (outFile != NULL)
{
*outFile = (err == VE_OK) ? new VFile( dstPath, inDestinationFileSystem) : NULL;
}
return err;
}