Class: Gsf::Infile

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

Instance Method Summary collapse

Methods inherited from Input

#container, #container=, #copy, #dump, #dup, #eof, #eof=, #eof?, error_id, #find_vba, #initialize, #modtime, #modtime=, #modtime_from_stat=, #name, #name=, #name_from_filename=, #position, #position=, #read, #read0, #read_raw, #remaining, #remaining=, #seek, #seek_emulate, #sibling, #size, #size=, #tell, #uncompress

Constructor Details

This class inherits a constructor from Gsf::Input

Instance Method Details

#child_by_aname(names) ⇒ Gsf::Input

This function finds a child that is several directory levels down the tree. If, for example, the names "foo", "bar", and "baz" are given, then this function first finds the "foo" directory in the root infile, then locates "bar" within that directory, and finally locates "baz" within that and returns the "baz" child. In other words, this function finds the "foo/bar/baz" child.

New in 1.14.9.

Parameters:

  • names (Array<String>)

    A nil terminated array of names (e.g. from g_strsplit)

Returns:

  • (Gsf::Input)

    a newly created child which must be unrefed.

#child_by_index(i) ⇒ Gsf::Input

TODO : For 2.0 api will change to include a #GError.

Parameters:

  • i (Integer)

    target index

Returns:

  • (Gsf::Input)

    a newly created child which must be unrefed.

#child_by_name(name) ⇒ Gsf::Input

The function returns a named child of the given infile. This only works for an immediate child. If you need to go several levels down use gsf_infile_child_by_aname, for example.

TODO : For 2.0 api will change to include a #GError. unrefed.

Parameters:

  • name (String)

    target name

Returns:

  • (Gsf::Input)

    a newly created child which must be

#child_by_vaname(names) ⇒ Gsf::Input

Apart from argument types, this is the same as gsf_infile_child_by_aname. Please see the documentation there. New in 1.14.9.

Parameters:

  • names (Gsf::va_list)

    A nil terminated array of names (e.g. from g_strsplit)

Returns:

  • (Gsf::Input)

    a newly created child which must be unrefed.

#child_by_vname(array) ⇒ Gsf::Input

Apart from the way arguments are specified, this is the same as gsf_infile_child_by_aname. Please see the documentation there.

Parameters:

  • array (Array)

    A nil terminated list of names

Returns:

  • (Gsf::Input)

    a newly created child which must be unrefed.

#name_by_index(i) ⇒ String

Returns the utf8 encoded name of the i-th child.

Parameters:

  • i (Integer)

    zero-based index of child to find.

Returns:

  • (String)

    the utf8 encoded name of the i-th child

#num_childrenInteger

Returns the number of children the storage has, or -1 if the storage can not have children.

Returns:

  • (Integer)

    the number of children the storage has, or -1 if the storage can not have children.