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"
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 inline int t_isdigit(int c
)
42 return (c
>= '0' && c
<= '9');
45 inline int t_isalpha(int c
)
47 return (c
>= 'A' && c
<= 'Z') || (c
>= 'a' && c
<= 'z');
50 inline int t_tolower(int c
)
52 return (c
>= 'A' && c
<= 'Z' ? c
+ 'a' - 'A' : c
);
55 inline int round_f(float val
)
57 int int_val
= (int) val
;
58 if(val
- int_val
>= 0.5)
65 inline int round_d(double val
)
67 int int_val
= (int) val
;
68 if(val
- int_val
>= 0.5)
75 inline float t_strtof(const string
& str
, char** endPtr
= nullptr)
77 return (float)t_strtod(str
.c_str(), endPtr
);
80 inline int baseline_align(int line_height
, int line_base_line
, int height
, int baseline
)
82 return (line_height
- line_base_line
) - (height
- baseline
);