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:
@@ -24,28 +24,28 @@ Mounts::Mounts()
|
||||
|
||||
void Mounts::CreateMountType()
|
||||
{
|
||||
mount_type_cms = AddMountType("cms");
|
||||
mount_type_thread = AddMountType("thread");
|
||||
mount_type_cms = AddMountType(L"cms");
|
||||
mount_type_thread = AddMountType(L"thread");
|
||||
}
|
||||
|
||||
|
||||
void Mounts::CreateMountFs()
|
||||
{
|
||||
mount_fs_simplefs = AddMountFs("simplefs");
|
||||
mount_fs_hashfs = AddMountFs("hashfs");
|
||||
mount_fs_simplefs = AddMountFs(L"simplefs");
|
||||
mount_fs_hashfs = AddMountFs(L"hashfs");
|
||||
}
|
||||
|
||||
|
||||
void Mounts::CreateMountPar()
|
||||
{
|
||||
mount_par_page = AddMountPar("page");
|
||||
mount_par_thread = AddMountPar("thread");
|
||||
mount_par_createthread_on = AddMountPar("createthread_on");
|
||||
mount_par_only_root_remove = AddMountPar("only_root_remove");
|
||||
mount_par_emacs_on = AddMountPar("emacs_on");
|
||||
mount_par_mkdir_on = AddMountPar("mkdir_on");
|
||||
mount_par_app = AddMountPar("app");
|
||||
mount_par_html_template = AddMountPar("html_template");
|
||||
mount_par_page = AddMountPar(L"page");
|
||||
mount_par_thread = AddMountPar(L"thread");
|
||||
mount_par_createthread_on = AddMountPar(L"createthread_on");
|
||||
mount_par_only_root_remove = AddMountPar(L"only_root_remove");
|
||||
mount_par_emacs_on = AddMountPar(L"emacs_on");
|
||||
mount_par_mkdir_on = AddMountPar(L"mkdir_on");
|
||||
mount_par_app = AddMountPar(L"app");
|
||||
mount_par_html_template = AddMountPar(L"html_template");
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ void Mounts::SetRequest(Request * prequest)
|
||||
|
||||
|
||||
|
||||
int Mounts::AddMountType(const char * type)
|
||||
int Mounts::AddMountType(const wchar_t * type)
|
||||
{
|
||||
mount_type_tab.push_back(type);
|
||||
|
||||
@@ -86,13 +86,13 @@ return static_cast<int>(mount_type_tab.size()) - 1;
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountType(const std::string & type)
|
||||
int Mounts::AddMountType(const std::wstring & type)
|
||||
{
|
||||
return AddMountType(type.c_str());
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountFs(const char * fs)
|
||||
int Mounts::AddMountFs(const wchar_t * fs)
|
||||
{
|
||||
mount_fs_tab.push_back(fs);
|
||||
|
||||
@@ -100,7 +100,7 @@ return static_cast<int>(mount_fs_tab.size()) - 1;
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mounts::GetMountType(int id)
|
||||
const std::wstring & Mounts::GetMountType(int id)
|
||||
{
|
||||
if( id < 0 || id >= (int)mount_type_tab.size() )
|
||||
return empty_str;
|
||||
@@ -109,7 +109,7 @@ const std::string & Mounts::GetMountType(int id)
|
||||
}
|
||||
|
||||
|
||||
int Mounts::FindMountType(const std::string & type)
|
||||
int Mounts::FindMountType(const std::wstring & type)
|
||||
{
|
||||
for(size_t i=0 ; i<mount_type_tab.size() ; ++i)
|
||||
if( mount_type_tab[i] == type )
|
||||
@@ -120,13 +120,13 @@ return -1;
|
||||
|
||||
|
||||
|
||||
int Mounts::AddMountFs(const std::string & fs)
|
||||
int Mounts::AddMountFs(const std::wstring & fs)
|
||||
{
|
||||
return AddMountFs(fs.c_str());
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mounts::GetMountFs(int id)
|
||||
const std::wstring & Mounts::GetMountFs(int id)
|
||||
{
|
||||
if( id < 0 || id >= (int)mount_fs_tab.size() )
|
||||
return empty_str;
|
||||
@@ -135,7 +135,7 @@ const std::string & Mounts::GetMountFs(int id)
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountPar(const char * par)
|
||||
int Mounts::AddMountPar(const wchar_t * par)
|
||||
{
|
||||
mount_par_tab.push_back(par);
|
||||
|
||||
@@ -144,13 +144,13 @@ return static_cast<int>(mount_par_tab.size()) - 1;
|
||||
|
||||
|
||||
|
||||
int Mounts::AddMountPar(const std::string & par)
|
||||
int Mounts::AddMountPar(const std::wstring & par)
|
||||
{
|
||||
return AddMountPar(par.c_str());
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mounts::GetMountPar(int id)
|
||||
const std::wstring & Mounts::GetMountPar(int id)
|
||||
{
|
||||
if( id < 0 || id >= (int)mount_par_tab.size() )
|
||||
return empty_str;
|
||||
@@ -161,7 +161,7 @@ const std::string & Mounts::GetMountPar(int id)
|
||||
|
||||
|
||||
// reading from 'mounts'
|
||||
Error Mounts::ReadMounts(const std::string & mounts)
|
||||
Error Mounts::ReadMounts(const std::wstring & mounts)
|
||||
{
|
||||
mount_parser.SetDirs(dirs);
|
||||
mount_parser.SetMountTypeTab(mount_type_tab);
|
||||
@@ -187,7 +187,7 @@ return err;
|
||||
// reading from /etc/fstab
|
||||
Error Mounts::ReadMounts()
|
||||
{
|
||||
static std::string file = "fstab";
|
||||
static std::wstring file = L"fstab";
|
||||
|
||||
Item * etc = dirs->GetEtcDir();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user