namespace PT renamed to pt
This commit is contained in:
@@ -238,13 +238,13 @@ void CorrectUrlOnlyAllowedChar(std::wstring & url);
|
||||
|
||||
const wchar_t * DateToStr(int year, int month, int day);
|
||||
const wchar_t * DateToStr(int year, int month, int day, int hour, int min, int sec);
|
||||
const wchar_t * DateToStr(const PT::Date & d);
|
||||
const wchar_t * DateToStr(const pt::Date & d);
|
||||
const wchar_t * DateToStr(time_t t);
|
||||
const wchar_t * DateToStrWithoutHours(const PT::Date & d);
|
||||
const wchar_t * DateToStrWithoutHours(const pt::Date & d);
|
||||
const wchar_t * DateToStrWithoutHours(time_t t);
|
||||
|
||||
const char * DateToStrCookie(int year, int month, int day, int hour, int min, int sec);
|
||||
const char * DateToStrCookie(const PT::Date & d);
|
||||
const char * DateToStrCookie(const pt::Date & d);
|
||||
const char * DateToStrCookie(time_t t);
|
||||
|
||||
// depracated
|
||||
@@ -253,8 +253,8 @@ const wchar_t * IpToStr(unsigned int ip_);
|
||||
|
||||
// in a new code we can use WTextStream in such a way
|
||||
// DateToStr() etc can use it too
|
||||
PT::WTextStream IPToStr(unsigned int ip);
|
||||
PT::WTextStream IPToStr(int ip);
|
||||
pt::WTextStream IPToStr(unsigned int ip);
|
||||
pt::WTextStream IPToStr(int ip);
|
||||
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ size_t i = 0;
|
||||
|
||||
while( i < buf.size() )
|
||||
{
|
||||
if( PT::is_substr(look_for.c_str(), buf.c_str() + i) )
|
||||
if( pt::is_substr(look_for.c_str(), buf.c_str() + i) )
|
||||
{
|
||||
buf.erase(i, look_for.size());
|
||||
buf.insert(i, replace);
|
||||
@@ -681,7 +681,7 @@ int SelectFileType(const std::wstring & file_name);
|
||||
// thread safe
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void UrlEncode(char c,
|
||||
PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear_out = true)
|
||||
{
|
||||
char buffer[10];
|
||||
@@ -713,7 +713,7 @@ size_t buflen = sizeof(buffer)/sizeof(char);
|
||||
// thread safe
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void UrlEncode(const char * in,
|
||||
PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear_out = true)
|
||||
{
|
||||
if( clear_out )
|
||||
@@ -727,7 +727,7 @@ void UrlEncode(const char * in,
|
||||
// thread safe
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void UrlEncode(const std::string & in,
|
||||
PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear_out = true)
|
||||
{
|
||||
UrlEncode(in.c_str(), out, clear_out);
|
||||
@@ -738,12 +738,12 @@ void UrlEncode(const std::string & in,
|
||||
// not thread safe
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void UrlEncode(const wchar_t * in,
|
||||
PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear_out = true)
|
||||
{
|
||||
static std::string ain;
|
||||
|
||||
PT::WideToUTF8(in, ain);
|
||||
pt::WideToUTF8(in, ain);
|
||||
|
||||
if( clear_out )
|
||||
out.clear();
|
||||
@@ -756,7 +756,7 @@ static std::string ain;
|
||||
// not thread safe
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void UrlEncode(const std::wstring & in,
|
||||
PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear_out = true)
|
||||
{
|
||||
UrlEncode(in.c_str(), out, clear_out);
|
||||
@@ -768,14 +768,14 @@ void UrlEncode(const std::wstring & in,
|
||||
template<class StringType>
|
||||
void UrlEncode(char c, StringType & out, bool clear_out = true)
|
||||
{
|
||||
static PT::TextStream tmp;
|
||||
static pt::TextStream tmp;
|
||||
|
||||
UrlEncode(c, tmp);
|
||||
tmp.to_string(out, clear_out);
|
||||
}
|
||||
|
||||
|
||||
// !! IMROVE ME we need some UrlEncode methods with PT::TextBuffer instead of std::string
|
||||
// !! IMROVE ME we need some UrlEncode methods with pt::TextBuffer instead of std::string
|
||||
|
||||
|
||||
void UrlEncode(const char * in, std::string & out, bool clear_out = true);
|
||||
@@ -802,7 +802,7 @@ bool UrlDecode(const std::string & url, std::wstring & out, bool clear_out = tr
|
||||
|
||||
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void QEncodeAddChar(char_type c, PT::TextStreamBase<char_type, stack_size, heap_block_size> & out)
|
||||
void QEncodeAddChar(char_type c, pt::TextStreamBase<char_type, stack_size, heap_block_size> & out)
|
||||
{
|
||||
if( (c>='A' && c<='Z') ||
|
||||
(c>='a' && c<='z') ||
|
||||
@@ -817,7 +817,7 @@ void QEncodeAddChar(char_type c, PT::TextStreamBase<char_type, stack_size, heap_
|
||||
|
||||
size_t len1 = sizeof(buf1) / sizeof(char);
|
||||
size_t len2 = sizeof(buf2) / sizeof(char);
|
||||
size_t len = PT::IntToUTF8(int(c), buf1, len1);
|
||||
size_t len = pt::IntToUTF8(int(c), buf1, len1);
|
||||
|
||||
for(size_t i=0 ; i<len ; ++i)
|
||||
{
|
||||
@@ -850,7 +850,7 @@ void QEncodeAddChar(char_type c, PT::TextStreamBase<char_type, stack_size, heap_
|
||||
charset, encoding, encoded-text, and delimiters."
|
||||
*/
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void QEncode(const wchar_t * in, PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
void QEncode(const wchar_t * in, pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear = true)
|
||||
{
|
||||
if( clear )
|
||||
@@ -866,7 +866,7 @@ void QEncode(const wchar_t * in, PT::TextStreamBase<char_type, stack_size, heap_
|
||||
|
||||
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
void QEncode(const std::wstring & in, PT::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
void QEncode(const std::wstring & in, pt::TextStreamBase<char_type, stack_size, heap_block_size> & out,
|
||||
bool clear = true)
|
||||
{
|
||||
if( clear )
|
||||
@@ -984,7 +984,7 @@ void JSONescape(Stream & out, const StringType & str)
|
||||
* converting from a wide string to an UTF-8 string
|
||||
* and puts a log if the conversion fails
|
||||
*
|
||||
* it uses PT::WideToUTF8()
|
||||
* it uses pt::WideToUTF8()
|
||||
*/
|
||||
bool WideToUTF8(const wchar_t * wide_string, char * utf8, size_t utf8_size);
|
||||
bool WideToUTF8(const std::wstring & wide_string, char * utf8, size_t utf8_size);
|
||||
|
Reference in New Issue
Block a user