sfml3.rb

Class: SFML::FtpDirectoryResponse

Inherits:
Object
  • Object
show all
Defined in:
ext/network/ftp.c,
ext/network/ftp.c

Overview

An FtpResponse specialization returned by Ftp#working_directory, additionally carrying the directory path.

Instance Method Summary collapse

Instance Method Details

#directory ⇒ String

Through the UTF-32 entry point, so a path with non-ASCII characters survives the trip; the plain getter re-encodes it through the C locale.

Returns:

  • (String)

Returns:

  • (String) —

    the directory requested/reported by the server



494
495
496
497
# File 'ext/network/ftp.c', line 494

static VALUE FtpDirectoryResponse_directory(VALUE self) {
    return utf32_to_rb(
        sfFtpDirectoryResponse_getDirectoryUnicode(Get_FtpDirectoryResponse_Struct(self)));
}

#message ⇒ String

Returns the message sent by the server.

Returns:

  • (String)

Returns:

  • (String) —

    the full response message sent by the server



482
483
484
485
# File 'ext/network/ftp.c', line 482

static VALUE FtpDirectoryResponse_message(VALUE self) {
    return rb_str_new_cstr(
        sfFtpDirectoryResponse_getMessage(Get_FtpDirectoryResponse_Struct(self)));
}

#ok? ⇒ Boolean

Returns true if the server reported success.

Returns:

  • (Boolean)

Returns:

  • (Boolean) —

    whether the status is a "success" code (< 400)



451
452
453
# File 'ext/network/ftp.c', line 451

static VALUE FtpDirectoryResponse_ok(VALUE self) {
    return BOOL2RB(sfFtpDirectoryResponse_isOk(Get_FtpDirectoryResponse_Struct(self)));
}

#status ⇒ Integer

Returns the raw status code reported by the server.

Returns:

  • (Integer)

Returns:

  • (Integer) —

    the raw FTP status code



461
462
463
# File 'ext/network/ftp.c', line 461

static VALUE FtpDirectoryResponse_status(VALUE self) {
    return INT2NUM(sfFtpDirectoryResponse_getStatus(Get_FtpDirectoryResponse_Struct(self)));
}

#status_name ⇒ Symbol

Returns the status as an FtpStatus name.

Returns:

  • (Symbol)

Returns:

  • (Symbol) —

    an FtpStatus name for #status



471
472
473
474
# File 'ext/network/ftp.c', line 471

static VALUE FtpDirectoryResponse_status_name(VALUE self) {
    return ID2SYM(rb_intern(
        ftp_status_name(sfFtpDirectoryResponse_getStatus(Get_FtpDirectoryResponse_Struct(self)))));
}