Libosmium  2.5.3
Fast and flexible C++ library for working with OpenStreetMap data
Classes | Functions | Variables
osmium::util Namespace Reference

Helpful utility classes and functions not strictly OSM related. More...

Classes

class  AnonymousMemoryMapping
 
class  AnonymousTypedMemoryMapping
 
class  DeltaDecode
 
class  DeltaEncode
 
class  DeltaEncodeIterator
 
class  MemoryMapping
 
class  Options
 
class  TypedMemoryMapping
 
class  VerboseOutput
 

Functions

uint16_t byte_swap_16 (uint16_t value) noexcept
 
uint32_t byte_swap_32 (uint32_t value) noexcept
 
uint64_t byte_swap_64 (uint64_t value) noexcept
 
template<typename T >
double2string (T iterator, double value, int precision)
 
void double2string (std::string &out, double value, int precision)
 
size_t file_size (int fd)
 
void resize_file (int fd, size_t new_size)
 
size_t get_pagesize ()
 

Variables

constexpr int max_double_length = 20
 

Detailed Description

Helpful utility classes and functions not strictly OSM related.

Function Documentation

uint16_t osmium::util::byte_swap_16 ( uint16_t  value)
inlinenoexcept
uint32_t osmium::util::byte_swap_32 ( uint32_t  value)
inlinenoexcept
uint64_t osmium::util::byte_swap_64 ( uint64_t  value)
inlinenoexcept
template<typename T >
T osmium::util::double2string ( iterator,
double  value,
int  precision 
)
inline

Write double to iterator, removing superfluous '0' characters at the end. The decimal dot will also be removed if necessary.

Template Parameters
Titerator type
Parameters
iteratoroutput iterator
valuethe value that should be written
precisionmax number of digits after the decimal point (must be <= 17)
void osmium::util::double2string ( std::string &  out,
double  value,
int  precision 
)
inline

Write double to string, removing superfluous '0' characters at the end. The decimal dot will also be removed if necessary.

Parameters
outstring
valuethe value that should be written
precisionmax number of digits after the decimal point
size_t osmium::util::file_size ( int  fd)
inline

Get file size. This is a small wrapper around a system call.

Parameters
fdFile descriptor
Returns
file size
Exceptions
std::system_errorIf system call failed
size_t osmium::util::get_pagesize ( )
inline

Get the page size for this system.

void osmium::util::resize_file ( int  fd,
size_t  new_size 
)
inline

Resize file. Small wrapper around ftruncate(2) system call.

Parameters
fdFile descriptor
new_sizeNew size
Exceptions
std::system_errorIf ftruncate(2) call failed

Variable Documentation

constexpr int osmium::util::max_double_length = 20