本文整理汇总了C++中UDSEntry类的典型用法代码示例。如果您正苦于以下问题:C++ UDSEntry类的具体用法?C++ UDSEntry怎么用?C++ UDSEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UDSEntry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: qCDebug
void MANProtocol::stat( const QUrl& url)
{
qCDebug(KIO_MAN_LOG) << "ENTERING STAT " << url.url();
QString title, section;
if (!parseUrl(url.path(), title, section))
{
error(KIO::ERR_MALFORMED_URL, url.url());
return;
}
qCDebug(KIO_MAN_LOG) << "URL " << url.url() << " parsed to title='" << title << "' section=" << section;
UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_NAME, title);
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
#if 0 // not useful, is it?
QString newUrl = "man:"+title;
if (!section.isEmpty())
newUrl += QString("(%1)").arg(section);
entry.insert(KIO::UDSEntry::UDS_URL, newUrl);
#endif
entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("text/html"));
statEntry(entry);
finished();
}
开发者ID:KDE,项目名称:kio-extras,代码行数:31,代码来源:kio_man.cpp
示例2: qDebug
void LocateProtocol::stat(const QUrl& url)
{
qDebug() << "LocateProtocol::stat(" << url << ")" << endl ;
setUrl(url);
/*
* I'm tired of trying to make this work. Error out to avoid recursive call back loop.
* Dolphin doesn't handle 'help' protocol anyway.
*/
if (isHelpRequest()){
error(KIO::ERR_DOES_NOT_EXIST, QString());
return;
}
if (isSearchRequest() || isConfigRequest()) {
bool isDir = isSearchRequest() && m_locater.binaryExists();
/// TODO Are there ever '/''s in our urls after the scheme?
UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_NAME, m_url.toString(QUrl::RemoveScheme));
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, isDir ? S_IFDIR : S_IFREG);
statEntry(entry);
finished();
} else {
// What's this?
error(KIO::ERR_DOES_NOT_EXIST, QString());
}
}
开发者ID:reporter123,项目名称:kio-locate,代码行数:31,代码来源:kio_locate.cpp
示例3: changeCheck
void kio_sieveProtocol::urlStat(const QUrl &url)
{
changeCheck(url);
if (!connect()) {
return;
}
UDSEntry entry;
QString filename = url.fileName();
if (filename.isEmpty()) {
entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("/"));
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.insert(KIO::UDSEntry::UDS_ACCESS, 0700);
statEntry(entry);
} else {
if (!sendData("LISTSCRIPTS")) {
return;
}
while (receiveData()) {
if (r.getType() == kio_sieveResponse::ACTION) {
if (r.getAction().toLower().count("ok") == 1) {
// Script list completed
break;
}
} else {
if (filename == QString::fromUtf8(r.getKey())) {
entry.clear();
entry.insert(KIO::UDSEntry::UDS_NAME, QString::fromUtf8(r.getKey()));
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
if (r.getExtra() == "ACTIVE") {
entry.insert(KIO::UDSEntry::UDS_ACCESS, 0700);
} else {
entry.insert(KIO::UDSEntry::UDS_ACCESS, 0600);
}
entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("application/sieve"));
//setMetaData("active", (r.getExtra() == "ACTIVE") ? "yes" : "no");
statEntry(entry);
// cannot break here because we need to clear
// the rest of the incoming data.
}
}
}
}
finished();
}
开发者ID:quazgar,项目名称:kdepimlibs,代码行数:60,代码来源:sieve.cpp
示例4: url
void FtpSlave::listEntry( const UDSEntry &entry, bool ready )
{
// some parts of the KIO API look stupid...
if ( ready )
return;
bool isDir = false;
KURL url( m_currentURL );
QString name;
for ( UDSEntry::ConstIterator it = entry.begin();
it != entry.end(); ++it ) {
switch ( ( *it ).m_uds ) {
case UDS_FILE_TYPE:
isDir = S_ISDIR( ( *it ).m_long );
break;
case UDS_NAME:
name = ( *it ).m_str;
break;
default: break;
}
}
if ( isDir )
name += '/';
url.addPath( name );
sendString( QString::fromLatin1( "<a href=\"%1\">%2</a>\n" ).
arg( url.url() ).arg( name ) );
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:33,代码来源:kio_ftp.cpp
示例5: kdDebug
void tdeio_isoProtocol::stat( const KURL & url )
{
TQString path;
UDSEntry entry;
kdDebug() << "tdeio_isoProtocol::stat " << url.url() << endl;
if ( !checkNewFile( url.path(), path, url.hasRef() ? url.htmlRef().toInt() : -1 ) )
{
// We may be looking at a real directory - this happens
// when pressing up after being in the root of an archive
TQCString _path( TQFile::encodeName(url.path()));
kdDebug() << "tdeio_isoProtocol::stat (stat) on " << _path << endl;
struct stat buff;
if ( ::stat( _path.data(), &buff ) == -1 || !S_ISDIR( buff.st_mode ) ) {
kdDebug() << "isdir=" << S_ISDIR( buff.st_mode ) << " errno=" << strerror(errno) << endl;
error( TDEIO::ERR_DOES_NOT_EXIST, url.path() );
return;
}
// Real directory. Return just enough information for KRun to work
UDSAtom atom;
atom.m_uds = TDEIO::UDS_NAME;
atom.m_str = url.fileName();
entry.append( atom );
kdDebug() << "tdeio_isoProtocol::stat returning name=" << url.fileName() << endl;
atom.m_uds = TDEIO::UDS_FILE_TYPE;
atom.m_long = buff.st_mode & S_IFMT;
entry.append( atom );
statEntry( entry );
finished();
// And let go of the iso file - for people who want to unmount a cdrom after that
delete m_isoFile;
m_isoFile = 0L;
return;
}
const KArchiveDirectory* root = m_isoFile->directory();
const KArchiveEntry* isoEntry;
if ( path.isEmpty() )
{
path = TQString::fromLatin1( "/" );
isoEntry = root;
} else {
isoEntry = root->entry( path );
}
if ( !isoEntry )
{
error( TDEIO::ERR_DOES_NOT_EXIST, path );
return;
}
createUDSEntry( isoEntry, entry );
statEntry( entry );
finished();
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:57,代码来源:iso.cpp
示例6: kdDebug
//===========================================================================
void SMBSlave::stat(const KURL &kurl)
{
kdDebug(KIO_SMB) << "SMBSlave::stat on " << kurl << endl;
// make a valid URL
KURL url = checkURL(kurl);
// if URL is not valid we have to redirect to correct URL
if(url != kurl)
{
kdDebug() << "redirection " << url << endl;
redirection(url);
finished();
return;
}
m_current_url = url;
UDSAtom udsatom;
UDSEntry udsentry;
// Set name
udsatom.m_uds = KIO::UDS_NAME;
udsatom.m_str = kurl.fileName();
udsentry.append(udsatom);
switch(m_current_url.getType())
{
case SMBURLTYPE_UNKNOWN:
error(ERR_MALFORMED_URL, m_current_url.prettyURL());
finished();
return;
case SMBURLTYPE_ENTIRE_NETWORK:
case SMBURLTYPE_WORKGROUP_OR_SERVER:
udsatom.m_uds = KIO::UDS_FILE_TYPE;
udsatom.m_long = S_IFDIR;
udsentry.append(udsatom);
break;
case SMBURLTYPE_SHARE_OR_PATH:
if(browse_stat_path(m_current_url, udsentry, false))
break;
else
{
kdDebug(KIO_SMB) << "SMBSlave::stat ERROR!!" << endl;
finished();
return;
}
default:
kdDebug(KIO_SMB) << "SMBSlave::stat UNKNOWN " << url << endl;
finished();
return;
}
statEntry(udsentry);
finished();
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:57,代码来源:kio_smb_browse.cpp
示例7: addService
void ZeroConfProtocol::addService( DNSSD::RemoteService::Ptr service )
{
UDSEntry entry;
entry.insert( UDSEntry::UDS_NAME, service->serviceName() );
entry.insert( UDSEntry::UDS_ACCESS, 0666);
entry.insert( UDSEntry::UDS_FILE_TYPE, S_IFDIR );
const QString iconName = KProtocolInfo::icon( knownProtocols[service->type()].protocol );
if (!iconName.isNull())
entry.insert( UDSEntry::UDS_ICON_NAME, iconName );
listEntry( entry, false );
}
开发者ID:KDE,项目名称:zeroconf-ioslave,代码行数:12,代码来源:dnssd.cpp
示例8: kDebug
bool AfcDevice::open( const QString& path, QIODevice::OpenMode mode, KIO::Error& error )
{
kDebug(KIO_AFC) << path << "mode: " << mode;
bool ret = false;
afc_file_mode_t file_mode = AFC_FOPEN_RDONLY;
if ( QIODevice::ReadOnly == mode )
{
file_mode = AFC_FOPEN_RDONLY;
}
else if ( QIODevice::ReadWrite == mode )
{
file_mode = AFC_FOPEN_RW;
}
else if ( QIODevice::WriteOnly == mode )
{
file_mode = AFC_FOPEN_WRONLY;
}
else if ( ( QIODevice::ReadWrite | QIODevice::Truncate ) == mode )
{
file_mode = AFC_FOPEN_WR;
}
else if ( QIODevice::Append == mode )
{
file_mode = AFC_FOPEN_APPEND;
}
else if ( QIODevice::Truncate == mode )
{
file_mode = AFC_FOPEN_RDAPPEND;
}
else
{
error = KIO::ERR_COULD_NOT_ACCEPT;
return false;
}
afc_error_t err = afc_file_open(_afc, (const char*) path.toLocal8Bit(), file_mode, &openFd);
if ( checkError(err, error) )
{
openPath = path;
UDSEntry entry;
if ( createUDSEntry("", path, entry, error) )
{
ret = true;
_proto->totalSize( entry.numberValue(UDSEntry::UDS_SIZE, 0) );
_proto->position( 0 );
}
}
return ret;
}
开发者ID:sunzhigang,项目名称:kio_afc,代码行数:52,代码来源:afcdevice.cpp
示例9: qCDebug
//===========================================================================
void SMBSlave::stat( const QUrl& kurl )
{
qCDebug(KIO_SMB) << kurl;
// make a valid URL
QUrl url = checkURL(kurl);
// if URL is not valid we have to redirect to correct URL
if (url != kurl)
{
qCDebug(KIO_SMB) << "redirection " << url;
redirection(url);
finished();
return;
}
m_current_url = url;
UDSEntry udsentry;
// Set name
udsentry.insert( KIO::UDSEntry::UDS_NAME, kurl.fileName() );
switch(m_current_url.getType())
{
case SMBURLTYPE_UNKNOWN:
error(ERR_MALFORMED_URL,m_current_url.toDisplayString());
return;
case SMBURLTYPE_ENTIRE_NETWORK:
case SMBURLTYPE_WORKGROUP_OR_SERVER:
udsentry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
break;
case SMBURLTYPE_SHARE_OR_PATH:
if (browse_stat_path(m_current_url, udsentry, false))
break;
else {
qCDebug(KIO_SMB) << "ERROR!!";
finished();
return;
}
default:
qCDebug(KIO_SMB) << "UNKNOWN " << url;
finished();
return;
}
statEntry(udsentry);
finished();
}
开发者ID:KDE,项目名称:kio-extras,代码行数:50,代码来源:kio_smb_browse.cpp
示例10: createUDSEntry
void ArchiveProtocol::createUDSEntry( const KArchiveEntry * archiveEntry, UDSEntry & entry )
{
entry.clear();
entry.insert( KIO::UDSEntry::UDS_NAME, archiveEntry->name() );
entry.insert( KIO::UDSEntry::UDS_FILE_TYPE, archiveEntry->permissions() & S_IFMT ); // keep file type only
entry.insert( KIO::UDSEntry::UDS_SIZE, archiveEntry->isFile() ? ((KArchiveFile *)archiveEntry)->size() : 0L );
entry.insert( KIO::UDSEntry::UDS_MODIFICATION_TIME, archiveEntry->date());
entry.insert( KIO::UDSEntry::UDS_ACCESS, archiveEntry->permissions() & 07777 ); // keep permissions only
entry.insert( KIO::UDSEntry::UDS_USER, archiveEntry->user());
entry.insert( KIO::UDSEntry::UDS_GROUP, archiveEntry->group());
entry.insert( KIO::UDSEntry::UDS_LINK_DEST, archiveEntry->symLinkTarget());
}
开发者ID:KDE,项目名称:kde-runtime,代码行数:12,代码来源:kio_archive.cpp
示例11: app_file
// internal function
// fills a file item with its name and size
static void app_file(UDSEntry& e, const QString & name, size_t size)
{
e.clear();
app_entry(e, KIO::UDSEntry::UDS_NAME, name);
app_entry(e, KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
app_entry(e, KIO::UDSEntry::UDS_SIZE, size);
}
开发者ID:KDE,项目名称:okular,代码行数:9,代码来源:msits.cpp
示例12: app_dir
// internal function
// fills a directory item with its name and size
static void app_dir(UDSEntry& e, const QString & name)
{
e.clear();
app_entry(e, KIO::UDSEntry::UDS_NAME, name);
app_entry(e, KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
app_entry(e, KIO::UDSEntry::UDS_SIZE, 1);
}
开发者ID:KDE,项目名称:okular,代码行数:9,代码来源:msits.cpp
示例13: cache_stat
//---------------------------------------------------------------------------
bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ignore_errors)
// Returns: true on success, false on failure
{
SMBUrl url = _url;
int cacheStatErr = cache_stat(url, &st);
if(cacheStatErr == 0)
{
if(!S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode))
{
qCDebug(KIO_SMB) << "mode: "<< st.st_mode;
warning(i18n("%1:\n"
"Unknown file type, neither directory or file.", url.toDisplayString()));
return false;
}
udsentry.insert(KIO::UDSEntry::UDS_FILE_TYPE, st.st_mode & S_IFMT);
udsentry.insert(KIO::UDSEntry::UDS_SIZE, st.st_size);
QString str;
uid_t uid = st.st_uid;
struct passwd *user = getpwuid( uid );
if ( user )
str = user->pw_name;
else
str = QString::number( uid );
udsentry.insert(KIO::UDSEntry::UDS_USER, str);
gid_t gid = st.st_gid;
struct group *grp = getgrgid( gid );
if ( grp )
str = grp->gr_name;
else
str = QString::number( gid );
udsentry.insert(KIO::UDSEntry::UDS_GROUP, str);
udsentry.insert(KIO::UDSEntry::UDS_ACCESS, st.st_mode & 07777);
udsentry.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, st.st_mtime);
udsentry.insert(KIO::UDSEntry::UDS_ACCESS_TIME, st.st_atime);
// No, st_ctime is not UDS_CREATION_TIME...
}
else
{
if (!ignore_errors) {
if (cacheStatErr == EPERM || cacheStatErr == EACCES)
if (checkPassword(url)) {
redirection( url );
return false;
}
reportError(url, cacheStatErr);
} else if (cacheStatErr == ENOENT || cacheStatErr == ENOTDIR) {
warning(i18n("File does not exist: %1", url.url()));
}
qCDebug(KIO_SMB) << "ERROR!!";
return false;
}
return true;
}
开发者ID:KDE,项目名称:kio-extras,代码行数:61,代码来源:kio_smb_browse.cpp
示例14: appendACLAtoms
static void appendACLAtoms( const QByteArray & path, UDSEntry& entry, mode_t type, bool withACL )
{
// first check for a noop
if ( acl_extended_file( path.data() ) == 0 ) return;
acl_t acl = 0;
acl_t defaultAcl = 0;
bool isDir = S_ISDIR( type );
// do we have an acl for the file, and/or a default acl for the dir, if it is one?
acl = acl_get_file( path.data(), ACL_TYPE_ACCESS );
/* Sadly libacl does not provided a means of checking for extended ACL and default
* ACL separately. Since a directory can have both, we need to check again. */
if ( isDir ) {
if ( acl ) {
if ( !FileProtocol::isExtendedACL( acl ) ) {
acl_free( acl );
acl = 0;
}
}
defaultAcl = acl_get_file( path.data(), ACL_TYPE_DEFAULT );
}
if ( acl || defaultAcl ) {
kDebug(7101) << path.constData() << "has extended ACL entries";
entry.insert( KIO::UDSEntry::UDS_EXTENDED_ACL, 1 );
}
if ( withACL ) {
if ( acl ) {
const QString str = aclToText(acl);
entry.insert( KIO::UDSEntry::UDS_ACL_STRING, str );
kDebug(7101) << path.constData() << "ACL:" << str;
}
if ( defaultAcl ) {
const QString str = aclToText(defaultAcl);
entry.insert( KIO::UDSEntry::UDS_DEFAULT_ACL_STRING, str );
kDebug(7101) << path.constData() << "DEFAULT ACL:" << str;
}
}
if ( acl ) acl_free( acl );
if ( defaultAcl ) acl_free( defaultAcl );
}
开发者ID:,项目名称:,代码行数:40,代码来源:
示例15: statServer
void kio_afpProtocol::statServer(void)
{
UDSEntry entry;
UDSAtom atom;
atom.m_uds = KIO::UDS_NAME;
atom.m_str = QString::null;
entry.append( atom );
atom.m_uds = KIO::UDS_FILE_TYPE;
atom.m_long = S_IFDIR;
entry.append( atom );
atom.m_uds = KIO::UDS_ACCESS;
atom.m_long = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
entry.append( atom );
atom.m_uds = KIO::UDS_USER;
atom.m_str = "root";
entry.append( atom );
atom.m_uds = KIO::UDS_GROUP;
entry.append( atom );
// no size
statEntry( entry );
}
开发者ID:zach-klippenstein,项目名称:afpfs-ng,代码行数:26,代码来源:kafp.cpp
示例16:
void LDAPProtocol::LDAPEntry2UDSEntry( const LdapDN &dn, UDSEntry &entry,
const LdapUrl &usrc, bool dir )
{
int pos;
entry.clear();
QString name = dn.toString();
if ( (pos = name.indexOf(',')) > 0 )
name = name.left( pos );
if ( (pos = name.indexOf('=')) > 0 )
name.remove( 0, pos+1 );
name.replace(' ', "_");
if ( !dir ) name += ".ldif";
entry.insert( KIO::UDSEntry::UDS_NAME, name );
// the file type
entry.insert( KIO::UDSEntry::UDS_FILE_TYPE, dir ? S_IFDIR : S_IFREG );
// the mimetype
if (!dir) {
entry.insert( KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("text/plain") );
}
entry.insert( KIO::UDSEntry::UDS_ACCESS, dir ? 0500 : 0400 );
// the url
LdapUrl url=usrc;
url.setPath('/'+dn.toString());
url.setScope( dir ? LdapUrl::One : LdapUrl::Base );
entry.insert( KIO::UDSEntry::UDS_URL, url.prettyUrl() );
}
开发者ID:pvuorela,项目名称:kcalcore,代码行数:30,代码来源:kio_ldap.cpp
示例17: kdDebug
void LANProtocol::stat( const KURL & url)
{
kdDebug(7101)<<"LANProtocol::stat: "<<endl;
UDSEntry entry;
UDSAtom atom;
atom.m_uds = KIO::UDS_NAME;
atom.m_str = url.path();
entry.append( atom );
atom.m_uds = KIO::UDS_SIZE;
atom.m_long = 1024;
entry.append(atom);
atom.m_uds = KIO::UDS_ACCESS;
atom.m_long = S_IRUSR | S_IRGRP | S_IROTH ;
//atom.m_long = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
entry.append(atom);
QString path( QFile::encodeName(url.path()));
QStringList pathList=QStringList::split( "/",path);
if ((pathList.count()==2) && (pathList[1].upper()=="HTTP"))
{
atom.m_uds = KIO::UDS_FILE_TYPE;
atom.m_long=S_IFREG;
entry.append(atom);
atom.m_uds = KIO::UDS_MIME_TYPE;
atom.m_str="text/html";
//kdDebug(7101)<<"LANProtocol::stat: http is reg file"<<endl;
entry.append( atom );
}
else
{
atom.m_uds = KIO::UDS_FILE_TYPE;
atom.m_long = S_IFDIR; // it is always a directory
entry.append(atom);
atom.m_uds = KIO::UDS_MIME_TYPE;
atom.m_str="inode/directory";
//kdDebug(7101)<<"LANProtocol::stat: is dir"<<endl;
entry.append( atom );
}
statEntry( entry );
finished();
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:45,代码来源:kio_lan.cpp
示例18: createRootUDSEntry
bool AfcDevice::createRootUDSEntry( UDSEntry & entry )
{
entry.insert( UDSEntry::UDS_NAME, _id );
entry.insert( UDSEntry::UDS_DISPLAY_NAME, _name );
entry.insert( UDSEntry::UDS_ICON_NAME, _icon );
entry.insert( UDSEntry::UDS_USER, AfcProtocol::m_user );
entry.insert( UDSEntry::UDS_GROUP, AfcProtocol::m_group );
entry.insert( UDSEntry::UDS_ACCESS, 0755 );
return true;
}
开发者ID:sunzhigang,项目名称:kio_afc,代码行数:11,代码来源:afcdevice.cpp
示例19: statToEntry
UDSEntry kio_afpProtocol::statToEntry(KDE_struct_stat* stat)
{
UDSEntry entry;
UDSAtom atom;
if (S_ISDIR(stat->st_mode)) {
atom.m_uds = UDS_GUESSED_MIME_TYPE;
atom.m_str = "inode/directory";
entry.append( atom );
atom.m_uds = UDS_FILE_TYPE;
atom.m_long = S_IFDIR;
entry.append( atom );
} else {
atom.m_uds = UDS_GUESSED_MIME_TYPE;
atom.m_str = "text/plain";
entry.append( atom );
atom.m_uds = UDS_FILE_TYPE;
atom.m_long = S_IFREG;
entry.append( atom );
}
atom.m_uds = KIO::UDS_ACCESS;
atom.m_long = stat->st_mode;
entry.append( atom );
#if 0
atom.m_uds = KIO::UDS_USER;
struct passwd * passwd;
if ((passwd = getpwuid(stat->st_uid))) {
atom.m_str = passwd->pw_name;;
} else {
atom.m_str = "unknown";
}
entry.append( atom );
atom.m_uds = KIO::UDS_GROUP;
entry.append( atom );
#endif
return entry;
}
开发者ID:zach-klippenstein,项目名称:afpfs-ng,代码行数:42,代码来源:kafp.cpp
示例20:
void LDAPProtocol::LDAPEntry2UDSEntry( const TQString &dn, UDSEntry &entry,
const LDAPUrl &usrc, bool dir )
{
UDSAtom atom;
int pos;
entry.clear();
atom.m_uds = UDS_NAME;
atom.m_long = 0;
TQString name = dn;
if ( (pos = name.find(",")) > 0 )
name = name.left( pos );
if ( (pos = name.find("=")) > 0 )
name.remove( 0, pos+1 );
name.replace(' ', "_");
if ( !dir ) name += ".ldif";
atom.m_str = name;
entry.append( atom );
// the file type
atom.m_uds = UDS_FILE_TYPE;
atom.m_str = "";
atom.m_long = dir ? S_IFDIR : S_IFREG;
entry.append( atom );
// the mimetype
if (!dir) {
atom.m_uds = UDS_MIME_TYPE;
atom.m_long = 0;
atom.m_str = "text/plain";
entry.append( atom );
}
atom.m_uds = UDS_ACCESS;
atom.m_long = dir ? 0500 : 0400;
entry.append( atom );
// the url
atom.m_uds = UDS_URL;
atom.m_long = 0;
LDAPUrl url;
url=usrc;
url.setPath("/"+dn);
url.setScope( dir ? LDAPUrl::One : LDAPUrl::Base );
atom.m_str = url.prettyURL();
entry.append( atom );
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:48,代码来源:tdeio_ldap.cpp
注:本文中的UDSEntry类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论