00001 #ifndef __EH_STR_H__
00002 #define __EH_STR_H__
00003
00004 #include <glib.h>
00005 #include <utils/eh_symbol_table.h>
00006
00007 typedef enum
00008 {
00009 EH_STR_ERROR_BAD_RANGE ,
00010 EH_STR_ERROR_NO_RANGE ,
00011 EH_STR_ERROR_RANGE_OVERLAP ,
00012 EH_STR_ERROR_BAD_STRING ,
00013 EH_STR_ERROR_BAD_UNIT ,
00014 EH_STR_ERROR_NO_UNIT ,
00015 EH_STR_ERROR_BAD_LOGICAL_VAL
00016 }
00017 Eh_str_error;
00018
00019 #define EH_STR_ERROR eh_str_error_quark()
00020
00021
00022 double** eh_str_to_time_range_piecewise( const gchar* s , GError** error );
00023 double** eh_str_to_dbl_range_piecewise ( const gchar* s , GError** error );
00024 double* eh_str_to_dbl_range ( const gchar* s , GError** error );
00025 double* eh_str_to_time_range ( const gchar* s , GError** error );
00026 double eh_str_to_dbl ( const gchar* s , GError** error );
00027 gint64 eh_str_to_int ( const gchar* s , GError** error );
00028 double eh_str_to_time_in_years ( const gchar* s , GError** error );
00029 gboolean eh_str_is_boolean ( const gchar* s );
00030 gboolean eh_str_to_boolean ( const gchar* s , GError** error );
00031
00032
00033 gchar** eh_strv_append ( gchar*** str_l , gchar* new_str );
00034 gchar** eh_strv_concat ( gchar*** str_l , gchar** new_l );
00035
00036 gint eh_strv_find ( const gchar** str_l , const gchar* needle );
00037
00038 gchar* eh_str_replace ( gchar* str , gchar old_c , gchar new_c );
00039 gchar* eh_str_remove ( gchar* str , gchar* start , gint n );
00040 gchar* eh_str_remove_blocks ( gchar* str ,
00041 gchar** block_start ,
00042 gchar** block_end );
00043 Eh_symbol_table eh_str_parse_key_value ( gchar* str , gchar* delim_1 , gchar* delim_2 );
00044 gint eh_str_count_chr ( gchar* str , gchar* end , gint delim );
00045
00046 gchar* eh_str_remove_to_eol_comments ( gchar* str , gchar* com_start );
00047 gchar* eh_str_remove_c_style_comments( gchar* str );
00048 gchar* eh_str_remove_comments ( gchar* str ,
00049 const gchar* start_str ,
00050 const gchar* end_str ,
00051 gchar*** comments );
00052
00053 gchar* eh_str_trim_left ( gchar *str );
00054 gchar* eh_str_trim_right ( gchar *str );
00055 gchar* eh_str_remove_white_space( gchar *str );
00056
00057 #endif