diff --git a/core/misc.h b/core/misc.h index 3a405b1..fc11c0f 100755 --- a/core/misc.h +++ b/core/misc.h @@ -120,14 +120,55 @@ bool Toa(int value, CharType * buffer, size_t buf_len, int base = 10) } + + +/* + these methos don't take the buffer size + make sure the buffer size is sufficient big + 2^64 - 1 = 18446744073709551615 = 20 characters (plus minus sign and plus terminating zero) + so the buffer should have at least 22 characters + !! CHECK ME check the size whether is correct +*/ +template +bool Toa(unsigned long value, CharType * buffer) +{ + size_t sufficient_space = 25; + return Toa(value, buffer, sufficient_space); +} + +template +bool Toa(long value, CharType * buffer) +{ + size_t sufficient_space = 25; + return Toa(value, buffer, sufficient_space); +} + +template +bool Toa(unsigned int value, CharType * buffer) +{ + size_t sufficient_space = 25; + return Toa(value, buffer, sufficient_space); +} + +template +bool Toa(int value, CharType * buffer) +{ + size_t sufficient_space = 25; + return Toa(value, buffer, sufficient_space); +} + + + + + // warning: it uses its own static buffer // one buffer for both these functions +// !! REMOVE ME they are deprecated (don't use it) const wchar_t * Toa(unsigned int value, int base = 10); const wchar_t * Toa(unsigned long value, int base = 10); const wchar_t * Toa(int value, int base = 10); const wchar_t * Toa(long value, int base = 10); - void Toa(int value, std::string & res, int base = 10, bool clear = true); void Toa(long value, std::string & res, int base = 10, bool clear = true); void Toa(int value, std::wstring & res, int base = 10, bool clear = true); diff --git a/core/request.cpp b/core/request.cpp index 22118e6..0bb9c93 100755 --- a/core/request.cpp +++ b/core/request.cpp @@ -234,6 +234,16 @@ return &p->second; } +std::wstring * Request::PostVarp(const std::wstring & var) +{ +PostTab::iterator p = post_tab.find(var); + + if( p == post_tab.end() ) + return 0; + +return &p->second; +} + diff --git a/core/request.h b/core/request.h index 4c77f83..9ae09d4 100755 --- a/core/request.h +++ b/core/request.h @@ -167,6 +167,7 @@ struct Request bool PostVar(const std::wstring & var, std::wstring & result); std::wstring * PostVarp(const wchar_t * var); + std::wstring * PostVarp(const std::wstring & var); bool AllPostVarEmpty(); // returning true if all post vars are empty