本文整理汇总了C++中PathBuffer::SetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ PathBuffer::SetPath方法的具体用法?C++ PathBuffer::SetPath怎么用?C++ PathBuffer::SetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathBuffer
的用法示例。
在下文中一共展示了PathBuffer::SetPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InternalStat
static int InternalStat( FSPath& path, FSStat* fsStat, FSCInfo* info )
{
struct stat st;
if ( SMB_STAT( pathBuffer1.SetPath( path ), &st ) )
{
return -1;
}
fsStat->mode = ( st.st_mode & ~( S_IXUSR | S_IXGRP | S_IXOTH ) );
fsStat->size = st.st_size;
fsStat->mtime = st.st_mtime;
fsStat->gid = st.st_gid;
fsStat->uid = st.st_uid;
fsStat->dev = st.st_dev;
fsStat->ino = st.st_ino;
return 0;
}
示例2: ReadDir
int FSSmb::ReadDir( FSList* list, FSPath& _path, int* err, FSCInfo* info )
{
FREPARE_SMB_OPER( lock, info, &_param );
if ( info && info->Stopped() ) { return -2; }
list->Clear();
FSPath path( _path );
int d = smbc_opendir( pathBuffer1.SetPath( path ) );
if ( d < 0 )
{
SetError( err, errno );
return -1;
}
try
{
struct smbc_dirent* pEnt;
int n = path.Count();
while ( true )
{
if ( info && info->Stopped() )
{
smbc_closedir( d );
return -2;
}
pEnt = smbc_readdir( d );
if ( !pEnt )
{
//???
break;
}
//skip . and ..
if ( pEnt->name[0] == '.' && ( !pEnt->name[1] || ( pEnt->name[1] == '.' && !pEnt->name[2] ) ) )
{
continue;
}
if ( //ignore it
pEnt->smbc_type == SMBC_PRINTER_SHARE ||
pEnt->smbc_type == SMBC_IPC_SHARE
) { continue; }
clPtr<FSNode> pNode = new FSNode();
path.SetItem( n, CS_UTF8, pEnt->name );
switch ( pEnt->smbc_type )
{
case SMBC_WORKGROUP:
pNode->extType = FSNode::WORKGROUP;
pNode->st.mode = S_IFDIR;
break;
case SMBC_SERVER:
pNode->extType = FSNode::SERVER;
pNode->st.mode = S_IFDIR;
break;
case SMBC_FILE_SHARE:
pNode->extType = FSNode::FILESHARE;
pNode->st.mode = S_IFDIR;
break;
case SMBC_PRINTER_SHARE:
case SMBC_COMMS_SHARE:
case SMBC_IPC_SHARE:
case SMBC_DIR:
pNode->st.mode = S_IFDIR;
break;
default:
InternalStat( path, &pNode->st, info );
}
pNode->name.Set( sys_charset_id, pEnt->name );
list->Append( pNode );
};
smbc_closedir( d );
return 0;
err:
SetError( err, errno );
smbc_closedir( d );
return -1;
//.........这里部分代码省略.........