Commit | Line | Data |
---|---|---|
76f53dc6 JM |
1 | #ifndef UTILS_H |
2 | #define UTILS_H | |
4eb9c745 | 3 | |
423df6df | 4 | #include <stdint.h> |
4eb9c745 | 5 | #include <string> |
5efaa1b1 | 6 | #include <vector> |
7c801094 | 7 | |
4eb9c745 | 8 | using std::string; |
76f53dc6 | 9 | using std::vector; |
4eb9c745 | 10 | |
219fd4ba | 11 | string lc(const string& str); |
4eb9c745 | 12 | |
a2970685 MM |
13 | bool is_alpha( int ); |
14 | bool is_digit( int ); | |
15 | bool is_numeric( int ); | |
16 | bool is_alphanum( int ); | |
17 | bool is_whitespace( int ); | |
18 | ||
f6fc8c0d JM |
19 | vector<string> split(const char *str, char c = ','); |
20 | vector<float> parse_number_list(const char *str); | |
7b35a4c8 | 21 | vector<uint32_t> parse_number_list(const char *str, uint8_t radix); |
f6fc8c0d | 22 | |
a699b669 AW |
23 | string remove_non_number( string str ); |
24 | ||
d5d3d675 JM |
25 | uint16_t get_checksum(const string& to_check); |
26 | uint16_t get_checksum(const char* to_check); | |
4eb9c745 | 27 | |
d8cff5af | 28 | void get_checksums(uint16_t check_sums[], const string& key); |
5efaa1b1 | 29 | |
4eb9c745 AW |
30 | string shift_parameter( string ¶meters ); |
31 | ||
cebe90b6 AW |
32 | string get_arguments( string possible_command ); |
33 | ||
35e773a4 | 34 | bool file_exists( const string file_name ); |
8d857d2e | 35 | |
2742fca9 | 36 | void system_reset( bool dfu= false ); |
4eb9c745 | 37 | |
75f4581c | 38 | string absolute_from_relative( string path ); |
4eb9c745 | 39 | |
7c801094 | 40 | int append_parameters(char *buf, std::vector<std::pair<char,float>> params, size_t bufsize); |
4eb9c745 AW |
41 | |
42 | #endif |