9 unsigned long long getMSB(
char * pointer,
unsigned int offsetBits,
unsigned int dataBits);
10 unsigned long long getByName(
char * pointer);
12 void setMSB(
char * pointer,
unsigned int offsetBits,
unsigned int dataBits,
unsigned long long value);
18 inline unsigned short btohs(
char * p) {
19 return ((
unsigned short)p[0] << 8) | p[1];
23 inline void htobs(
char * p,
unsigned short val) {
24 p[0] = (val >> 8) & 0xFF;
29 inline unsigned long btohl(
const char * p) {
30 return ((
unsigned long)p[0] << 24) | ((
unsigned long)p[1] << 16) | ((
unsigned long)p[2] << 8) | p[3];
34 inline void htobl(
char * p,
unsigned long val) {
35 p[0] = (val >> 24) & 0xFF;
36 p[1] = (val >> 16) & 0xFF;
37 p[2] = (val >> 8) & 0xFF;
42 inline unsigned long btoh24(
char * p) {
43 return ((
unsigned long)p[0] << 16) | ((
unsigned long)p[1] << 8) | p[2];
47 inline void htob24(
char * p,
unsigned long val) {
48 p[0] = (val >> 16) & 0xFF;
49 p[1] = (val >> 8) & 0xFF;
54 inline unsigned long long btohll(
char * p) {
55 return ((
unsigned long long)p[0] << 56) | ((
unsigned long long)p[1] << 48) | ((
unsigned long long)p[2] << 40) | ((
unsigned long long)p[3] << 32) | ((
unsigned long)p[4] << 24) | ((
unsigned long)p[5] << 16) | ((
unsigned long)p[6] << 8) | p[7];
59 inline void htobll(
char * p,
unsigned long long val) {
60 p[0] = (val >> 56) & 0xFF;
61 p[1] = (val >> 48) & 0xFF;
62 p[2] = (val >> 40) & 0xFF;
63 p[3] = (val >> 32) & 0xFF;
64 p[4] = (val >> 24) & 0xFF;
65 p[5] = (val >> 16) & 0xFF;
66 p[6] = (val >> 8) & 0xFF;
bool stringToBool(std::string &str)
Parses a string reference to a boolean.
Definition: bitfields.cpp:69
void setByName(char *pointer)
void htobl(char *p, unsigned long val)
Stores a long value of val in network order to the pointer p.
Definition: bitfields.h:34
unsigned long btohl(const char *p)
Retrieves a long in network order from the pointer p.
Definition: bitfields.h:29
unsigned short btohs(char *p)
Retrieves a short in network order from the pointer p.
Definition: bitfields.h:18
void htob24(char *p, unsigned long val)
Stores a long value of val in network order to the pointer p.
Definition: bitfields.h:47
Contains utility code, not directly related to streaming media.
Definition: bitfields.h:3
Definition: bitfields.h:7
void htobll(char *p, unsigned long long val)
Stores a long value of val in network order to the pointer p.
Definition: bitfields.h:59
unsigned long long getByName(char *pointer)
unsigned long long btohll(char *p)
Retrieves a long long in network order from the pointer p.
Definition: bitfields.h:54
unsigned long btoh24(char *p)
Retrieves a long in network order from the pointer p.
Definition: bitfields.h:42
void htobs(char *p, unsigned short val)
Stores a short value of val in network order to the pointer p.
Definition: bitfields.h:23
void setMSB(char *pointer, unsigned int offsetBits, unsigned int dataBits, unsigned long long value)
Takes a pointer, offset bitcount and data bitcount, setting to given value.
Definition: bitfields.cpp:39
unsigned long long getMSB(char *pointer, unsigned int offsetBits, unsigned int dataBits)
Takes a pointer, offset bitcount and data bitcount, returning the unsigned int read from the givens...
Definition: bitfields.cpp:8