Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
Functions
audstrings.h File Reference
#include <stdlib.h>
#include <glib.h>

Go to the source code of this file.

Functions

G_BEGIN_DECLS gchar * str_append (gchar *str, const gchar *add_str)
gchar * str_replace (gchar *str, gchar *new_str)
void str_replace_in (gchar **str, gchar *new_str)
gboolean str_has_prefix_nocase (const gchar *str, const gchar *prefix)
gboolean str_has_suffix_nocase (const gchar *str, const gchar *suffix)
gboolean str_has_suffixes_nocase (const gchar *str, gchar *const *suffixes)
gchar * str_assert_utf8 (const gchar *str)
 This function can be used to assert that a given string is valid UTF-8.
void str_set_utf8_impl (gchar *(*stu_impl)(const gchar *), gchar *(*stuf_impl)(const gchar *, gssize, gsize *, gsize *, GError **))
gchar * str_to_utf8 (const gchar *str)
 Convert given string from nearly any encoding to UTF-8 encoding.
gchar * str_to_utf8_full (const gchar *str, gssize len, gsize *bytes_read, gsize *bytes_written, GError **err)
const gchar * str_skip_chars (const gchar *str, const gchar *chars)
gchar * convert_dos_path (gchar *text)
gchar * filename_get_subtune (const gchar *filename, gint *track)
 Checks if given URI contains a subtune indicator/number.
gchar * filename_split_subtune (const gchar *filename, gint *track)
 Given file path/URI contains ending indicating subtune number "?<number>", splits the string into filename without subtune value.
void string_replace_char (gchar *string, gchar old_str, gchar new_str)
void string_decode_percent (gchar *string)
gchar * string_encode_percent (const gchar *string, gboolean is_filename)
gboolean uri_is_utf8 (const gchar *uri, gboolean warn)
gchar * uri_to_utf8 (const gchar *uri)
void uri_check_utf8 (gchar **uri, gboolean warn)
gchar * filename_to_uri (const gchar *filename)
gchar * uri_to_filename (const gchar *uri)
gchar * uri_to_display (const gchar *uri)
gchar * uri_get_extension (const gchar *uri)
void string_cut_extension (gchar *string)
gint string_compare (const gchar *a, const gchar *b)
gint string_compare_encoded (const gchar *a, const gchar *b)
const void * memfind (const void *mem, gint size, const void *token, gint length)
gchar * str_replace_fragment (gchar *s, gint size, const gchar *old_str, const gchar *new_str)
void string_canonize_case (gchar *string)

Function Documentation

gchar* convert_dos_path ( gchar *  text)

Definition at line 200 of file audstrings.c.

Referenced by construct_uri().

gchar* filename_get_subtune ( const gchar *  filename,
gint track 
)

Checks if given URI contains a subtune indicator/number.

If it does, track is set to to it, and position of subtune separator in the URI string is returned.

Parameters:
filenameFilename/URI to split.
trackPointer to variable where subtune number should be assigned or NULL if it is not needed.
Returns:
Position of subtune separator character in filename or NULL if none found. Notice that this value should NOT be modified, even though it is not declared const for technical reasons.

Definition at line 226 of file audstrings.c.

Referenced by filename_split_subtune().

gchar* filename_split_subtune ( const gchar *  filename,
gint track 
)

Given file path/URI contains ending indicating subtune number "?<number>", splits the string into filename without subtune value.

If given track pointer is non-NULL, subtune number is assigned into it.

Parameters:
filenameFilename/URI to split.
trackPointer to variable where subtune number should be assigned or NULL if it is not needed.
Returns:
Newly allocated splitted filename without the subtune indicator. This string must be freed with g_free(). NULL will be returned if there was any failure.

Definition at line 257 of file audstrings.c.

Referenced by playback_thread(), file_find_decoder(), file_read_tuple(), file_read_image(), and file_write_tuple().

gchar* filename_to_uri ( const gchar *  filename)
const void* memfind ( const void *  mem,
gint  size,
const void *  token,
gint  length 
)

Definition at line 628 of file audstrings.c.

G_BEGIN_DECLS gchar* str_append ( gchar *  str,
const gchar *  add_str 
)

Definition at line 64 of file audstrings.c.

gchar* str_assert_utf8 ( const gchar *  str)

This function can be used to assert that a given string is valid UTF-8.

