GenSVM
gensvm_strutil.h
Go to the documentation of this file.
1 
31 #ifndef GENSVM_STRUTIL_H
32 #define GENSVM_STRUTIL_H
33 
34 #include "gensvm_globals.h"
35 
36 bool str_startswith(const char *str, const char *pre);
37 bool str_endswith(const char *str, const char *suf);
38 bool str_contains_char(const char *str, const char c);
39 char **str_split(char *original, const char *delims, int *len_ret);
40 
41 void next_line(FILE *fid, char *filename);
42 char *get_line(FILE *fid, char *filename, char *buffer);
43 
44 double get_fmt_double(FILE *fid, char *filename, const char *fmt);
45 long get_fmt_long(FILE *fid, char *filename, const char *fmt);
46 
47 long all_doubles_str(char *buffer, long offset, double *all_doubles);
48 long all_longs_str(char *buffer, long offset, long *all_longs);
49 
50 #endif
char ** str_split(char *original, const char *delims, int *len_ret)
Split a string on delimiters and return an array of parts.
bool str_contains_char(const char *str, const char c)
Check if a string contains a char.
Global definitions.
long all_longs_str(char *buffer, long offset, long *all_longs)
Read all longs in a given buffer.
bool str_endswith(const char *str, const char *suf)
Check if a string ends with a suffix.
long all_doubles_str(char *buffer, long offset, double *all_doubles)
Read all doubles in a given buffer.
bool str_startswith(const char *str, const char *pre)
Check if a string starts with a prefix.
char * get_line(FILE *fid, char *filename, char *buffer)
Read line to buffer.
long get_fmt_long(FILE *fid, char *filename, const char *fmt)
Read a long integer from file following a format.
double get_fmt_double(FILE *fid, char *filename, const char *fmt)
Read a double from file following a format.
void next_line(FILE *fid, char *filename)
Move to next line in file.