file: pathbuf.aus

class: GPathBufLayout

[12:14] static extends: object

Generated struct layout helper for GIR record PathBuf.

Methods

class: GPathBuf

[36:7] extends: object

GPathBuf is a helper type that allows you to easily build paths from individual elements, using the platform specific conventions for path separators. c g_auto (GPathBuf) path; g_path_buf_init (&path); g_path_buf_push (&path, "usr"); g_path_buf_push (&path, "bin"); g_path_buf_push (&path, "echo"); g_autofree char *echo = g_path_buf_to_path (&path); g_assert_cmpstr (echo, ==, "/usr/bin/echo"); You can also load a full path and then operate on its components: c g_auto (GPathBuf) path; g_path_buf_init_from_path (&path, "/usr/bin/echo"); g_path_buf_pop (&path); g_path_buf_push (&path, "sh"); g_autofree char *sh = g_path_buf_to_path (&path); g_assert_cmpstr (sh, ==, "/usr/bin/sh");

Members

Methods