25 #include <tdeio/global.h>
31 if( info.type() == UrlInfo::message )
33 else if( info.type() == UrlInfo::directory )
36 return TDEIO::UDSEntry();
41 kdDebug() <<
"Stat::stat()" << endl;
42 TDEIO::UDSEntry entry;
45 if( info.type() == UrlInfo::invalid )
47 else if( info.type() == UrlInfo::message )
50 Stat::addAtom( entry, TDEIO::UDS_FILE_TYPE, S_IFREG );
51 Stat::addAtom( entry, TDEIO::UDS_MIME_TYPE,
"message/rfc822" );
53 url = TQString(
"mbox:%1/%2" ).arg( info.filename(), mbox.
currentID() );
54 Stat::addAtom( entry, TDEIO::UDS_URL, url );
56 Stat::addAtom( entry, TDEIO::UDS_NAME,
"foobar" );
58 Stat::addAtom( entry, TDEIO::UDS_NAME, mbox.
currentID() );
61 Stat::addAtom( entry, TDEIO::UDS_SIZE, mbox.
skipMessage() );
68 kdDebug() <<
"statDirectory()" << endl;
69 TDEIO::UDSEntry entry;
72 Stat::addAtom( entry, TDEIO::UDS_FILE_TYPE, S_IFDIR );
73 Stat::addAtom( entry, TDEIO::UDS_NAME, info.filename() );
80 kdDebug() <<
"statMessage( " << info.url() <<
" )" << endl;
81 TDEIO::UDSEntry entry;
82 TQString url = TQString(
"mbox:%1" ).arg( info.url() );
85 Stat::addAtom( entry, TDEIO::UDS_FILE_TYPE, S_IFREG );
86 Stat::addAtom( entry, TDEIO::UDS_MIME_TYPE,
"message/rfc822" );
88 Stat::addAtom( entry, TDEIO::UDS_URL, url );
89 url = url.right( url.length() - url.findRev(
"/" ) - 1 );
90 Stat::addAtom( entry, TDEIO::UDS_NAME, url );
95 void Stat::addAtom( TDEIO::UDSEntry& entry,
unsigned int uds,
const TQString& str )
102 entry.append( atom );
106 void Stat::addAtom( TDEIO::UDSEntry& entry,
unsigned int uds,
long lng )
110 atom.m_str = TQString();
113 entry.append( atom );
This class handels reading from a mbox-file.
TQString currentID() const
This function returns the current id.
unsigned int skipMessage()
Skips all lines which belongs to the current message.
bool searchMessage(const TQString &id)
This function search the file for a certain id.
static TDEIO::UDSEntry statDirectory(const UrlInfo &info)
This function gets the stats of a given mbox-file in an UDSEntry.
static TDEIO::UDSEntry statMessage(const UrlInfo &info)
This function gets the stats of a geven mbox-message in a UDSEntry.
static TDEIO::UDSEntry stat(const UrlInfo &info)
This functions gives information with a given UrlInfo.