コード例 #1
0
ファイル: datetime.cpp プロジェクト: alexlav/conemu
void GetFileDateAndTime(const wchar_t *Src,LPWORD Dst,size_t Count,int Separator)
{
	for (size_t i=0; i<Count; i++)
	{
		Dst[i]=(WORD)-1;
	}

	string strDigit;
	const wchar_t *Ptr=Src;

	for (size_t i=0; i<Count; i++)
	{
		Ptr=GetCommaWord(Ptr,strDigit,Separator);

		if (Ptr)
		{
			const wchar_t *PtrDigit=strDigit;

			while (*PtrDigit&&!iswdigit(*PtrDigit))
			{
				PtrDigit++;
			}

			if (*PtrDigit)
			{
				Dst[i]=static_cast<WORD>(_wtoi(PtrDigit));
			}
		}
		else
		{
			break;
		}
	}
}
コード例 #2
0
ファイル: panelmix.cpp プロジェクト: Firebie/FarManager
	FOR(auto& i, Columns)
	{
		string strArgName;
		TextPtr = GetCommaWord(TextPtr, strArgName);
		if (!TextPtr)
			break;

		try
		{
			i.width = std::stoi(strArgName);
		}
		catch(const std::exception&)
		{
			// TODO: diagnostics
			i.width = 0;
		}

		i.width_type = COUNT_WIDTH;

		if (strArgName.size()>1)
		{
			switch (strArgName.back())
			{
				case L'%':
					i.width_type = PERCENT_WIDTH;
					break;
			}
		}
	}
