Number.h
Go to the documentation of this file.
1 
48 #ifndef NUMBER_H_
49 #define NUMBER_H_
50 
51 #include <cstdlib>
52 #include <stdint.h>
53 #include <iostream>
54 
55 namespace clearpath
56 {
57 
58 /* Little-endian byte array to number conversion routines. */
59  void utob(void *dest, size_t dest_len, uint64_t src);
60 
61  void utob(void *dest, size_t dest_len, uint32_t src);
62 
63  void utob(void *dest, size_t dest_len, uint16_t src);
64 
65  void itob(void *dest, size_t dest_len, int64_t src);
66 
67  void itob(void *dest, size_t dest_len, int32_t src);
68 
69  void itob(void *dest, size_t dest_len, int16_t src);
70 
71 /* void toBytes(void* dest, size_t dest_len, float src, float scale); */
72  void ftob(void *dest, size_t dest_len, double src, double scale);
73 
74 /* Number to little-endian byte array conversion routines
75  * Need to provide all, since size of the int param matters. */
76  uint64_t btou(void *src, size_t src_len);
77 
78  int64_t btoi(void *src, size_t src_len);
79 
80  double btof(void *src, size_t src_len, double scale);
81 
82 }; // namespace clearpath
83 
84 #endif // NUMBER_H_
85 
void utob(void *dest, size_t dest_len, uint64_t src)
Definition: Number.cpp:56
int64_t btoi(void *src, size_t src_len)
Definition: Number.cpp:136
uint64_t btou(void *src, size_t src_len)
Definition: Number.cpp:121
void ftob(void *dest, size_t dest_len, double src, double scale)
Definition: Number.cpp:93
void itob(void *dest, size_t dest_len, int64_t src)
Definition: Number.cpp:71
double btof(void *src, size_t src_len, double scale)
Definition: Number.cpp:161


husky_base
Author(s): Mike Purvis , Paul Bovbel
autogenerated on Fri Oct 2 2020 03:40:07