Merge remote-tracking branch 'upstream/edge' into upstream-master
[clinton/Smoothieware.git] / src / libs / utils.h
CommitLineData
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 8using std::string;
76f53dc6 9using std::vector;
4eb9c745 10
219fd4ba 11string lc(const string& str);
4eb9c745 12
a2970685
MM
13bool is_alpha( int );
14bool is_digit( int );
15bool is_numeric( int );
16bool is_alphanum( int );
17bool is_whitespace( int );
18
f6fc8c0d
JM
19vector<string> split(const char *str, char c = ',');
20vector<float> parse_number_list(const char *str);
7b35a4c8 21vector<uint32_t> parse_number_list(const char *str, uint8_t radix);
f6fc8c0d 22
a699b669
AW
23string remove_non_number( string str );
24
d5d3d675
JM
25uint16_t get_checksum(const string& to_check);
26uint16_t get_checksum(const char* to_check);
4eb9c745 27
d8cff5af 28void get_checksums(uint16_t check_sums[], const string& key);
5efaa1b1 29
4eb9c745
AW
30string shift_parameter( string &parameters );
31
cebe90b6
AW
32string get_arguments( string possible_command );
33
35e773a4 34bool file_exists( const string file_name );
8d857d2e 35
2742fca9 36void system_reset( bool dfu= false );
4eb9c745 37
75f4581c 38string absolute_from_relative( string path );
4eb9c745 39
7c801094 40int append_parameters(char *buf, std::vector<std::pair<char,float>> params, size_t bufsize);
4eb9c745
AW
41
42#endif