diff --git a/src/kstd/CString.cc b/src/kstd/CString.cc index f5d004f..e92fd27 100644 --- a/src/kstd/CString.cc +++ b/src/kstd/CString.cc @@ -159,6 +159,17 @@ fromUnsignedInteger(u64 value, } +usize +fromPointer(void* value, + char* buffer, + usize length, + u8 base, + bool capitalized) +{ + return fromUnsignedInteger(uptr(value), buffer, length, base, capitalized); +} + + char* fromBool(bool value, char* str, diff --git a/src/kstd/CString.hh b/src/kstd/CString.hh index cbcbf7c..c4a6669 100644 --- a/src/kstd/CString.hh +++ b/src/kstd/CString.hh @@ -6,6 +6,9 @@ * Utilities for dealing with C strings. */ +#ifndef __KSTD_CSTRING_HH__ +#define __KSTD_CSTRING_HH__ + #include "Types.hh" namespace kstd { @@ -46,6 +49,7 @@ void uppercase(char *str); */ usize fromInteger(i64 value, char* buffer, usize length, u8 base = 10, bool capitalized = false); usize fromUnsignedInteger(u64 value, char* buffer, usize length, u8 base = 10, bool capitalized = false); +usize fromPointer(void* value, char* buffer, usize length, u8 base = 10, bool capitalized = false); /** @} */ /** Convert a bool to a string. */ @@ -55,3 +59,5 @@ char* fromBool(bool value, char* str, usize length); } /* namespace CString */ } /* namespace kstd */ + +#endif /* __KSTD_CSTRING_HH__ */