Ejemplo n.º 1
0
//---------------------------------------------------------------------------
void __fastcall TRightsFrame::SetText(UnicodeString value)
{
  if (Text != value)
  {
    UnicodeString RightsStr = value;

    int P = RightsStr.LowerCase().Pos(FAddXToDirectoriesSuffix);
    bool AAddXToDirectories = (P > 0);
    if (AAddXToDirectories)
    {
      RightsStr.Delete(P, FAddXToDirectoriesSuffix.Length());
    }
    RightsStr = DeleteChar(DeleteChar(RightsStr, L'('), L')').Trim();
    TRights R = Rights;
    if (((RightsStr.Length() == 3) || (RightsStr.Length() == 4)) &&
        IsNumber(RightsStr))
    {
      R.Octal = RightsStr;
    }
    else
    {
      R.Text = RightsStr;
    }

    Rights = R;
    AddXToDirectories = AAddXToDirectories;
  }
}
Ejemplo n.º 2
0
TWatermarkPos __fastcall StrToWatermarkPos(UnicodeString Str)
{
	Str = Str.LowerCase();

	return
		Str == L"top-right"? wpTopRight :
		Str == L"bottom-right"? wpBottomRight :
		Str == L"bottom-left"? wpBottomLeft :
		wpTopLeft;
}
Ejemplo n.º 3
0
TMediaType 	  __fastcall StrToMediaType(UnicodeString Str)
{
	Str = Str.LowerCase();

	return
		Str == L"video"? mtVideo :
		Str == L"audio"? mtAudio :
		Str == L"image"? mtImage :
		mtNone;
}
Ejemplo n.º 4
0
UnicodeString TCopyParamType::ChangeFileName(const UnicodeString & AFileName,
  TOperationSide Side, bool FirstLevel) const
{
  UnicodeString FileName = AFileName;
  if (FirstLevel)
  {
    FileName = MaskFileName(FileName, GetFileMask());
  }
  switch (GetFileNameCase())
  {
    case ncUpperCase:
      FileName = FileName.UpperCase();
      break;
    case ncLowerCase:
      FileName = FileName.LowerCase();
      break;
    case ncFirstUpperCase:
      FileName = FileName.SubString(1, 1).UpperCase() +
        FileName.SubString(2, FileName.Length() - 1).LowerCase();
      break;
    case ncLowerCaseShort:
      if ((FileName.Length() <= 12) && (FileName.Pos(L".") <= 9) &&
          (FileName == FileName.UpperCase()))
      {
        FileName = FileName.LowerCase();
      }
      break;
    case ncNoChange:
    default:
      /*nothing*/
      break;
  }
  if (Side == osRemote)
  {
    FileName = ValidLocalFileName(FileName);
  }
  else
  {
    FileName = RestoreChars(FileName);
  }
  return FileName;
}