changed: now we do not use std::string and char* in the Winix API
everywhere we are using std::wstring and wchar_t* (std::string and char* is used only locally in some places especially when creating a path to OS file system etc.) added: to the special thread when winix closes: a write function for curl: FetchPageOnExitCurlCallback() without this function the curl library will print the page's content to the standart output changed: TextStream<> class from core can make UTF8<->wide strings conversions removed: from config: utf8 option now winix expects UTF8 from the user's input (html forms, url-es) and outputs strings in the UTF8 format git-svn-id: svn://ttmath.org/publicrep/winix/trunk@965 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -32,8 +32,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <wchar.h>
|
||||
#include "acceptbaseparser.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
|
||||
namespace Winix
|
||||
@@ -58,28 +60,11 @@ void AcceptBaseParser::SkipWhite()
|
||||
}
|
||||
|
||||
|
||||
void AcceptBaseParser::RemoveWhiteFromEnd(std::string & str)
|
||||
{
|
||||
if( str.empty() )
|
||||
return;
|
||||
|
||||
size_t i = str.size() - 1;
|
||||
|
||||
for( ; i!=0 && IsWhite(str[i]) ; --i);
|
||||
|
||||
if( !IsWhite(str[i]) )
|
||||
++i;
|
||||
|
||||
if( i < str.size() )
|
||||
str.erase(i); // erasing until the end of the string
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AcceptBaseParser::ReadParameter()
|
||||
{
|
||||
param.clear();
|
||||
|
||||
SkipWhite();
|
||||
|
||||
while( *text!=0 && *text!=',' && *text!=';' )
|
||||
@@ -88,14 +73,13 @@ void AcceptBaseParser::ReadParameter()
|
||||
++text;
|
||||
}
|
||||
|
||||
RemoveWhiteFromEnd(param);
|
||||
TrimWhite(param);
|
||||
}
|
||||
|
||||
|
||||
void AcceptBaseParser::ReadQ()
|
||||
{
|
||||
q = 1.0;
|
||||
|
||||
SkipWhite();
|
||||
|
||||
if( *text != ';' )
|
||||
@@ -113,7 +97,7 @@ void AcceptBaseParser::ReadQ()
|
||||
++text; // skipping '='
|
||||
|
||||
SkipWhite();
|
||||
q = strtod(text, (char**)&text);
|
||||
q = wcstod(text, (wchar_t**)&text);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +111,7 @@ void AcceptBaseParser::SkipParam()
|
||||
|
||||
|
||||
|
||||
void AcceptBaseParser::Parse(const char * str)
|
||||
void AcceptBaseParser::Parse(const wchar_t * str)
|
||||
{
|
||||
text = str;
|
||||
Init();
|
||||
@@ -143,6 +127,12 @@ void AcceptBaseParser::Parse(const char * str)
|
||||
|
||||
|
||||
|
||||
void AcceptBaseParser::Parse(const std::wstring & str)
|
||||
{
|
||||
Parse(str.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
Reference in New Issue
Block a user