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:
@@ -88,7 +88,7 @@ void Dirs::ReadDirs()
|
||||
}
|
||||
|
||||
|
||||
bool Dirs::ExtractName(const char * & s, std::string & name)
|
||||
bool Dirs::ExtractName(const wchar_t * & s, std::wstring & name)
|
||||
{
|
||||
name.clear();
|
||||
|
||||
@@ -157,7 +157,7 @@ DirContainer::ParentIterator Dirs::ParentEnd()
|
||||
// albo tutaj stringa nie czyscic?
|
||||
// O(m * log n) (m- how many parts are in 'id')
|
||||
// path with a slash at the end
|
||||
bool Dirs::MakePath(long id, std::string & path)
|
||||
bool Dirs::MakePath(long id, std::wstring & path)
|
||||
{
|
||||
DirContainer::Iterator i;
|
||||
|
||||
@@ -248,7 +248,7 @@ return &(*etc);
|
||||
}
|
||||
|
||||
|
||||
Item * Dirs::GetDir(const std::string & name, long parent)
|
||||
Item * Dirs::GetDir(const std::wstring & name, long parent)
|
||||
{
|
||||
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent);
|
||||
|
||||
@@ -261,7 +261,7 @@ return 0;
|
||||
|
||||
|
||||
|
||||
Item * Dirs::GetDir(const std::string & path)
|
||||
Item * Dirs::GetDir(const std::wstring & path)
|
||||
{
|
||||
DirContainer::Iterator root = dir_tab.GetRoot();
|
||||
|
||||
@@ -271,8 +271,8 @@ Item * Dirs::GetDir(const std::string & path)
|
||||
|
||||
Item * pitem = &(*root);
|
||||
|
||||
std::string name;
|
||||
const char * s = path.c_str();
|
||||
std::wstring name;
|
||||
const wchar_t * s = path.c_str();
|
||||
|
||||
while( ExtractName(s, name) )
|
||||
{
|
||||
@@ -308,7 +308,7 @@ Item * Dirs::AddDir(const Item & item)
|
||||
|
||||
|
||||
|
||||
size_t Dirs::AnalyzeDir(Item * pdir, const std::string & path, long & dir_id, std::string & dir)
|
||||
size_t Dirs::AnalyzeDir(Item * pdir, const std::wstring & path, long & dir_id, std::wstring & dir)
|
||||
{
|
||||
size_t i = 0;
|
||||
size_t old_i;
|
||||
@@ -354,7 +354,7 @@ size_t Dirs::AnalyzeDir(Item * pdir, const std::string & path, long & dir_id, st
|
||||
2 - the path is empty
|
||||
3 - there is not such a directory
|
||||
*/
|
||||
int Dirs::AnalyzePath(const std::string & path, long & dir_id, std::string & dir, std::string & file)
|
||||
int Dirs::AnalyzePath(const std::wstring & path, long & dir_id, std::wstring & dir, std::wstring & file)
|
||||
{
|
||||
Item * pdir = GetRootDir();
|
||||
dir = '/';
|
||||
@@ -388,9 +388,9 @@ return 0;
|
||||
|
||||
|
||||
|
||||
void Dirs::SplitPath(const std::string & path, std::string & dir, std::string & file)
|
||||
void Dirs::SplitPath(const std::wstring & path, std::wstring & dir, std::wstring & file)
|
||||
{
|
||||
std::string::size_type i;
|
||||
std::wstring::size_type i;
|
||||
|
||||
dir.clear();
|
||||
file.clear();
|
||||
@@ -465,8 +465,8 @@ Item * Dirs::CreateVarDir()
|
||||
v.user_id = -1;
|
||||
v.group_id = -1;
|
||||
v.privileges = 0755;
|
||||
v.subject = "var";
|
||||
v.url = "var";
|
||||
v.subject = L"var";
|
||||
v.url = L"var";
|
||||
v.type = Item::dir;
|
||||
|
||||
AddDirectory(v, false, &var);
|
||||
|
Reference in New Issue
Block a user