![]() |
![]() |
![]() |
nautilus-actions Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
gboolean na_core_utils_boolean_from_string (const gchar *string); gchar * na_core_utils_str_add_prefix (const gchar *prefix, const gchar *str); int na_core_utils_str_collate (const gchar *str1, const gchar *str2); gchar * na_core_utils_str_remove_char (const gchar *string, const gchar *to_remove); gchar * na_core_utils_str_remove_suffix (const gchar *string, const gchar *suffix); void na_core_utils_str_split_first_word (const gchar *string, gchar **first, gchar **other); void na_core_utils_slist_add_message (GSList **list, const gchar *format, ...); GSList * na_core_utils_slist_duplicate (GSList *slist); void na_core_utils_slist_dump (const gchar *prefix, GSList *list); GSList * na_core_utils_slist_from_array (const gchar **str_array); GSList * na_core_utils_slist_from_split (const gchar *text, const gchar *separator); gchar * na_core_utils_slist_join_at_end (GSList *slist, const gchar *link); GSList * na_core_utils_slist_remove_ascii (GSList *slist, const gchar *text); GSList * na_core_utils_slist_remove_utf8 (GSList *slist, const gchar *text); gchar ** na_core_utils_slist_to_array (GSList *slist); gchar * na_core_utils_slist_to_text (GSList *slist); GSList * na_core_utils_slist_setup_element (GSList *list, const gchar *element, gboolean set); guint na_core_utils_slist_count (GSList *list, const gchar *str); gboolean na_core_utils_slist_find_negated (GSList *list, const gchar *str); gboolean na_core_utils_slist_are_equal (GSList *a, GSList *b); void na_core_utils_slist_free (GSList *slist); gchar * na_core_utils_gstring_joinv (const gchar *start, const gchar *separator, gchar **list); void na_core_utils_selcount_get_ope_int (const gchar *selection_count, gchar **ope, gchar **uint); gboolean na_core_utils_dir_is_writable_path (const gchar *path); gboolean na_core_utils_dir_is_writable_uri (const gchar *uri); void na_core_utils_dir_split_ext (const gchar *string, gchar **first, gchar **ext); gboolean na_core_utils_file_delete (const gchar *path); gboolean na_core_utils_file_exists (const gchar *uri); gchar * na_core_utils_file_load_from_uri (const gchar *uri, gsize *length); void na_core_utils_print_version (void);
gboolean na_core_utils_boolean_from_string (const gchar *string);
|
a string to be converted. |
Returns : |
TRUE if the string evaluates to "true" (case insensitive),
FALSE else.
|
gchar * na_core_utils_str_add_prefix (const gchar *prefix, const gchar *str);
Appends a prefix to each line of the string.
|
the prefix to be prepended. |
|
a multiline string. |
Returns : |
a new string which should be g_free() by the caller.
|
int na_core_utils_str_collate (const gchar *str1, const gchar *str2);
|
an UTF-8 encoded string. |
|
an UTF-8 encoded string. |
Returns : |
-1 if str1 < str2, 0 if str1 = str2, +1 if str1 > str2. |
gchar * na_core_utils_str_remove_char (const gchar *string, const gchar *to_remove);
|
source string. |
|
the character to remove. |
Returns : |
a newly allocated string, which is a copy of the source string ,
minus all the found occurrences of the given to_remove char.
The returned string should be g_free() by the caller.
|
gchar * na_core_utils_str_remove_suffix (const gchar *string, const gchar *suffix);
|
source string. |
|
suffix to be removed from string .
|
Returns : |
a newly allocated string, which is a copy of the source string ,
minus the removed suffix if present. If strings doesn't terminate with
suffix , then the returned string is equal to source string .
The returned string should be g_free() by the caller.
|
void na_core_utils_str_split_first_word (const gchar *string, gchar **first, gchar **other);
Split the string
string into two components:
- the first word which is allocated in first
,
- the rest of the string which is allocated in other
.
The two allocated strings should be g_free()
by the caller.
|
a space-separated string. |
|
a pointer to a gchar *. |
|
a pointer to a gchar *. |
void na_core_utils_slist_add_message (GSList **list, const gchar *format, ...);
|
|
|
|
|
GSList * na_core_utils_slist_duplicate (GSList *slist);
|
the GSList to be duplicated. |
Returns : |
a GSList of strings.
The returned list should be na_core_utils_slist_free() by the caller.
|
void na_core_utils_slist_dump (const gchar *prefix, GSList *list);
Dumps the content of a list of strings.
|
a string to be used as a prefix for each outputed line. |
|
a list of strings. |
GSList * na_core_utils_slist_from_array (const gchar **str_array);
|
an NULL-terminated array of strings. |
Returns : |
a GSList list of strings, which should be #na_core_utils_slist_free()
by the caller.
|
GSList * na_core_utils_slist_from_split (const gchar *text, const gchar *separator);
|
a string to be splitted. |
|
the string to be used as the separator. |
Returns : |
a GSList with the list of strings after having been splitted.
The returned GSList should be na_core_utils_slist_free() by the caller.
|
gchar * na_core_utils_slist_join_at_end (GSList *slist, const gchar *link);
|
the string list to join. |
|
the string used to join each element. |
Returns : |
a newly allocated string which should be g_free() by the caller.
|
GSList * na_core_utils_slist_remove_ascii (GSList *slist, const gchar *text);
Removes a string from a GSList of strings.
|
the GSList to be updated. |
|
string to remove. |
Returns : |
the same, updated, slist .
|
GSList * na_core_utils_slist_remove_utf8 (GSList *slist, const gchar *text);
Removes from the slist
the item which has a string which is equal to
text
.
|
the GSList to be updated. |
|
the string to be removed. |
Returns : |
the new slist start position.
|
gchar ** na_core_utils_slist_to_array (GSList *slist);
|
a list of strings. |
Returns : |
a newly allocated array of strings, which should be
g_strfreev() by the caller.
|
gchar * na_core_utils_slist_to_text (GSList *slist);
Concatenates a string list to a semi-colon-separated text suitable for an entry in the user interface
|
a list of strings. |
Returns : |
a newly allocated string, which should be g_free() by the
caller.
|
GSList * na_core_utils_slist_setup_element (GSList *list, const gchar *element, gboolean set);
Setup the list
so that the element
is once in the list
if set
is TRUE
,
or not if set
is FALSE
.
|
the GSList of strings to be setup. |
|
the string to add to or remove of the list. |
|
whether the element should be set or removed.
|
Returns : |
the updated list .
|
guint na_core_utils_slist_count (GSList *list, const gchar *str);
Search for a string in a string list.
|
the GSList of strings to be searched. |
|
the searched string. |
Returns : |
the count of @ßtr in list list.
|
gboolean na_core_utils_slist_find_negated (GSList *list, const gchar *str);
Search for a string in a string list which may contain nagated items.
|
the GSList of strings to be searched. |
|
the searched string. |
Returns : |
TRUE if the string has been found in list.
|
gboolean na_core_utils_slist_are_equal (GSList *a, GSList *b);
Compare two string lists, without regards to the order.
|
a GSList of strings. |
|
another GSList of strings to be compared with first .
|
Returns : |
TRUE if the two lists have same content.
|
void na_core_utils_slist_free (GSList *slist);
Releases the strings and the list itself.
|
a GSList list of strings. |
gchar * na_core_utils_gstring_joinv (const gchar *start, const gchar *separator, gchar **list);
Concatenates a gchar **list of strings to a new string.
|
a prefix to be written at the beginning of the output string. |
|
a string to be used as separator. |
|
the list of strings to be concatenated. |
Returns : |
a newly allocated string which should be g_free() by the caller.
|
void na_core_utils_selcount_get_ope_int (const gchar *selection_count, gchar **ope, gchar **uint);
|
|
|
|
|
gboolean na_core_utils_dir_is_writable_path (const gchar *path);
|
the path of the directory to be tested. |
Returns : |
TRUE if the directory is writable, FALSE else.
Please note that this type of test is subject to race conditions,
as the directory may become unwritable after a successful test,
but before the caller has been able to actually write into it.
There is no "super-test". Just try...
|
gboolean na_core_utils_dir_is_writable_uri (const gchar *uri);
|
the URI of the directory to be tested. |
Returns : |
TRUE if the directory is writable, FALSE else.
Please note that this type of test is subject to race conditions,
as the directory may become unwritable after a successful test,
but before the caller has been able to actually write into it.
There is no "super-test". Just try...
|
void na_core_utils_dir_split_ext (const gchar *string, gchar **first, gchar **ext);
Split the given string
, returning the first part and the extension in newly
allocated buffers which should be g_free()
by the caller.
The extension is set to an empty string if no extension is detected.
|
the input path or URI to be splitted. |
|
a pointer to a buffer which will contain the first part of the split. |
|
a pointer to a buffer which will contain the extension part of the path. |
gboolean na_core_utils_file_delete (const gchar *path);
|
the path of the file to be deleted. |
Returns : |
TRUE if the file is successfully deleted, FALSE else.
|
gboolean na_core_utils_file_exists (const gchar *uri);
|
a file URI. |
Returns : |
TRUE if the specified file exists, FALSE else.
Race condition: cf. na_core_utils_dir_is_writable() comment.
|
gchar * na_core_utils_file_load_from_uri (const gchar *uri, gsize *length);
Loads the file into a newly allocated buffer, and set up the length of the
readen content if not NULL
.
|
the URI the file must be loaded from. |
|
a pointer to the length of the readen content. |
Returns : |
the newly allocated buffer which contains the file content, or NULL .
This buffer should be g_free() by the caller.
|
void na_core_utils_print_version (void);
Print a version message on the console
nautilus-actions-new (Nautilus-Actions) v 2.29.1 Copyright (C) 2005-2007 Frederic Ruaudel Copyright (C) 2009, 2010 Pierre Wieser Nautilus-Actions is free software, licensed under GPLv2 or later.