QFtpCompat 1.0.0
Qt6-compatible async FTP client library
Loading...
Searching...
No Matches
QFtpCompatDirEntry Class Reference

Represents a single entry from an FTP LIST response. More...

#include <qftpcompatdirentry.h>

Public Member Functions

QString name () const noexcept
 File or directory name (never includes the path).
QString permissions () const noexcept
 Unix permission string, e.g. "-rw-r--r--". Empty for Windows listings.
QString owner () const noexcept
 Owning user name. Empty when not available.
QString group () const noexcept
 Owning group name. Empty when not available.
qint64 size () const noexcept
 File size in bytes. 0 for directories.
QDateTime lastModified () const noexcept
 Last-modification timestamp. May be approximate (year inferred when absent).
bool isDirectory () const noexcept
 true for directory entries.
bool isSymLink () const noexcept
 true for symbolic links.
QString linkTarget () const noexcept
 Symlink target path. Empty when isSymLink() is false.
QString toString () const
 Returns a human-readable summary for debug output.

Static Public Member Functions

static QVector< QFtpCompatDirEntryparseList (const QByteArray &rawListing)
 Parses a full LIST / MLSD response body into directory entries.

Detailed Description

Represents a single entry from an FTP LIST response.

Populated by QFtpCompatDirEntry::parseList(), which attempts to parse the three most common server listing formats in the following order:

  1. MLSD (RFC 3659) – "Type=file;Size=12345;Modify=20210101120000; name"
  2. **Unix** (POSIX ls) – "-rw-r&ndash;r&ndash; 1 owner group 12345 Jan 1 12:00 name"
  3. **Windows** (MS-DOS) – "01-01-21 12:00PM <DIR> name"

Lines that cannot be parsed in any format are silently skipped; check the returned vector's size if a complete listing is required.

Definition at line 30 of file qftpcompatdirentry.h.

Member Function Documentation

◆ parseList()

QVector< QFtpCompatDirEntry > QFtpCompatDirEntry::parseList ( const QByteArray & rawListing)
staticnodiscard

Parses a full LIST / MLSD response body into directory entries.

Parameters
rawListingRaw bytes received on the FTP data channel.
Returns
All successfully parsed entries; unrecognised lines are dropped.

Definition at line 16 of file qftpcompatdirentry.cpp.


The documentation for this class was generated from the following files: