libmp3splt
src/string_utils.h
00001 /**********************************************************
00002  *
00003  * libmp3splt -- library based on mp3splt,
00004  *               for mp3/ogg splitting without decoding
00005  *
00006  * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net>
00007  * Copyright (c) 2005-2011 Munteanu Alexandru - io_fx@yahoo.fr
00008  *
00009  * http://mp3splt.sourceforge.net
00010  *
00011  *********************************************************/
00012 
00013 /**********************************************************
00014  *
00015  * This program is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU General Public License
00017  * as published by the Free Software Foundation; either version 2
00018  * of the License, or (at your option) any later version.
00019  *
00020  * This program is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with this program; if not, write to the Free Software
00027  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00028  * 02111-1307,
00029  * USA.
00030  *
00031  *********************************************************/
00032 
00033 #ifndef SPLT_STRING_UTILS_H
00034 
00035 #include <stdarg.h>
00036 
00037 void splt_su_replace_all_char(char *str, char to_replace, char replacement);
00038 char *splt_su_replace_all(const char *str, char *to_replace, char *replacement, int *error);
00039 int splt_su_append(char **str, const char *to_append, ...);
00040 int splt_su_append_str(char **str, const char *to_append, ...);
00041 void splt_su_free_replace(char **str, char *replacement);
00042 int splt_su_copy(const char *src, char **dest);
00043 
00044 void splt_su_clean_string(splt_state *state, char *s, int *error);
00045 void splt_su_cut_spaces_from_end(char *c);
00046 char *splt_su_cut_spaces(char *c);
00047 char *splt_su_skip_spaces(char *c);
00048 char *splt_su_trim_spaces(char *c);
00049 int splt_su_is_empty_line(const char *line);
00050 void splt_su_line_to_unix(char *line);
00051 
00052 const char *splt_su_get_fname_without_path(const char *filename);
00053 void splt_su_keep_path_and_remove_filename(char *path);
00054 char *splt_su_get_fname_without_path_and_extension(const char *filename, int *error);
00055 char *splt_su_get_fname_with_path_and_extension(splt_state *state, int *error);
00056 
00057 void splt_su_cut_extension(char *str);
00058 char *splt_su_convert(const char *str, splt_str_format format, int *error);
00059 void splt_su_str_cut_last_char(char *str);
00060 double splt_su_str_line_to_double(const char *str);
00061 
00062 char *splt_su_get_file_with_output_path(splt_state *state,
00063     char *filename, int *error);
00064 
00065 int splt_su_str_ends_with(const char *str1, const char *str2);
00066 
00067 char *splt_su_get_formatted_message(splt_state *state, char *message, ...);
00068 int splt_su_str_line_has_digit(const char *str);
00069 char *splt_su_format_messagev(splt_state *state, const char *message, va_list ap);
00070 
00071 #define SPLT_STRING_UTILS_H
00072 
00073 #endif
00074 
00075