mirror of
https://github.com/HikikoMarmy/Champions-Reborn-Server.git
synced 2026-04-05 00:49:48 -03:00
Reorganized and cleaned up the solution.
This commit is contained in:
25
Include/Common/Utility.hpp
Normal file
25
Include/Common/Utility.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <WinSock2.h>
|
||||
|
||||
namespace Util
|
||||
{
|
||||
int32_t round_up( int32_t numToRound, int32_t multiple );
|
||||
int32_t round_down( int32_t numToRound, int32_t multiple );
|
||||
|
||||
uint16_t ByteSwap( uint16_t val );
|
||||
uint32_t ByteSwap( uint32_t val );
|
||||
|
||||
template <typename T>
|
||||
bool IsInRange( T value, T min, T max )
|
||||
{
|
||||
return ( value >= min && value <= max );
|
||||
}
|
||||
|
||||
std::string IPFromAddr( const sockaddr_in &addr );
|
||||
|
||||
std::string WideToUTF8( const std::wstring &wstr );
|
||||
std::wstring UTF8ToWide( const std::string &str );
|
||||
}
|
||||
Reference in New Issue
Block a user