Number.h
Go to the documentation of this file.
1 
2 #ifndef NUMBER_H_
3 #define NUMBER_H_
4 
5 #include <cstdlib>
6 #include <stdint.h>
7 #include <iostream>
8 
9 namespace sawyer
10 {
11 
12 /* Little-endian byte array to number conversion routines. */
13  void utob(void *dest, size_t dest_len, uint64_t src);
14 
15  void utob(void *dest, size_t dest_len, uint32_t src);
16 
17  void utob(void *dest, size_t dest_len, uint16_t src);
18 
19  void itob(void *dest, size_t dest_len, int64_t src);
20 
21  void itob(void *dest, size_t dest_len, int32_t src);
22 
23  void itob(void *dest, size_t dest_len, int16_t src);
24 
25 /* void toBytes(void* dest, size_t dest_len, float src, float scale); */
26  void ftob(void *dest, size_t dest_len, double src, double scale);
27 
28 /* Number to little-endian byte array conversion routines
29  * Need to provide all, since size of the int param matters. */
30  uint64_t btou(void *src, size_t src_len);
31 
32  int64_t btoi(void *src, size_t src_len);
33 
34  double btof(void *src, size_t src_len, double scale);
35 
36 }; // namespace sawyer
37 
38 #endif // NUMBER_H_
39 
uint64_t btou(void *src, size_t src_len)
Definition: Number.cpp:120
void utob(void *dest, size_t dest_len, uint64_t src)
Definition: Number.cpp:55
void itob(void *dest, size_t dest_len, int64_t src)
Definition: Number.cpp:70
int64_t btoi(void *src, size_t src_len)
Definition: Number.cpp:135
void ftob(void *dest, size_t dest_len, double src, double scale)
Definition: Number.cpp:92
double btof(void *src, size_t src_len, double scale)
Definition: Number.cpp:160


roch_base
Author(s): Mike Purvis , Paul Bovbel , Chen
autogenerated on Mon Jun 10 2019 14:41:14