libosmscout 0.1
Loading...
Searching...
No Matches
Number.h File Reference
#include <osmscout/lib/CoreImportExport.h>
#include <array>
#include <limits>
#include <cstddef>
#include <cassert>
#include <osmscout/system/SystemTypes.h>

Classes

struct  osmscout::DecodeNumberTemplated< is_signed, N >
 
struct  osmscout::DecodeNumberTemplated< false, N >
 
struct  osmscout::DecodeNumberTemplated< true, N >
 
struct  osmscout::EncodeNumberTemplated< is_signed, N >
 
struct  osmscout::EncodeNumberTemplated< false, N >
 
struct  osmscout::EncodeNumberTemplated< true, N >
 

Namespaces

namespace  osmscout
 Original source: https://github.com/philipperemy/easy-encryption/blob/master/b64.h licensed under terms of MIT license.
 

Functions

template<typename N >
uint8_t osmscout::BitsNeededToEncodeNumber (N number)
 Returns the number of bytes needed to encode the number.
 
template<typename N >
osmscout::BitsToBytes (N bits)
 Returns the number of bytes needed to encode the given number of bits.
 
template<typename N >
uint8_t osmscout::BytesNeededToEncodeNumber (N number)
 Returns the number of bytes needed to encode the number.
 
template<typename N >
unsigned int osmscout::DecodeNumber (const char *buffer, N &number)
 Decode a variable length encoded number from the buffer back to the variable.
 
template<typename N >
unsigned int osmscout::DecodeNumberSigned (const char *buffer, N &number)
 Decode a signed variable length encoded number from the buffer back to the variable.
 
template<typename N >
unsigned int osmscout::DecodeNumberUnsigned (const char *buffer, N &number)
 Decode an unsigned variable length encoded number from the buffer back to the variable.
 
template<typename N >
unsigned int osmscout::EncodeNumber (N number, char *buffer)
 Encode a number into the given buffer using some variable length encoding.
 
template<typename N , size_t S>
unsigned int osmscout::EncodeNumber (N number, std::array< char, S > &buffer)
 Encode a number into the given buffer using some variable length encoding.
 
template<typename N >
unsigned int osmscout::EncodeNumberSigned (N number, char *buffer)
 Encode a signed number into the given buffer using some variable length encoding.
 
template<typename N >
unsigned int osmscout::EncodeNumberUnsigned (N number, char *buffer)
 Encode an unsigned number into the given buffer using some variable length encoding.
 
uint64_t osmscout::InterleaveNumbers (uint32_t a, uint32_t b)
 Encodes the given numbers into a new number of twice the size that has the bits of each number alternating interleaved.