Class FTP::Response#

Nested Relationships#

This class is a nested type of Class FTP.

Inheritance Relationships#

Derived Types#

Class Documentation#

class Response

Subclassed by TRAP::Network::FTP::DirectoryResponse, TRAP::Network::FTP::ListingResponse

Public Types

enum class Status

Status codes possibly returned by a FTP response.

Values:

enumerator RestartMarkerReply
enumerator ServiceReadySoon
enumerator DataConnectionAlreadyOpened
enumerator OpeningDataConnection
enumerator OK
enumerator PointlessCommand
enumerator SystemStatus
enumerator DirectoryStatus
enumerator FileStatus
enumerator HelpMessage
enumerator SystemType
enumerator ServiceReady
enumerator ClosingConnection
enumerator DataConnectionOpened
enumerator ClosingDataConnection
enumerator EnteringPassiveMode
enumerator LoggedIn
enumerator FileActionOK
enumerator DirectoryOK
enumerator NeedPassword
enumerator NeedAccountToLogIn
enumerator NeedInformation
enumerator ServiceUnavailable
enumerator DataConnectionUnavailable
enumerator TransferAborted
enumerator FileActionAborted
enumerator LocalError
enumerator InsufficientStorageSpace
enumerator CommandUnknown
enumerator ParametersUnknown
enumerator CommandNotImplemented
enumerator BadCommandSequence
enumerator ParameterNotImplemented
enumerator NotLoggedIn
enumerator NeedAccountToStore
enumerator FileUnavailable
enumerator PageTypeUnknown
enumerator NotEnoughMemory
enumerator FilenameNotAllowed
enumerator InvalidResponse
enumerator ConnectionFailed
enumerator ConnectionClosed
enumerator InvalidFile

Public Functions

explicit constexpr Response(Status code = Status::InvalidResponse, std::string message = "") noexcept

This constructor is used by the FTP client to build the response.

Parameters:
constexpr Response(const Response&) = default

Copy constructor.

constexpr Response &operator=(const Response&) = default

Copy assignment operator.

constexpr Response(Response&&) noexcept = default

Move constructor.

constexpr Response &operator=(Response&&) noexcept = default

Move assignment operator.

constexpr ~Response() = default

Destructor.

constexpr bool IsOK() const noexcept

Check if the status code means a success.

This function is defined for convenience, it is equivalent to testing if the status code is < 400.

Returns:

True if the status is a success, false if it is a failure.

constexpr Status GetStatus() const noexcept

Get the status code of the response.

Returns:

Status code.

constexpr std::string GetMessage() const noexcept

Get the full message contained in the response.

Returns:

The response message.