Class: Gsf::Output

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.error_idGLib::Quark

Returns:

  • (GLib::Quark)

.unwrap(wrapper, wrapee) ⇒ Boolean

Returns true if the unwrapping succeeded.

Parameters:

Returns:

  • (Boolean)

    true if the unwrapping succeeded.

.wrap(wrapper, wrapee) ⇒ Boolean

Returns true if the wrapping succeeded.

Parameters:

Returns:

  • (Boolean)

    true if the wrapping succeeded.

Instance Method Details

#closeBoolean

Close a stream.

Returns:

  • (Boolean)

    false on error

#containerGsf::Outfile

The container, optionally nil, in which this output lives.

Returns:

#container=(container) ⇒ Gsf::Outfile

The container, optionally nil, in which this output lives.

Parameters:

Returns:

#errorGLib::Error

Returns the last error logged on the output.

Returns:

  • (GLib::Error)

    the last error logged on the output

#is_closedBoolean

Returns true if output has already been closed.

Returns:

  • (Boolean)

    true if output has already been closed.

#is_closed=(is_closed) ⇒ Boolean

true if the output has been closed.

Parameters:

  • is_closed (Boolean)

Returns:

  • (Boolean)

    is-closed

  • (Boolean)

    is-closed

#is_closed?Boolean

true if the output has been closed.

Returns:

  • (Boolean)

    is-closed

#modtimeGLib::DateTime

The time the output was last updated. This must be set on object construction and represents the timestamp to put on the resulting file or Gsf::Outfile member. Not all derived classes will actually do anything with this property.

Returns:

  • (GLib::DateTime)

    modtime

#modtime=(modtime) ⇒ GLib::DateTime

The time the output was last updated. This must be set on object construction and represents the timestamp to put on the resulting file or Gsf::Outfile member. Not all derived classes will actually do anything with this property.

Parameters:

  • modtime (GLib::DateTime)

Returns:

  • (GLib::DateTime)

    modtime

  • (GLib::DateTime)

    modtime

#nameString

Returns name.

Returns:

  • (String)

    name

#name=(name) ⇒ String

Parameters:

  • name (String)

Returns:

  • (String)

    name

  • (String)

    name

#name_from_filename=(filename) ⇒ Boolean

This is a utility routine that should only be used by derived outputs.

Parameters:

  • filename (String)

    the (fs-sys encoded) filename

Returns:

  • (Boolean)

    true if the assignment was ok.

#positionInteger

The current position in the output.

Returns:

  • (Integer)

    position

#position=(position) ⇒ Integer

The current position in the output.

Parameters:

  • position (Integer)

Returns:

  • (Integer)

    position

  • (Integer)

    position

#printf(format, array) ⇒ Boolean

Output Varargs to output using the format string format, similar to printf 3.

Parameters:

  • format (String)

    The printf-style format string

  • array (Array)

    the arguments for format

Returns:

  • (Boolean)

    true if successful, false if not

#puts(line) ⇒ Boolean

Like fputs, this assumes that the line already ends with a newline

Parameters:

  • line (String)

    Nul terminated string to write

Returns:

  • (Boolean)

    true if successful, false if not

#seek(offset, whence) ⇒ Boolean

Reposition in output stream output. whence specifies what the offset is relative to: the beginning of the stream (%G_SEEK_SET), current position in the stream (%G_SEEK_CUR) or the end of the stream (%G_SEEK_END). This function is similar to fseek 3.

Parameters:

  • offset (Gsf::gsf_off_t)

    Relative amount to reposition

  • whence (GLib::SeekType)

    What the offset is relative to.

Returns:

  • (Boolean)

    false on error.

#set_error(code, format, array) ⇒ Boolean

This is a utility routine that should only be used by derived outputs.

Parameters:

  • code (Integer)

    The error id

  • format (String)

    printf style format string

  • array (Array)

    arguments for format

Returns:

  • (Boolean)

    Always returns false to facilitate its use.

#sizeInteger

The current file size.

Returns:

  • (Integer)

    size

#size=(size) ⇒ Integer

The current file size.

Parameters:

  • size (Integer)

Returns:

  • (Integer)

    size

  • (Integer)

    size

#tellGsf::gsf_off_t

Tell the current position in output, similar to ftell 3.

Returns:

  • (Gsf::gsf_off_t)

    the current position in the file

#vprintf(format, args) ⇒ Gsf::gsf_off_t

Output args to output using the format string format, similar to vprintf 3.

Parameters:

  • format (String)

    The printf-style format string

  • args (Gsf::va_list)

    the arguments for format

Returns:

  • (Gsf::gsf_off_t)

    number of bytes printed, a negative value if not successful

#write(num_bytes, data) ⇒ Boolean

Write num_bytes of data to output.

Parameters:

  • num_bytes (Integer)

    Number of bytes to write

  • data (Array<Integer>)

    Data to write.

Returns:

  • (Boolean)

    false on error.