mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
basic charlist
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <cxxabi.h>
|
||||
#include "types.h"
|
||||
|
||||
namespace fw {
|
||||
|
||||
@@ -227,6 +228,12 @@ inline unsigned int hex2dec(const std::string& str) {
|
||||
return num;
|
||||
}
|
||||
|
||||
inline std::string ip2str(uint32 ip) {
|
||||
char host[16];
|
||||
sprintf(host, "%d.%d.%d.%d", (uint8)ip, (uint8)(ip >> 8), (uint8)(ip >> 16), (uint8)(ip >> 24));
|
||||
return std::string(host);
|
||||
}
|
||||
|
||||
// an empty string to use anywhere needed
|
||||
const static std::string empty_string;
|
||||
|
||||
|
Reference in New Issue
Block a user