Top |
gchar * | exo_str_elide_underscores () |
gboolean | exo_str_is_equal () |
#define | exo_str_is_empty() |
gboolean | exo_str_is_flag () |
gboolean | exo_str_looks_like_an_uri () |
gchar * | exo_str_replace () |
gchar * | exo_strdup_strftime () |
gchar ** | exo_strndupv () |
#define | I_() |
gchar *
exo_str_elide_underscores (const gchar *text
);
exo_str_elide_underscores
is deprecated and should not be used in newly-written code.
xfce 4.18: Unused within xfce project
Returns a copy of text
with all mnemonic underscores
stripped off.
gboolean exo_str_is_equal (const gchar *a
,const gchar *b
);
exo_str_is_equal
is deprecated and should not be used in newly-written code.
xfce 4.18: In favor of g_strcmp0()
NULL
-safe string comparison. Returns TRUE
if both a
and b
are
NULL
or if a
and b
refer to valid strings which are equal.
You should always prefer this function over strcmp()
.
#define exo_str_is_empty(string) ((string) == NULL || *(string) == '\0')
exo_str_is_empty
is deprecated and should not be used in newly-written code.
xfce 4.18: Replaced with xfce_str_is_empty()
Macro to check if a string is NULL
or empty. You should prefer
this function over strlen (str) == 0.
gboolean
exo_str_is_flag (const gchar *str
);
exo_str_is_flag
is deprecated and should not be used in newly-written code.
xfce 4.18: In favor of g_str_has_prefix()
Check if str
looks like a commandline flag. This function simply
checks if the string begins with a single dash.
Since: 0.11.5
gboolean
exo_str_looks_like_an_uri (const gchar *str
);
exo_str_looks_like_an_uri
is deprecated and should not be used in newly-written code.
xfce 4.18: In favor of g_uri_is_valid()
Check if str
looks like an uri. This function is no guarantee that
the uri exists, or is supported by the system.
Since: 0.5.0
gchar * exo_str_replace (const gchar *str
,const gchar *pattern
,const gchar *replacement
);
exo_str_replace
is deprecated and should not be used in newly-written code.
xfce 4.18: Replaced by xfce_str_replace()
Searches str
for occurances of pattern
and replaces each
such occurance with replacement
. Returns a newly allocated
copy of str
on which the given replacement were performed.
The caller is responsible to free the returned string using
g_free()
when no longer needed.
Note that pattern
and replacement
don't need to be of the
same size. If replacement
is NULL
, the pattern will be
removed from the string.
str |
the input string. |
|
pattern |
a search pattern in |
|
replacement |
replacement string for |
a newly allocated copy of str
where all occurances of
pattern
are replaced with replacement
. Or NULL
if
str
and/or pattern
is NULL
.
Since: 0.3.1.1
gchar * exo_strdup_strftime (const gchar *format
,const struct tm *tm
);
exo_strdup_strftime
is deprecated and should not be used in newly-written code.
xfce 4.18: In favor of g_date_time_format()
Cover for standard date-and-time-formatting routine strftime that returns
a newly-allocated string of the correct size. The caller is responsible
to free the returned string using g_free()
when no longer needed.
Besides the buffer management, there are two differences between this and the library strftime:
The modifiers "-" and "_" between a "%" and a numeric directive are defined as for the GNU version of strftime. "-" means "do not pad the field" and "_" means "pad with spaces instead of zeroes".
Non-ANSI extensions to strftime are flagged at runtime with a warning, so it's easy to notice use of the extensions without testing with multiple versions of the library.
Do NOT pass in the value returned by localtime(3) as the parameter tm
, as
this is a pointer to a shared static struct which can be changed by subsequent
function calls, including any calls to g_warning()
made by exo_strdup_strftime()
itself. Use e.g. localtime_r(3) or make a copy of the struct to pass in instead.
format |
format string to pass to strftime(3). See the strftime(3) documentation for details. |
|
tm |
date/time, in struct tm format. |
Since: 0.3.3
gchar ** exo_strndupv (gchar **strv
,guint num
);
exo_strndupv
is deprecated and should not be used in newly-written code.
xfce 4.18: Unused within xfce project
Creates a new string vector containing the first n
elements
of strv
. If called on a NULL
value or num
is 0, exo_strndupv()
simply returns NULL
.