summaryrefslogtreecommitdiff
path: root/include/nmeaparse/NumberConversion.h
blob: b872124e76d19b1c9227c0dff198b185026b54bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * NumberConversion.h
 *
 *  Created on: Aug 14, 2014
 *      Author: Cameron Karlsson
 */

#ifndef NUMBERCONVERSION_H_
#define NUMBERCONVERSION_H_


#include <cstdint>
#include <string>
#include <sstream>
#include <exception>


namespace nmea {

class NumberConversionError : public std::exception {
public:
	std::string message;
	NumberConversionError(std::string msg)
		: message(msg)
	{};

	virtual ~NumberConversionError()
	{};

	std::string what(){
		return message;
	}
};




double parseDouble(std::string s);
int64_t parseInt(std::string s, int radix = 10);

//void NumberConversion_test();

}



#endif /* NUMBERCONVERSION_H_ */