If it is, a copy of the string is returned. However, if the string is NOT valid UTF-8, a warning and a callstack backtrace is printed in order to see where the problem occured.

This is a temporary measure for removing useless str_to_utf8 etc. calls and will be eventually removed. This function should be used in place of str_to_utf8() calls when it can be reasonably assumed that the input should already be in unicode encoding.

Parameters:
strString to be tested and converted to UTF-8 encoding.
Returns:
String in UTF-8 encoding, or NULL if conversion failed or input was NULL.

Definition at line 160 of file audstrings.c.

gboolean str_has_prefix_nocase ( const gchar *  str,
const gchar *  prefix 
)

Definition at line 83 of file audstrings.c.

gboolean str_has_suffix_nocase ( const gchar *  str,
const gchar *  suffix 
)

Definition at line 89 of file audstrings.c.

Referenced by str_has_suffixes_nocase(), and scan_plugin_func().

gboolean str_has_suffixes_nocase ( const gchar *  str,
gchar *const *  suffixes 
)

Definition at line 96 of file audstrings.c.

gchar* str_replace ( gchar *  str,
gchar *  new_str 
)

Definition at line 70 of file audstrings.c.

Referenced by str_append(), and str_replace_in().

gchar* str_replace_fragment ( gchar *  s,
gint  size,
const gchar *  old_str,
const gchar *  new_str 
)

Definition at line 654 of file audstrings.c.

void str_replace_in ( gchar **  str,
gchar *  new_str 
)

Definition at line 77 of file audstrings.c.

void str_set_utf8_impl ( gchar *(*)(const gchar *)  stu_impl,
gchar *(*)(const gchar *, gssize, gsize *, gsize *, GError **)  stuf_impl 
)

Definition at line 114 of file audstrings.c.

Referenced by chardet_init().

const gchar* str_skip_chars ( const gchar *  str,
const gchar *  chars 
)

Definition at line 192 of file audstrings.c.

gchar* str_to_utf8 ( const gchar *  str)

Convert given string from nearly any encoding to UTF-8 encoding.

Parameters:
strLocal filename/path to convert.
Returns:
String in UTF-8 encoding. Must be freed with g_free().

Definition at line 128 of file audstrings.c.

Referenced by str_assert_utf8(), uri_to_display(), tuple_associate_string(), and tuple_associate_string_rel().

gchar* str_to_utf8_full ( const gchar *  str,
gssize  len,
gsize *  bytes_read,
gsize *  bytes_written,
GError **  err 
)

Definition at line 134 of file audstrings.c.

void string_canonize_case ( gchar *  string)

Definition at line 687 of file audstrings.c.

Referenced by tuple_new_unlocked().

gint string_compare ( const gchar *  a,
const gchar *  b 
)

Definition at line 537 of file audstrings.c.

Referenced by add_folder(), tuple_compare_string(), and plugin_compare().

gint string_compare_encoded ( const gchar *  a,
const gchar *  b 
)

Definition at line 581 of file audstrings.c.

Referenced by filename_compare_basename().

void string_cut_extension ( gchar *  string)

Definition at line 525 of file audstrings.c.

Referenced by tuple_formatter_make_title_string().

void string_decode_percent ( gchar *  string)

Definition at line 311 of file audstrings.c.

gchar* string_encode_percent ( const gchar *  string,
gboolean  is_filename 
)

Definition at line 340 of file audstrings.c.

Referenced by filename_to_uri().

void string_replace_char ( gchar *  string,
gchar  old_str,
gchar  new_str 
)
void uri_check_utf8 ( gchar **  uri,
gboolean  warn 
)

Definition at line 429 of file audstrings.c.

Referenced by playlist_entry_insert_batch_raw().

gchar* uri_get_extension ( const gchar *  uri)

Definition at line 506 of file audstrings.c.

gboolean uri_is_utf8 ( const gchar *  uri,
gboolean  warn 
)

Definition at line 377 of file audstrings.c.

Referenced by uri_check_utf8(), and playlist_rescan_file().

gchar* uri_to_display ( const gchar *  uri)

Definition at line 486 of file audstrings.c.

Referenced by tuple_set_filename(), and describe_song().

gchar* uri_to_filename ( const gchar *  uri)
gchar* uri_to_utf8 ( const gchar *  uri)

Definition at line 412 of file audstrings.c.

Referenced by uri_check_utf8(), and playlist_rescan_file().