util.h
701 Bytes
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
#ifndef UTIL_H_
#define UTIL_H_
#include <string>
#include <sstream>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
using std::string;
namespace utils
{
class Util
{
public:
/*
retorna os bits do buffer.
*/
static unsigned long long getBits(unsigned char* buf, int byte_offset, int startbit, int bitlen);
static void stringUpper(string& string);
static string int2str(int n);
static int stringtoint(const char* string);
static long long getBits48(unsigned char *buf, int byte_offset, int startbit, int bitlen);
static unsigned long long getBits64(unsigned char *buf, int byte_offset, int startbit, int bitlen);
};
}
#endif /*UTIL_H_*/