util.h 701 Bytes
#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_*/