added support for UTF-8
now the UTF-8 is a default charset git-svn-id: svn://ttmath.org/publicrep/winix/trunk@677 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -27,19 +27,19 @@ void MountParser::SetDirs(Dirs * pdirs)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetMountTypeTab(const std::vector<std::string> & tab)
|
||||
void MountParser::SetMountTypeTab(const std::vector<std::wstring> & tab)
|
||||
{
|
||||
mount_type_tab = &tab;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetMountFsTab(const std::vector<std::string> & tab)
|
||||
void MountParser::SetMountFsTab(const std::vector<std::wstring> & tab)
|
||||
{
|
||||
mount_fs_tab = &tab;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetMountParTab(const std::vector<std::string> & tab)
|
||||
void MountParser::SetMountParTab(const std::vector<std::wstring> & tab)
|
||||
{
|
||||
mount_par_tab = &tab;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void MountParser::SkipLine()
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadWordQuote(std::string & res)
|
||||
void MountParser::ReadWordQuote(std::wstring & res)
|
||||
{
|
||||
++pinput;
|
||||
|
||||
@@ -102,7 +102,7 @@ void MountParser::ReadWordQuote(std::string & res)
|
||||
|
||||
|
||||
// a white character is the separator
|
||||
void MountParser::ReadWordWhite(std::string & res)
|
||||
void MountParser::ReadWordWhite(std::wstring & res)
|
||||
{
|
||||
while( *pinput && *pinput!=10 && !IsWhite(*pinput) )
|
||||
{
|
||||
@@ -113,7 +113,7 @@ void MountParser::ReadWordWhite(std::string & res)
|
||||
|
||||
|
||||
// the comma or the second bracket ')' are the separators
|
||||
void MountParser::ReadWordComma(std::string & res)
|
||||
void MountParser::ReadWordComma(std::wstring & res)
|
||||
{
|
||||
while( *pinput && *pinput!=10 && *pinput!=',' && *pinput!=')' )
|
||||
{
|
||||
@@ -127,7 +127,7 @@ void MountParser::ReadWordComma(std::string & res)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadWord(std::string & res, bool comma_bracket_separator)
|
||||
void MountParser::ReadWord(std::wstring & res, bool comma_bracket_separator)
|
||||
{
|
||||
res.clear();
|
||||
SkipWhite();
|
||||
@@ -192,7 +192,7 @@ void MountParser::ReadParamArgs(Mount::ParamRow::ParamArg & args)
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadParamName(std::string & res)
|
||||
void MountParser::ReadParamName(std::wstring & res)
|
||||
{
|
||||
SkipWhite();
|
||||
res.clear();
|
||||
@@ -205,7 +205,7 @@ void MountParser::ReadParamName(std::string & res)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParam(std::string & res, Mount::ParamRow::ParamArg & args)
|
||||
void MountParser::ReadParam(std::wstring & res, Mount::ParamRow::ParamArg & args)
|
||||
{
|
||||
ReadParamName(res);
|
||||
|
||||
@@ -221,7 +221,7 @@ void MountParser::ReadParam(std::string & res, Mount::ParamRow::ParamArg & args)
|
||||
}
|
||||
|
||||
|
||||
int MountParser::FindIndex(const std::vector<std::string> * tab, const std::string & value)
|
||||
int MountParser::FindIndex(const std::vector<std::wstring> * tab, const std::wstring & value)
|
||||
{
|
||||
for(size_t i=0 ; i < tab->size() ; ++i)
|
||||
{
|
||||
@@ -373,7 +373,7 @@ void MountParser::ReadRow(std::map<long, Mount> & output)
|
||||
|
||||
|
||||
|
||||
Error MountParser::Parse(const std::string & input, std::map<long, Mount> & output)
|
||||
Error MountParser::Parse(const std::wstring & input, std::map<long, Mount> & output)
|
||||
{
|
||||
if( !dirs || !mount_type_tab || !mount_fs_tab || !mount_par_tab )
|
||||
{
|
||||
@@ -396,7 +396,7 @@ Error MountParser::Parse(const std::string & input, std::map<long, Mount> & outp
|
||||
|
||||
while( *pinput && err == WINIX_ERR_OK )
|
||||
ReadRow(output);
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user