Top | ![]() |
![]() |
![]() |
![]() |
gboolean
na_core_utils_boolean_from_string (const gchar *string
);
Since: 2.30
gchar * na_core_utils_str_add_prefix (const gchar *prefix
,const gchar *str
);
na_core_utils_str_add_prefix
has been deprecated since version 3.2 and should not be used in newly-written code.
Appends a prefix to each line of the string.
Since: 2.30
int na_core_utils_str_collate (const gchar *str1
,const gchar *str2
);
Since: 2.30
gchar * na_core_utils_str_remove_char (const gchar *string
,const gchar *to_remove
);
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.
Since: 2.30
gchar * na_core_utils_str_remove_suffix (const gchar *string
,const gchar *suffix
);
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.
Since: 2.30
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.
string |
a space-separated string. |
|
first |
a pointer to a gchar *. |
|
other |
a pointer to a gchar *. |
Since: 2.30
gchar * na_core_utils_str_subst (const gchar *pattern
,const gchar *key
,const gchar *subst
);
void na_core_utils_slist_add_message (GSList **list
,const gchar *format
,...
);
GSList *
na_core_utils_slist_duplicate (GSList *slist
);
Since: 2.30
void na_core_utils_slist_dump (const gchar *prefix
,GSList *list
);
Dumps the content of a list of strings.
Since: 2.30
GSList *
na_core_utils_slist_from_array (const gchar **str_array
);
Since: 2.30
GSList * na_core_utils_slist_from_split (const gchar *text
,const gchar *separator
);
a GSList with the list of strings after having been splitted.
The returned GSList should be na_core_utils_slist_free()
by the caller.
Since: 2.30
gchar * na_core_utils_slist_join_at_end (GSList *slist
,const gchar *link
);
Since: 2.30
GSList * na_core_utils_slist_remove_ascii (GSList *slist
,const gchar *text
);
Removes a string from a GSList of strings.
Since: 2.30
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
.
Since: 2.30
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
Since: 2.30
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
.
list |
the GSList of strings to be setup. |
|
element |
the string to add to or remove of the list. |
|
set |
whether the |
Since: 2.30
guint na_core_utils_slist_count (GSList *list
,const gchar *str
);
Search for a string in a string list.
Since: 2.30
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.
Since: 2.30
gboolean na_core_utils_slist_are_equal (GSList *a
,GSList *b
);
Compare two string lists, without regards to the order.
Since: 2.30
void
na_core_utils_slist_free (GSList *slist
);
Releases the strings and the list itself.
Since: 2.30
gchar * na_core_utils_gstring_joinv (const gchar *start
,const gchar *separator
,gchar **list
);
Concatenates a gchar **list of strings to a new string.
start |
a prefix to be written at the beginning of the output string. |
|
separator |
a string to be used as separator. |
|
list |
the list of strings to be concatenated. |
Since: 2.30
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
);
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...
Since: 2.30
gboolean
na_core_utils_dir_is_writable_uri (const gchar *uri
);
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...
Since: 2.30
void na_core_utils_dir_list_perms (const gchar *path
,const gchar *message
);
Displays the permissions of the directory on debug output.
path |
the path of the directory to be tested. |
|
message |
a message to be printed if not |
Since: 3.1
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.
string |
the input path or URI to be splitted. |
|
first |
a pointer to a buffer which will contain the first part of the split. |
|
ext |
a pointer to a buffer which will contain the extension part of the path. |
Since: 2.30
gboolean
na_core_utils_file_exists (const gchar *uri
);
TRUE
if the specified file exists, FALSE
else.
Race condition: cf. na_core_utils_dir_is_writable_path()
and
na_core_utils_dir_is_writable_uri()
comments.
Since: 2.30
gboolean
na_core_utils_file_is_loadable (const gchar *uri
);
Checks that the file is suitable to be loaded in memory, because it is not empty, and its size is reasonable (less than 1MB). Also checks that a file is a regular file (or a symlink to a regular file).
Since: 3.1
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
read content if not NULL
.
uri |
the URI the file must be loaded from. |
|
length |
a pointer to the length of the read content. |
the newly allocated buffer which contains the file content, or NULL
.
This buffer should be g_free()
by the caller.
Since: 2.30
void
na_core_utils_print_version (void
);
Print a version message on the console
caja-actions-new (Caja-Actions) v 2.29.1 Copyright (C) 2005-2007 Frederic Ruaudel Copyright (C) 2009, 2010, 2011, 2012 Pierre Wieser Caja-Actions is free software, licensed under GPLv2 or later.
Since: 2.30