get_parse_name


Description:

public abstract string get_parse_name ()

Gets the parse name of the this.

A parse name is a UTF-8 string that describes the file such that one can get the File back using parse_name.

This is generally used to show the File as a nice full-pathname kind of string in a user interface, like in a location entry.

For local files with names that can safely be converted to UTF-8 the pathname is used, otherwise the IRI is used (a form of URI that allows UTF-8 characters unescaped).

This call does no blocking I/O.

Example: Parse names:

public static int main (string[] args) {
// Output: ``../my/dir/my-test.txt``
File file = File.new_for_path ("../my/dir/my-test.txt");
string parse_name = file.get_parse_name ();
print ("%s\n", parse_name);

File file2 = File.parse_name (parse_name);
// ...
file2 = null;
return 0;
}

valac --pkg gio-2.0 GLib.File.get_parse_name.vala

Parameters:

this

input File

Returns:

a string containing the File's parse name. The returned string should be freed with g_free when no longer needed.