push


Description:

public unowned PathBuf push (string path)

Extends the given path buffer with path.

If path is absolute, it replaces the current path.

If path contains a directory separator, the buffer is extended by as many elements the path provides.

On Windows, both forward slashes and backslashes are treated as directory separators. On other platforms, g_dir_separator_s is the only directory separator.

GPathBuf buf, cmp;

g_path_buf_init_from_path (&buf, "/tmp");
g_path_buf_push (&buf, ".X11-unix/X0");
g_path_buf_init_from_path (&cmp, "/tmp/.X11-unix/X0");
g_assert_true (g_path_buf_equal (&buf, &cmp));
g_path_buf_clear (&cmp);

g_path_buf_push (&buf, "/etc/locale.conf");
g_path_buf_init_from_path (&cmp, "/etc/locale.conf");
g_assert_true (g_path_buf_equal (&buf, &cmp));
g_path_buf_clear (&cmp);

g_path_buf_clear (&buf);

Parameters:

this

a path buffer

path

a path

Returns:

the same pointer to this, for convenience