13 #include "string_id.h"
15 #include "utf8_strings.h"
16 #include "background.h"
18 #include "web_color.h"
19 #include "media_query.h"
21 #include "document_container.h"
26 void trim(string
&s
, const string
& chars_to_trim
= " \n\r\t");
27 void lcase(string
&s
);
28 int value_index(const string
& val
, const string
& strings
, int defValue
= -1, char delim
= ';');
29 string
index_value(int index
, const string
& strings
, char delim
= ';');
30 bool value_in_list(const string
& val
, const string
& strings
, char delim
= ';');
31 string::size_type
find_close_bracket(const string
&s
, string::size_type off
, char open_b
= '(', char close_b
= ')');
32 void split_string(const string
& str
, string_vector
& tokens
, const string
& delims
, const string
& delims_preserve
= "", const string
& quote
= "\"");
33 void join_string(string
& str
, const string_vector
& tokens
, const string
& delims
);
34 double t_strtod(const char* string
, char** endPtr
= nullptr);
35 string
get_escaped_string(const string
& in_str
);
37 int t_strcasecmp(const char *s1
, const char *s2
);
38 int t_strncasecmp(const char *s1
, const char *s2
, size_t n
);
40 bool is_number(const string
& string
, const bool allow_dot
= 1);
42 inline int t_isdigit(int c
)
44 return (c
>= '0' && c
<= '9');
47 inline int t_isalpha(int c
)
49 return (c
>= 'A' && c
<= 'Z') || (c
>= 'a' && c
<= 'z');
52 inline int t_tolower(int c
)
54 return (c
>= 'A' && c
<= 'Z' ? c
+ 'a' - 'A' : c
);
57 inline int round_f(float val
)
59 int int_val
= (int) val
;
60 if(val
- int_val
>= 0.5)
67 inline int round_d(double val
)
69 int int_val
= (int) val
;
70 if(val
- int_val
>= 0.5)
77 inline float t_strtof(const string
& str
, char** endPtr
= nullptr)
79 return (float)t_strtod(str
.c_str(), endPtr
);
82 inline int baseline_align(int line_height
, int line_base_line
, int height
, int baseline
)
84 return (line_height
- line_base_line
) - (height
- baseline
);