class EE::Network::Ftp::Response

Overview

Define a FTP response. More…

#include <ftp.hpp>

class Response {
public:
    // enums

    enum Status;

    // construction

    Response(Status code = InvalidResponse, const std::string& message = "");

    // methods

    bool isOk() const;
    Status getStatus() const;
    const std::string& getMessage() const;
};

Detailed Documentation

Define a FTP response.

Construction

Response(Status code = InvalidResponse, const std::string& message = "")

Default constructor.

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

Parameters:

code

Response status code

message

Response message

Methods

bool isOk() const

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

Status getStatus() const

Get the status code of the response.

Returns:

Status code

const std::string& getMessage() const

Get the full message contained in the response.

Returns:

The response message