Merge pull request #573 from wolfmanjm/add/temp-option-to-suspend
[clinton/Smoothieware.git] / src / libs / utils.h
1 #ifndef utils_h
2 #define utils_h
3
4 #include <stdint.h>
5 using namespace std;
6 #include <string>
7 #include <vector>
8 using std::string;
9
10 string lc(const string& str);
11
12 bool is_alpha( int );
13 bool is_digit( int );
14 bool is_numeric( int );
15 bool is_alphanum( int );
16 bool is_whitespace( int );
17
18 vector<string> split(const char *str, char c = ',');
19 vector<float> parse_number_list(const char *str);
20
21 string remove_non_number( string str );
22
23 uint16_t get_checksum(const string& to_check);
24 uint16_t get_checksum(const char* to_check);
25
26 void get_checksums(uint16_t check_sums[], const string& key);
27
28 string shift_parameter( string &parameters );
29
30 string get_arguments( string possible_command );
31
32 bool file_exists( const string file_name );
33
34 void system_reset( bool dfu= false );
35
36 string absolute_from_relative( string path );
37
38
39 #endif