コード例 #3
0
int CmpNameList (const char *MaskList, const char *Path, bool skipPath /*= false*/)
{
    const char *pMask = MaskList;
    char curMask [256];
    while ((pMask = GetCommaWord (pMask, curMask)) != NULL)
        if (Far::CmpName (curMask, Path, skipPath)) return true;

        return false;
}
コード例 #4
0
ファイル: ArcMix.cpp プロジェクト: FarGroup/FarManager
int FindExecuteFile(char *OriginalName,char *DestName,int SizeDest)
{
  char Env[512];
  char TempDestName[1024],*FilePart;
  char Ext[64],*PtrExt;

  if((PtrExt=strrchr(OriginalName,'.')) == NULL)
  {
    if(!GetEnvironmentVariable("PATHEXT",Env,sizeof(Env)))
      lstrcpy(Env,".exe;.com;.bat;.cmd");

    PtrExt=Env;
    while(1)
    {
      if((PtrExt=GetCommaWord(PtrExt,Ext,';')) == NULL)
        break;
      if(SearchPath(NULL,OriginalName,Ext,
               sizeof(TempDestName),  // size, in characters, of buffer
               TempDestName,  // address of buffer for found filename
               &FilePart))  // address of pointer to file component
      {
        if(DestName)
          lstrcpyn(DestName,TempDestName,SizeDest);
        return TRUE;
      }
    }
  }
  else if(SearchPath(NULL,OriginalName,PtrExt,
               sizeof(TempDestName),  // size, in characters, of buffer
               TempDestName,  // address of buffer for found filename
               &FilePart))  // address of pointer to file component
  {
    if(DestName)
      lstrcpyn(DestName,TempDestName,SizeDest);
    return TRUE;
  }
  return FALSE;
}
コード例 #5
0
ファイル: panelmix.cpp プロジェクト: Firebie/FarManager
void TextToViewSettings(const string& ColumnTitles,const string& ColumnWidths, std::vector<column>& Columns)
{
	// BUGBUG, add error checking

	const wchar_t *TextPtr=ColumnTitles.data();

	Columns.clear();

	for (;;)
	{
		string strArgName;
		TextPtr = GetCommaWord(TextPtr, strArgName);
		if (!TextPtr)
			break;

		Columns.emplace_back(VALUE_TYPE(Columns)());

		string strArgOrig = strArgName;
		ToUpper(strArgName);

		if (strArgName.front() == L'N')
		{
			unsigned __int64 &ColumnType = Columns.back().type;
			ColumnType = NAME_COLUMN;
			const wchar_t *Ptr = strArgName.data() + 1;

			while (*Ptr)
			{
				switch (*Ptr)
				{
				case L'M':
					ColumnType |= COLUMN_MARK;
					break;
				case L'D':
					ColumnType |= COLUMN_MARK_DYNAMIC;
					break;
				case L'O':
					ColumnType |= COLUMN_NAMEONLY;
					break;
				case L'R':
					ColumnType |= COLUMN_RIGHTALIGN;
					break;
				case L'F':
					ColumnType |= COLUMN_RIGHTALIGNFORCE;
					break;
				case L'N':
					ColumnType |= COLUMN_NOEXTENSION;
					break;
				}

				Ptr++;
			}
		}
		else if (strArgName.front() == L'S' || strArgName.front() == L'P' || strArgName.front() == L'G')
		{
			unsigned __int64 &ColumnType = Columns.back().type;
			ColumnType = (strArgName.front() == L'S') ? SIZE_COLUMN : (strArgName.front() == L'P') ? PACKED_COLUMN : STREAMSSIZE_COLUMN;
			const wchar_t *Ptr = strArgName.data() + 1;

			while (*Ptr)
			{
				switch (*Ptr)
				{
				case L'C':
					ColumnType |= COLUMN_COMMAS;
					break;
				case L'E':
					ColumnType |= COLUMN_ECONOMIC;
					break;
				case L'F':
					ColumnType |= COLUMN_FLOATSIZE;
					break;
				case L'T':
					ColumnType |= COLUMN_THOUSAND;
					break;
				}

				Ptr++;
			}
		}
		else if (!StrCmpN(strArgName.data(), L"DM", 2) || !StrCmpN(strArgName.data(), L"DC", 2) || !StrCmpN(strArgName.data(), L"DA", 2) || !StrCmpN(strArgName.data(), L"DE", 2))
		{
			unsigned __int64 &ColumnType = Columns.back().type;

			switch (strArgName[1])
			{
			case L'M':
				ColumnType = WDATE_COLUMN;
				break;
			case L'C':
				ColumnType = CDATE_COLUMN;
				break;
			case L'A':
				ColumnType = ADATE_COLUMN;
				break;
			case L'E':
				ColumnType = CHDATE_COLUMN;
				break;
			}

			const wchar_t *Ptr = strArgName.data() + 2;

			while (*Ptr)
			{
				switch (*Ptr)
				{
				case L'B':
					ColumnType |= COLUMN_BRIEF;
					break;
				case L'M':
					ColumnType |= COLUMN_MONTH;
					break;
				}

				Ptr++;
			}
		}
		else if (strArgName.front() == L'O')
		{
			unsigned __int64 &ColumnType = Columns.back().type;
			ColumnType = OWNER_COLUMN;

			if (strArgName.size() > 1 && strArgName[1] == L'L')
				ColumnType |= COLUMN_FULLOWNER;
		}
		else if (strArgName.front() == L'X')
		{
			unsigned __int64 &ColumnType = Columns.back().type;
			ColumnType = EXTENSION_COLUMN;

			if (strArgName.size() > 1 && strArgName[1] == L'R')
				ColumnType |= COLUMN_RIGHTALIGN;
		}
		else if (strArgOrig.size() > 2 && strArgOrig.front() == L'<' && strArgOrig.back() == L'>')
		{
			Columns.back().title = strArgOrig.substr(1, strArgOrig.size() - 2);
			Columns.back().type = CUSTOM_COLUMN0;
		}
		else
		{
			auto ItemIterator = std::find_if(CONST_RANGE(ColumnInfo, i) { return strArgName == i.Symbol; });
			if (ItemIterator != std::cend(ColumnInfo))
				Columns.back().type = ItemIterator->Type;
			else if (strArgOrig.size() >= 2 && strArgOrig.size() <= 3 && strArgOrig.front() == L'C')
			{
				unsigned int num;
				if (1 == swscanf(strArgOrig.c_str()+1, L"%u", &num))
					Columns.back().type = CUSTOM_COLUMN0 + num;
			}
		}
	}
コード例 #6
0
ファイル: dizlist.cpp プロジェクト: alexlav/conemu
bool DizList::Flush(const string& Path,const string* DizName)
{
	if (!Modified)
		return true;

	if (DizName)
	{
		strDizFileName = *DizName;
	}
	else if (strDizFileName.IsEmpty())
	{
		if (!DizData || !Path)
			return false;

		strDizFileName = Path;
		AddEndSlash(strDizFileName);
		string strArgName;
		GetCommaWord(Opt.Diz.strListNames,strArgName);
		strDizFileName += strArgName;
	}

	DWORD FileAttr=apiGetFileAttributes(strDizFileName);

	if (FileAttr != INVALID_FILE_ATTRIBUTES)
	{
		if (FileAttr&FILE_ATTRIBUTE_READONLY)
		{
			if(Opt.Diz.ROUpdate)
			{
				if(apiSetFileAttributes(strDizFileName,FileAttr))
				{
					FileAttr^=FILE_ATTRIBUTE_READONLY;
				}
			}
		}

		if(!(FileAttr&FILE_ATTRIBUTE_READONLY))
		{
			#if 1
			//Maximus5: На некоторых сетевых устройствах атрибуты вообще не устанавливаются
			// Поэтому возвращается ошибка, и производится попытка Elevation (что бессмысленно)
			DisableElevation DE;
			#endif
			apiSetFileAttributes(strDizFileName,FILE_ATTRIBUTE_ARCHIVE);
		}
		else
		{
			Message(MSG_WARNING,1,MSG(MError),MSG(MCannotUpdateDiz),MSG(MCannotUpdateRODiz),MSG(MOk));
			return false;
		}
	}

	File DizFile;

	bool AnyError=false;

	bool EmptyDiz=true;
	// Don't use CreationDisposition=CREATE_ALWAYS here - it's kills alternate streams
	if(DizCount && DizFile.Open(strDizFileName, GENERIC_WRITE, FILE_SHARE_READ, nullptr, FileAttr==INVALID_FILE_ATTRIBUTES?CREATE_NEW:TRUNCATE_EXISTING))
	{
		uintptr_t CodePage = Opt.Diz.SaveInUTF ? CP_UTF8 : (Opt.Diz.AnsiByDefault ? CP_ACP : CP_OEMCP);

		CachedWrite Cache(DizFile);

		if (CodePage == CP_UTF8)
		{
			DWORD dwSignature = SIGN_UTF8;
			if(!Cache.Write(&dwSignature, 3))
			{
				AnyError=true;
			}
		}

		if(!AnyError)
		{
			for (size_t I=0; I<DizCount; I++)
			{
				if (!DizData[I]->Deleted)
				{
					DWORD Size=static_cast<DWORD>((DizData[I]->DizText.GetLength()+1)*(CodePage == CP_UTF8?3:1)); //UTF-8, up to 3 bytes per char support
					char* lpDizText = new char[Size];
					if (lpDizText)
					{
						int BytesCount=WideCharToMultiByte(CodePage, 0, DizData[I]->DizText, static_cast<int>(DizData[I]->DizText.GetLength()+1), lpDizText, Size, nullptr, nullptr);
						if (BytesCount && BytesCount-1)
						{
							if(Cache.Write(lpDizText, BytesCount-1))
							{
								EmptyDiz=false;
							}
							else
							{
								AnyError=true;
								break;
							}
							if(!Cache.Write("\r\n", 2))
							{
								AnyError=true;
								break;
							}
						}
						delete[] lpDizText;
					}
				}
			}
		}

		if(!AnyError)
		{
			if(!Cache.Flush())
			{
				AnyError=true;
			}
		}

		DizFile.Close();
	}

	if (!EmptyDiz && !AnyError)
	{
		if (FileAttr==INVALID_FILE_ATTRIBUTES)
		{
			FileAttr=FILE_ATTRIBUTE_ARCHIVE|(Opt.Diz.SetHidden?FILE_ATTRIBUTE_HIDDEN:0);
		}
		apiSetFileAttributes(strDizFileName,FileAttr);
	}
	else
	{
		apiDeleteFile(strDizFileName);
		if(AnyError)
		{
			Message(MSG_WARNING|MSG_ERRORTYPE,1,MSG(MError),MSG(MCannotUpdateDiz),MSG(MOk));
			return false;
		}
	}

	Modified=false;
	return true;
}
コード例 #7
0
ファイル: dizlist.cpp プロジェクト: alexlav/conemu
void DizList::Read(const string& Path, const string* DizName)
{
	Reset();
	TPreRedrawFuncGuard preRedrawFuncGuard(DizList::PR_ReadingMsg);
	const wchar_t *NamePtr=Opt.Diz.strListNames;

	for (;;)
	{
		if (DizName)
		{
			strDizFileName = *DizName;
		}
		else
		{
			strDizFileName = Path;

			if (!PathCanHoldRegularFile(strDizFileName))
				break;

			string strArgName;

			if (!(NamePtr=GetCommaWord(NamePtr,strArgName)))
				break;

			AddEndSlash(strDizFileName);
			strDizFileName += strArgName;
		}

		File DizFile;
		if (DizFile.Open(strDizFileName,GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING))
		{
			GetFileString GetStr(DizFile);
			wchar_t *DizText;
			int DizLength;
			clock_t StartTime=clock();
			uintptr_t CodePage=CP_DEFAULT;
			bool bSigFound=false;

			if (!GetFileFormat(DizFile,CodePage,&bSigFound,false) || !bSigFound)
				CodePage = Opt.Diz.AnsiByDefault ? CP_ACP : CP_OEMCP;

			while (GetStr.GetString(&DizText, CodePage, DizLength) > 0)
			{
				if (!(DizCount & 127) && clock()-StartTime>1000)
				{
					SetCursorType(FALSE,0);
					PR_ReadingMsg();

					if (CheckForEsc())
						break;
				}

				RemoveTrailingSpaces(DizText);

				if (*DizText)
					AddRecord(DizText);
			}

			OrigCodePage=CodePage;
			Modified=false;
			DizFile.Close();
			return;
		}

		if (DizName)
			break;
	}

	Modified=false;
	strDizFileName.Clear();
}
コード例 #8
0
ファイル: AutoWrap.cpp プロジェクト: Frankie-666/farmanager
intptr_t WINAPI ProcessEditorInputW(const ProcessEditorInputInfo *InputInfo)
{
	if(!Opt.Wrap)
		return FALSE;

	static int Reenter=FALSE;

	if(Reenter || InputInfo->Rec.EventType!=KEY_EVENT || !InputInfo->Rec.Event.KeyEvent.bKeyDown || InputInfo->Rec.Event.KeyEvent.wVirtualKeyCode==VK_F1)
		return FALSE;

	struct EditorInfo startei= {sizeof(EditorInfo)};
	Info.EditorControl(-1,ECTL_GETINFO,0,&startei);
	struct EditorGetString prevegs= {sizeof(EditorGetString)};
	prevegs.StringNumber=-1;
	Info.EditorControl(-1,ECTL_GETSTRING,0,&prevegs);
	Reenter=TRUE;
	Info.EditorControl(-1,ECTL_PROCESSINPUT,0,const_cast<INPUT_RECORD*>(&InputInfo->Rec));
	Reenter=FALSE;

	for(int Pass=1;; Pass++)
	{
		EditorInfo ei= {sizeof(EditorInfo)};
		Info.EditorControl(-1,ECTL_GETINFO,0,&ei);
		LPWSTR FileName=nullptr;
		size_t FileNameSize=Info.EditorControl(-1,ECTL_GETFILENAME,0,0);

		if(FileNameSize)
		{
			FileName=new wchar_t[FileNameSize];

			if(FileName)
			{
				Info.EditorControl(-1,ECTL_GETFILENAME,FileNameSize,FileName);
			}
		}

		if(Pass==1 && *Opt.FileMasks)
		{
			if(ei.CurLine!=startei.CurLine)
			{
				if(FileName)
					delete[] FileName;

				return TRUE;
			}

			bool Found=false;
			wchar_t FileMask[MAX_PATH];
			const wchar_t *MaskPtr=Opt.FileMasks;

			while((MaskPtr=GetCommaWord(MaskPtr,FileMask))!=nullptr)
			{
				if(FSF.ProcessName(FileMask,FileName,0,PN_CMPNAME|PN_SKIPPATH))
				{
					Found=true;
					break;
				}
			}

			if(!Found)
			{
				if(FileName)
					delete[] FileName;

				return TRUE;
			}

			MaskPtr=Opt.ExcludeFileMasks;

			while((MaskPtr=GetCommaWord(MaskPtr,FileMask))!=nullptr)
			{
				if(FSF.ProcessName(FileMask,FileName,0,PN_CMPNAME|PN_SKIPPATH))
				{
					Found=false;
					break;
				}
			}

			if(!Found)
			{
				if(FileName)
					delete[] FileName;

				return TRUE;
			}
		}

		if(FileName)
			delete[] FileName;

		struct EditorGetString egs= {sizeof(EditorGetString)};
		egs.StringNumber=ei.CurLine;
		Info.EditorControl(-1,ECTL_GETSTRING,0,&egs);
		bool TabPresent=wmemchr(egs.StringText,L'\t',egs.StringLength)!=nullptr;
		intptr_t TabLength=egs.StringLength;

		if(TabPresent)
		{
			struct EditorConvertPos ecp= {sizeof(EditorConvertPos)};
			ecp.StringNumber=-1;
			ecp.SrcPos=egs.StringLength;
			Info.EditorControl(-1,ECTL_REALTOTAB,0,&ecp);
			TabLength=ecp.DestPos;
		}

		if((Pass!=1 || prevegs.StringLength!=egs.StringLength) &&
		        TabLength>=Opt.RightMargin && ei.CurPos>=egs.StringLength)
		{
			intptr_t SpacePos=-1;

			for(intptr_t I=egs.StringLength-1; I>0; I--)
			{
				if(egs.StringText[I]==L' ' || egs.StringText[I]==L'\t')
				{
					SpacePos=I;
					intptr_t TabPos=I;

					if(TabPresent)
					{
						struct EditorConvertPos ecp= {sizeof(EditorConvertPos)};
						ecp.StringNumber=-1;
						ecp.SrcPos=I;
						Info.EditorControl(-1,ECTL_REALTOTAB,0,&ecp);
						TabPos=ecp.DestPos;
					}

					if(TabPos<Opt.RightMargin)
						break;
				}
			}

			if(SpacePos<=0)
				break;

			bool SpaceOnly=true;

			for(int I=0; I<SpacePos; I++)
			{
				if(egs.StringText[I]!=L' ' && egs.StringText[I]!=L'\t')
				{
					SpaceOnly=false;
					break;
				}
			}

			if(SpaceOnly)
				break;

			struct EditorSetPosition esp= {sizeof(EditorSetPosition),-1,-1,-1,-1,-1,-1};
			esp.CurPos=SpacePos+1;
			Info.EditorControl(-1,ECTL_SETPOSITION,0,&esp);
			int Indent=TRUE;

			if(!Info.EditorControl(-1,ECTL_INSERTSTRING,0,&Indent))
				break;

			if(ei.CurPos<SpacePos)
			{
				esp.CurLine=ei.CurLine;
				esp.CurPos=ei.CurPos;
				Info.EditorControl(-1,ECTL_SETPOSITION,0,&esp);
			}
			else
			{
				egs.StringNumber=ei.CurLine+1;
				Info.EditorControl(-1,ECTL_GETSTRING,0,&egs);
				esp.CurLine=ei.CurLine+1;
				esp.CurPos=egs.StringLength;
				Info.EditorControl(-1,ECTL_SETPOSITION,0,&esp);
			}

			Info.EditorControl(-1,ECTL_REDRAW,0,0);
		}
		else
			break;
	}

	return TRUE;
}
コード例 #9
0
ファイル: dizlist.cpp プロジェクト: Firebie/FarManager
void DizList::Read(const string& Path, const string* DizName)
{
	Reset();

	struct DizPreRedrawItem : public PreRedrawItem
	{
		DizPreRedrawItem() : PreRedrawItem(PR_ReadingMsg) {}
	};

	SCOPED_ACTION(TPreRedrawFuncGuard)(std::make_unique<DizPreRedrawItem>());
	const wchar_t *NamePtr=Global->Opt->Diz.strListNames.data();

	for (;;)
	{
		if (DizName)
		{
			strDizFileName = *DizName;
		}
		else
		{
			strDizFileName = Path;

			if (!PathCanHoldRegularFile(strDizFileName))
				break;

			string strArgName;
			NamePtr = GetCommaWord(NamePtr, strArgName);

			if (!NamePtr)
				break;

			AddEndSlash(strDizFileName);
			strDizFileName += strArgName;
		}

		os::fs::file DizFile;
		if (DizFile.Open(strDizFileName,GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING))
		{
			clock_t StartTime=clock();
			uintptr_t CodePage=CP_DEFAULT;
			bool bSigFound=false;

			if (!GetFileFormat(DizFile,CodePage,&bSigFound,false) || !bSigFound)
				CodePage = Global->Opt->Diz.AnsiByDefault ? CP_ACP : CP_OEMCP;

			GetFileString GetStr(DizFile, CodePage);

			auto LastAdded = DizData.end(); 
			string DizText;
			while (GetStr.GetString(DizText))
			{
				if (!(DizData.size() & 127) && clock() - StartTime > CLOCKS_PER_SEC)
				{
					SetCursorType(false, 0);
					PR_ReadingMsg();

					if (CheckForEsc())
						break;
				}

				RemoveTrailingSpaces(DizText);

				if (!DizText.empty())
				{
					if(!IsSpace(DizText.front()))
					{
						LastAdded = AddRecord(DizText);
					}
					else
					{
						if (LastAdded != DizData.end())
						{
							LastAdded->second.emplace_back(DizText);
						}
					}
				}
			}

			OrigCodePage=CodePage;
			Modified=false;
			DizFile.Close();
			return;
		}

		if (DizName)
			break;
	}

	Modified=false;
	strDizFileName.clear();
}
コード例 #10
0
ファイル: dizlist.cpp プロジェクト: Firebie/FarManager
bool DizList::Flush(const string& Path,const string* DizName)
{
	if (!Modified)
		return true;

	if (DizName)
	{
		strDizFileName = *DizName;
	}
	else if (strDizFileName.empty())
	{
		if (DizData.empty() || Path.empty())
			return false;

		strDizFileName = Path;
		AddEndSlash(strDizFileName);
		string strArgName;
		GetCommaWord(Global->Opt->Diz.strListNames.data(),strArgName);
		strDizFileName += strArgName;
	}

	DWORD FileAttr=os::GetFileAttributes(strDizFileName);

	if (FileAttr != INVALID_FILE_ATTRIBUTES)
	{
		if (FileAttr&FILE_ATTRIBUTE_READONLY)
		{
			if(Global->Opt->Diz.ROUpdate)
			{
				if(os::SetFileAttributes(strDizFileName,FileAttr))
				{
					FileAttr^=FILE_ATTRIBUTE_READONLY;
				}
			}
		}

		if(!(FileAttr&FILE_ATTRIBUTE_READONLY))
		{
			os::SetFileAttributes(strDizFileName,FILE_ATTRIBUTE_ARCHIVE);
		}
		else
		{
			Message(MSG_WARNING,1,MSG(MError),MSG(MCannotUpdateDiz),MSG(MCannotUpdateRODiz),MSG(MOk));
			return false;
		}
	}

	os::fs::file DizFile;

	bool AnyError=false;

	bool EmptyDiz=true;
	// Don't use CreationDisposition=CREATE_ALWAYS here - it's kills alternate streams
	if(!DizData.empty() && DizFile.Open(strDizFileName, GENERIC_WRITE, FILE_SHARE_READ, nullptr, FileAttr==INVALID_FILE_ATTRIBUTES?CREATE_NEW:TRUNCATE_EXISTING))
	{
		uintptr_t CodePage = Global->Opt->Diz.SaveInUTF ? CP_UTF8 : (Global->Opt->Diz.AnsiByDefault ? CP_ACP : CP_OEMCP);

		CachedWrite Cache(DizFile);

		if (CodePage == CP_UTF8)
		{
			DWORD dwSignature = SIGN_UTF8;
			if(!Cache.Write(&dwSignature, 3))
			{
				AnyError=true;
			}
		}

		if(!AnyError)
		{
			FOR(const auto& i, DizData)
			{
				string dump = i.first;
				QuoteSpaceOnly(dump);
				dump += i.second.front();
				if(i.second.size() > 1)
				{
					auto start = i.second.cbegin();
					++start;
					std::for_each(start, i.second.cend(), [&](CONST_REFERENCE(i.second) j)
					{
						dump.append(L"\r\n ").append(j);
					});
コード例 #11
0
ファイル: panelmix.cpp プロジェクト: alexlav/conemu
void TextToViewSettings(const wchar_t *ColumnTitles,const wchar_t *ColumnWidths,
						unsigned __int64 *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int &ColumnCount)
{
	const wchar_t *TextPtr=ColumnTitles;
	//Maximus: для отладки
	_ASSERTE(ARRAYSIZE(ColumnTypeWidth)==ARRAYSIZE(ColumnSymbol));

	for (ColumnCount=0; ColumnCount < PANEL_COLUMNCOUNT; ColumnCount++)
	{
		string strArgName;

		if (!(TextPtr=GetCommaWord(TextPtr,strArgName)))
			break;

		strArgName.Upper();

		if (strArgName.At(0)==L'N')
		{
			unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
			ColumnType=NAME_COLUMN;
			const wchar_t *Ptr = strArgName.CPtr()+1;

			while (*Ptr)
			{
				switch (*Ptr)
				{
					case L'M':
						ColumnType|=COLUMN_MARK;
						break;
					case L'O':
						ColumnType|=COLUMN_NAMEONLY;
						break;
					case L'R':
						ColumnType|=COLUMN_RIGHTALIGN;
						break;
					case L'F':
						ColumnType|=COLUMN_RIGHTALIGNFORCE;
						break;
					case L'N':
						ColumnType|=COLUMN_NOEXTENSION;
						break;
				}

				Ptr++;
			}
		}
		else
		{
			if (strArgName.At(0)==L'S' || strArgName.At(0)==L'P' || strArgName.At(0)==L'G')
			{
				unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
				ColumnType=(strArgName.At(0)==L'S') ? SIZE_COLUMN:(strArgName.At(0)==L'P')?PACKED_COLUMN:STREAMSSIZE_COLUMN;
				const wchar_t *Ptr = strArgName.CPtr()+1;

				while (*Ptr)
				{
					switch (*Ptr)
					{
						case L'C':
							ColumnType|=COLUMN_COMMAS;
							break;
						case L'E':
							ColumnType|=COLUMN_ECONOMIC;
							break;
						case L'F':
							ColumnType|=COLUMN_FLOATSIZE;
							break;
						case L'T':
							ColumnType|=COLUMN_THOUSAND;
							break;
					}

					Ptr++;
				}
			}
			else
			{
				if (!StrCmpN(strArgName,L"DM",2) || !StrCmpN(strArgName,L"DC",2) || !StrCmpN(strArgName,L"DA",2) || !StrCmpN(strArgName,L"DE",2))
				{
					unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];

					switch (strArgName.At(1))
					{
						case L'M':
							ColumnType=WDATE_COLUMN;
							break;
						case L'C':
							ColumnType=CDATE_COLUMN;
							break;
						case L'A':
							ColumnType=ADATE_COLUMN;
							break;
						case L'E':
							ColumnType=CHDATE_COLUMN;
							break;
					}

					const wchar_t *Ptr = strArgName.CPtr()+2;

					while (*Ptr)
					{
						switch (*Ptr)
						{
							case L'B':
								ColumnType|=COLUMN_BRIEF;
								break;
							case L'M':
								ColumnType|=COLUMN_MONTH;
								break;
						}

						Ptr++;
					}
				}
				else
				{
					if (strArgName.At(0)==L'O')
					{
						unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
						ColumnType=OWNER_COLUMN;

						if (strArgName.At(1)==L'L')
							ColumnType|=COLUMN_FULLOWNER;
					}
					else if (strArgName.At(0)==L'X')
					{
						unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
						ColumnType=EXTENSION_COLUMN;

						if (strArgName.At(1)==L'R')
							ColumnType|=COLUMN_RIGHTALIGN;
					}
					else
					{
						#if 0
						for (unsigned I=0; I<ARRAYSIZE(ColumnSymbol); I++)
						{
							if (!StrCmp(strArgName,ColumnSymbol[I]))
							{
								ViewColumnTypes[ColumnCount]=I;
								break;
							}
						}
						#else
						//Maximus: многострочная статусная область
						if (strArgName.At(0)==L'B')
						{
							unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
							ColumnType=LINEBREAK_COLUMN;
							const wchar_t *Ptr = strArgName.CPtr()+1;

							while (*Ptr)
							{
								switch (*Ptr)
								{
									case L'R':
										if (!(ColumnType & COLUMN_CENTERALIGN))
											ColumnType|=COLUMN_RIGHTALIGN;
										break;
									case L'C':
										if (!(ColumnType & COLUMN_RIGHTALIGN))
											ColumnType|=COLUMN_CENTERALIGN;
										break;
								}

								Ptr++;
							}
						}
						else
						{
							for (unsigned I=0; I<ARRAYSIZE(ColumnSymbol); I++)
							{
								if (!StrCmp(strArgName,ColumnSymbol[I]))
								{
									ViewColumnTypes[ColumnCount]=I;
									break;
								}
							}
						}
						#endif
					}
				}
			}
		}
	}

	TextPtr=ColumnWidths;

	for (int I=0; I<ColumnCount; I++)
	{
		string strArgName;

		if (!(TextPtr=GetCommaWord(TextPtr,strArgName)))
			break;

		ViewColumnWidths[I]=_wtoi(strArgName);
		ViewColumnWidthsTypes[I]=COUNT_WIDTH;

		if (strArgName.GetLength()>1)
		{
			switch (strArgName.At(strArgName.GetLength()-1))
			{
				case L'%':
					ViewColumnWidthsTypes[I]=PERCENT_WIDTH;
					break;
			}
		}
	}
}