Number.h
Go to the documentation of this file.
00001 
00002 #ifndef NUMBER_H_
00003 #define NUMBER_H_
00004 
00005 #include <cstdlib>
00006 #include <stdint.h>
00007 #include <iostream>
00008 
00009 namespace sawyer
00010 {
00011 
00012 /* Little-endian byte array to number conversion routines. */
00013   void utob(void *dest, size_t dest_len, uint64_t src);
00014 
00015   void utob(void *dest, size_t dest_len, uint32_t src);
00016 
00017   void utob(void *dest, size_t dest_len, uint16_t src);
00018 
00019   void itob(void *dest, size_t dest_len, int64_t src);
00020 
00021   void itob(void *dest, size_t dest_len, int32_t src);
00022 
00023   void itob(void *dest, size_t dest_len, int16_t src);
00024 
00025 /* void toBytes(void* dest, size_t dest_len, float src, float scale); */
00026   void ftob(void *dest, size_t dest_len, double src, double scale);
00027 
00028 /* Number to little-endian byte array conversion routines 
00029  * Need to provide all, since size of the int param matters. */
00030   uint64_t btou(void *src, size_t src_len);
00031 
00032   int64_t btoi(void *src, size_t src_len);
00033 
00034   double btof(void *src, size_t src_len, double scale);
00035 
00036 }; // namespace sawyer
00037 
00038 #endif // NUMBER_H_
00039 


roch_base
Author(s): Mike Purvis , Paul Bovbel , Carl
autogenerated on Sat Jun 8 2019 20:32:33