You've already forked lazarus-ccr
RxFPC:New function in RxFileUtils - NormalizeFileName. Fix languages
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4815 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
14
components/rx/trunk/docs/rxfileutils.xml
Normal file
14
components/rx/trunk/docs/rxfileutils.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<fpdoc-descriptions><package name="rxtools"><module name="rxFileUtils"><short>Модуль содержит вспомогательные утилиты для работы с файлами и каталогами</short><element name="FileNameDisabledChars"><short>Список символов, которые нельзя использовать в имени фала</short><descr><p>Константа FileNameDisabledChars содержит список символов, которые нельзя использовать в имени файла.</p><p>Значения константы зависит от платформы</p>
|
||||||
|
</descr>
|
||||||
|
</element><element name="IsValidFileNameChar"><short>Функция проверяет допустимост использования символа в имени файла</short>
|
||||||
|
</element><element name="NormalizeFileName"><short>Функция приводит имя файла к правильному виду в зависимости от платформы</short><descr><p>Данная функция проверяет все символы в имени файла и заменяет запрещённые символы на указанный <b>AReplaceChar</b>.</p><p>По умолчанию вместо AReplaceChar подставляется символ "_" (подчёркивание)</p>
|
||||||
|
</descr>
|
||||||
|
</element><element name="GetFileOwnerUser"><short>Функция возвращает имя пользователя - владельца файла</short>
|
||||||
|
</element><element name="GetFileOwnerData"><short>Функция возвращает данные о владельце файла</short>
|
||||||
|
</element><element name="NormalizeDirectoryName"><short>Функция приводит все разделители в полном пути к файлу к виду принятом на текущей платформе</short>
|
||||||
|
</element><element name="GetUserName"><short>Функция возвращяет имя текущего пользователя, зарегистрированного в операционной сиситеме на рабочем месте</short>
|
||||||
|
</element>
|
||||||
|
</module>
|
||||||
|
</package>
|
||||||
|
</fpdoc-descriptions>
|
@ -30,7 +30,9 @@ msgid "Change password"
|
|||||||
msgstr "Cambiar clave"
|
msgstr "Cambiar clave"
|
||||||
|
|
||||||
#: rxdconst.scirculardatalink
|
#: rxdconst.scirculardatalink
|
||||||
msgid "SCircularDataLink"
|
#, fuzzy
|
||||||
|
#| msgid "SCircularDataLink"
|
||||||
|
msgid "Circular data link"
|
||||||
msgstr "SCircularEnlaceDato"
|
msgstr "SCircularEnlaceDato"
|
||||||
|
|
||||||
#: rxdconst.scollumnname
|
#: rxdconst.scollumnname
|
||||||
@ -51,10 +53,6 @@ msgstr "Dato cambiado. Salvar?"
|
|||||||
msgid "Database locked: %s"
|
msgid "Database locked: %s"
|
||||||
msgstr "Base de Dato bloqueada: %s"
|
msgstr "Base de Dato bloqueada: %s"
|
||||||
|
|
||||||
#: rxdconst.sdatasourcefixed
|
|
||||||
msgid "SDataSourceFixed"
|
|
||||||
msgstr "SFuenteDatosFija"
|
|
||||||
|
|
||||||
#: rxdconst.sdbcomboboxfieldnotassigned
|
#: rxdconst.sdbcomboboxfieldnotassigned
|
||||||
msgid "%s:TDBComboBox - DataField not assigned"
|
msgid "%s:TDBComboBox - DataField not assigned"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -341,10 +339,6 @@ msgstr ""
|
|||||||
msgid "Print options"
|
msgid "Print options"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rxdconst.spropdefbylookup
|
|
||||||
msgid "PropDefByLookup"
|
|
||||||
msgstr "PropDefByLookup"
|
|
||||||
|
|
||||||
#: rxdconst.sregistration
|
#: rxdconst.sregistration
|
||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr "Registro"
|
msgstr "Registro"
|
||||||
|
@ -30,7 +30,7 @@ msgid "Change password"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rxdconst.scirculardatalink
|
#: rxdconst.scirculardatalink
|
||||||
msgid "SCircularDataLink"
|
msgid "Circular data link"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rxdconst.scollumnname
|
#: rxdconst.scollumnname
|
||||||
@ -49,10 +49,6 @@ msgstr ""
|
|||||||
msgid "Database locked: %s"
|
msgid "Database locked: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rxdconst.sdatasourcefixed
|
|
||||||
msgid "SDataSourceFixed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rxdconst.sdbcomboboxfieldnotassigned
|
#: rxdconst.sdbcomboboxfieldnotassigned
|
||||||
msgid "%s:TDBComboBox - DataField not assigned"
|
msgid "%s:TDBComboBox - DataField not assigned"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -329,10 +325,6 @@ msgstr ""
|
|||||||
msgid "Print options"
|
msgid "Print options"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rxdconst.spropdefbylookup
|
|
||||||
msgid "PropDefByLookup"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rxdconst.sregistration
|
#: rxdconst.sregistration
|
||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -7,7 +7,7 @@ msgstr "Программа \"%s\""
|
|||||||
|
|
||||||
#: rxdconst.sblobtext
|
#: rxdconst.sblobtext
|
||||||
msgid "(blob)"
|
msgid "(blob)"
|
||||||
msgstr ""
|
msgstr "(данные)"
|
||||||
|
|
||||||
#: rxdconst.sbottomcaption
|
#: rxdconst.sbottomcaption
|
||||||
msgid "Bottom"
|
msgid "Bottom"
|
||||||
@ -30,7 +30,7 @@ msgid "Change password"
|
|||||||
msgstr "Изменить пароль"
|
msgstr "Изменить пароль"
|
||||||
|
|
||||||
#: rxdconst.scirculardatalink
|
#: rxdconst.scirculardatalink
|
||||||
msgid "SCircularDataLink"
|
msgid "Circular data link"
|
||||||
msgstr "Перекрёстная ссылка данных"
|
msgstr "Перекрёстная ссылка данных"
|
||||||
|
|
||||||
#: rxdconst.scollumnname
|
#: rxdconst.scollumnname
|
||||||
@ -49,10 +49,6 @@ msgstr "Данные были изменены. Сохранить?"
|
|||||||
msgid "Database locked: %s"
|
msgid "Database locked: %s"
|
||||||
msgstr "База данных блокирована: %s"
|
msgstr "База данных блокирована: %s"
|
||||||
|
|
||||||
#: rxdconst.sdatasourcefixed
|
|
||||||
msgid "SDataSourceFixed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rxdconst.sdbcomboboxfieldnotassigned
|
#: rxdconst.sdbcomboboxfieldnotassigned
|
||||||
msgid "%s:TDBComboBox - DataField not assigned"
|
msgid "%s:TDBComboBox - DataField not assigned"
|
||||||
msgstr "%s:TDBComboBox - Не присвоено свойство DataField"
|
msgstr "%s:TDBComboBox - Не присвоено свойство DataField"
|
||||||
@ -329,10 +325,6 @@ msgstr "Печать списка"
|
|||||||
msgid "Print options"
|
msgid "Print options"
|
||||||
msgstr "Параметры печати"
|
msgstr "Параметры печати"
|
||||||
|
|
||||||
#: rxdconst.spropdefbylookup
|
|
||||||
msgid "PropDefByLookup"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rxdconst.sregistration
|
#: rxdconst.sregistration
|
||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr "Регистрация"
|
msgstr "Регистрация"
|
||||||
|
@ -39,7 +39,9 @@ msgid "Change password"
|
|||||||
msgstr "Змінити пароль"
|
msgstr "Змінити пароль"
|
||||||
|
|
||||||
#: rxdconst.scirculardatalink
|
#: rxdconst.scirculardatalink
|
||||||
msgid "SCircularDataLink"
|
#, fuzzy
|
||||||
|
#| msgid "SCircularDataLink"
|
||||||
|
msgid "Circular data link"
|
||||||
msgstr "Перехресне посилання даних"
|
msgstr "Перехресне посилання даних"
|
||||||
|
|
||||||
#: rxdconst.scollumnname
|
#: rxdconst.scollumnname
|
||||||
@ -58,10 +60,6 @@ msgstr "Дані були змінені. Зберегти?"
|
|||||||
msgid "Database locked: %s"
|
msgid "Database locked: %s"
|
||||||
msgstr "База даних блокована: %s"
|
msgstr "База даних блокована: %s"
|
||||||
|
|
||||||
#: rxdconst.sdatasourcefixed
|
|
||||||
msgid "SDataSourceFixed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rxdconst.sdbcomboboxfieldnotassigned
|
#: rxdconst.sdbcomboboxfieldnotassigned
|
||||||
msgid "%s:TDBComboBox - DataField not assigned"
|
msgid "%s:TDBComboBox - DataField not assigned"
|
||||||
msgstr "%s:TDBComboBox - Не присвоєно властивість DataField"
|
msgstr "%s:TDBComboBox - Не присвоєно властивість DataField"
|
||||||
@ -339,10 +337,6 @@ msgstr "Друк таблиці"
|
|||||||
msgid "Print options"
|
msgid "Print options"
|
||||||
msgstr "Налаштування друку"
|
msgstr "Налаштування друку"
|
||||||
|
|
||||||
#: rxdconst.spropdefbylookup
|
|
||||||
msgid "PropDefByLookup"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rxdconst.sregistration
|
#: rxdconst.sregistration
|
||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr "Реєстрація"
|
msgstr "Реєстрація"
|
||||||
|
@ -3191,7 +3191,6 @@ procedure TRxDBGrid.CollumnSortListUpdate;
|
|||||||
var
|
var
|
||||||
i, J:integer;
|
i, J:integer;
|
||||||
C:TRxColumn;
|
C:TRxColumn;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FSortColumns.Clear;
|
FSortColumns.Clear;
|
||||||
for i:=0 to Columns.Count - 1 do
|
for i:=0 to Columns.Count - 1 do
|
||||||
|
@ -87,9 +87,9 @@ resourcestring
|
|||||||
|
|
||||||
SDBComboBoxFieldNotAssigned = '%s:TDBComboBox - DataField not assigned';
|
SDBComboBoxFieldNotAssigned = '%s:TDBComboBox - DataField not assigned';
|
||||||
|
|
||||||
SPropDefByLookup = 'PropDefByLookup';
|
//SPropDefByLookup = 'PropDefByLookup';
|
||||||
SDataSourceFixed = 'SDataSourceFixed';
|
//SDataSourceFixed = 'SDataSourceFixed';
|
||||||
SCircularDataLink = 'SCircularDataLink';
|
SCircularDataLink = 'Circular data link';
|
||||||
sRxAscendign = 'Ascendign';
|
sRxAscendign = 'Ascendign';
|
||||||
sRxDescending = 'Descending';
|
sRxDescending = 'Descending';
|
||||||
sRxAllFields = 'All fields';
|
sRxAllFields = 'All fields';
|
||||||
|
@ -43,6 +43,16 @@ procedure GetFileOwnerData(const SearchDomain, FileName:String;out UserName, Dom
|
|||||||
function NormalizeDirectoryName(const DirName:string):string;
|
function NormalizeDirectoryName(const DirName:string):string;
|
||||||
function GetUserName:string;
|
function GetUserName:string;
|
||||||
|
|
||||||
|
function IsValidFileNameChar(const AChar: Char): Boolean;inline;
|
||||||
|
function NormalizeFileName(const FileName:string; AReplaceChar:char = '_'):string; //funtion only for filename - without folder name
|
||||||
|
|
||||||
|
const
|
||||||
|
{$IFDEF WINDOWS}
|
||||||
|
FileNameDisabledChars = [#0 .. #31, '"', '*', '/', ':', '<', '>', '?', '\' , '|'];
|
||||||
|
{$ELSE}
|
||||||
|
FileNameDisabledChars = [#0 .. #31, '/', '~'];
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -207,5 +217,20 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function IsValidFileNameChar(const AChar: Char): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=not (AChar in FileNameDisabledChars);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function NormalizeFileName(const FileName: string; AReplaceChar:char = '_'): string;
|
||||||
|
var
|
||||||
|
i:integer;
|
||||||
|
begin
|
||||||
|
Result:=FileName;
|
||||||
|
for i:=1 to Length(Result) do
|
||||||
|
if not IsValidFileNameChar(Result[i]) then
|
||||||
|
Result[i]:=AReplaceChar;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
<UnitName Value="rxFileUtils"/>
|
<UnitName Value="rxFileUtils"/>
|
||||||
</Item4>
|
</Item4>
|
||||||
</Files>
|
</Files>
|
||||||
|
<LazDoc Paths="docs;/usr/local/share/lazarus/components/rxnew/docs"/>
|
||||||
<RequiredPkgs Count="1">
|
<RequiredPkgs Count="1">
|
||||||
<Item1>
|
<Item1>
|
||||||
<PackageName Value="FCL"/>
|
<PackageName Value="FCL"/>
|
||||||
|
Reference in New Issue
Block a user