add append_parameters to utils and unit test
[clinton/Smoothieware.git] / src / libs / utils.h
1 #ifndef UTILS_H
2 #define UTILS_H
3
4 #include <stdint.h>
5 #include <string>
6 #include <vector>
7 #include <map>
8 using std::string;
9 using std::vector;
10
11 string lc(const string& str);
12
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
19 vector<string> split(const char *str, char c = ',');
20 vector<float> parse_number_list(const char *str);
21
22 string remove_non_number( string str );
23
24 uint16_t get_checksum(const string& to_check);
25 uint16_t get_checksum(const char* to_check);
26
27 void get_checksums(uint16_t check_sums[], const string& key);
28
29 string shift_parameter( string &parameters );
30
31 string get_arguments( string possible_command );
32
33 bool file_exists( const string file_name );
34
35 void system_reset( bool dfu= false );
36
37 string absolute_from_relative( string path );
38
39 std::string append_parameters(std::map<char,float> params);
40
41 #endif