-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelperFunctions.h
More file actions
45 lines (33 loc) · 1.37 KB
/
Copy pathHelperFunctions.h
File metadata and controls
45 lines (33 loc) · 1.37 KB
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
#ifndef HELPERFUNCTIONS_H
#define HELPERFUNCTIONS_H
#include <iostream>
#include <string>
#include "wx/wx.h"
#include "DoseUnitEnum.h"
#include "TimeUnitEnum.h"
#include "PhoneTypeEnum.h"
namespace HelperFunctions
{
// Takes in an std::string and returns its unsigned integer equivalient.
// Fails if there are any characters other than the digits.
unsigned int stoui(std::string input);
// Returns the std::string version of the given DoseUnitEnum.
std::string duetostr(DoseUnitEnum d);
// Converts an std::string into a DoseUnitEnum.
DoseUnitEnum strtodue(std::string input);
// Returns the std::string version of the given TimeUnitEnum.
std::string tuetostr(TimeUnitEnum t);
// Converts an std::string into a TimeUnitEnum.
TimeUnitEnum strtotue(std::string input);
// Returns the std::string version of the given PhoneTypeEnum.
std::string ptetostr(PhoneTypeEnum pt);
// Converts an std::string into a PhoneTypeEnum.
PhoneTypeEnum strtopte(std::string input);
// Converts the given dollars and cents unsigned integers into a price formatted std::string.
std::string pricetostr(unsigned int dollars, unsigned int cents);
// Converts an std::string into an unsigned int, where the last first two digits are the cents.
// Ex. input = "$99.23", returns 9923
// Returns 0 if input is invalid.
unsigned int strtoprice(std::string input);
}
#endif // HELPERFUNCTIONS_H