RxFPC:new function - RxPrettySizeName

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7022 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2019-07-03 08:34:10 +00:00
parent 2fd5a598d4
commit 5c9b5a4f9f
6 changed files with 107 additions and 2 deletions

View File

@ -203,10 +203,22 @@ msgstr ""
msgid "Error. Expected value for field %s."
msgstr ""
#: rxconst.srxbyte
msgid "B"
msgstr ""
#: rxconst.srxcloseformvalidatoreditor
msgid "Rx close form validator editor"
msgstr ""
#: rxconst.srxgigabyte
msgid "GB"
msgstr ""
#: rxconst.srxkilobyte
msgid "KB"
msgstr ""
#: rxconst.srxlogindlgbtnmore
msgid "More >>"
msgstr ""
@ -215,10 +227,18 @@ msgstr ""
msgid "Database"
msgstr ""
#: rxconst.srxmegabyte
msgid "MB"
msgstr ""
#: rxconst.srxstrholdertexteditor
msgid "Rx string holder editor"
msgstr ""
#: rxconst.srxterrabyte
msgid "TB"
msgstr ""
#: rxconst.srxtextfolderitem
msgid "Item "
msgstr ""

View File

@ -211,10 +211,22 @@ msgstr ""
msgid "Error. Expected value for field %s."
msgstr "Błąd. Spodziewano wartości dla pola %s."
#: rxconst.srxbyte
msgid "B"
msgstr ""
#: rxconst.srxcloseformvalidatoreditor
msgid "Rx close form validator editor"
msgstr ""
#: rxconst.srxgigabyte
msgid "GB"
msgstr ""
#: rxconst.srxkilobyte
msgid "KB"
msgstr ""
#: rxconst.srxlogindlgbtnmore
msgid "More >>"
msgstr "Więcej >>"
@ -223,10 +235,18 @@ msgstr "Więcej >>"
msgid "Database"
msgstr "Baza danych"
#: rxconst.srxmegabyte
msgid "MB"
msgstr ""
#: rxconst.srxstrholdertexteditor
msgid "Rx string holder editor"
msgstr ""
#: rxconst.srxterrabyte
msgid "TB"
msgstr ""
#: rxconst.srxtextfolderitem
msgid "Item "
msgstr ""

View File

@ -211,10 +211,22 @@ msgstr "Вопрос"
msgid "Error. Expected value for field %s."
msgstr "Поле %s. Требуется значение"
#: rxconst.srxbyte
msgid "B"
msgstr ""
#: rxconst.srxcloseformvalidatoreditor
msgid "Rx close form validator editor"
msgstr "Редактор RxCloseFormValidator"
#: rxconst.srxgigabyte
msgid "GB"
msgstr ""
#: rxconst.srxkilobyte
msgid "KB"
msgstr ""
#: rxconst.srxlogindlgbtnmore
msgid "More >>"
msgstr "Больше >>"
@ -223,10 +235,18 @@ msgstr "Больше >>"
msgid "Database"
msgstr "База данных"
#: rxconst.srxmegabyte
msgid "MB"
msgstr ""
#: rxconst.srxstrholdertexteditor
msgid "Rx string holder editor"
msgstr "Редактор RxStrHolder"
#: rxconst.srxterrabyte
msgid "TB"
msgstr ""
#: rxconst.srxtextfolderitem
msgid "Item "
msgstr "Строка "

View File

@ -215,10 +215,22 @@ msgstr ""
msgid "Error. Expected value for field %s."
msgstr "Поле %s. Вимагається значення"
#: rxconst.srxbyte
msgid "B"
msgstr ""
#: rxconst.srxcloseformvalidatoreditor
msgid "Rx close form validator editor"
msgstr ""
#: rxconst.srxgigabyte
msgid "GB"
msgstr ""
#: rxconst.srxkilobyte
msgid "KB"
msgstr ""
#: rxconst.srxlogindlgbtnmore
msgid "More >>"
msgstr ""
@ -227,10 +239,18 @@ msgstr ""
msgid "Database"
msgstr ""
#: rxconst.srxmegabyte
msgid "MB"
msgstr ""
#: rxconst.srxstrholdertexteditor
msgid "Rx string holder editor"
msgstr ""
#: rxconst.srxterrabyte
msgid "TB"
msgstr ""
#: rxconst.srxtextfolderitem
msgid "Item "
msgstr ""

View File

@ -157,6 +157,12 @@ resourcestring
sPressTheKey = 'Press the key';
sShortCut = 'ShortCut';
{ Pretty names for Size}
sRxTerraByte = 'TB';
sRxGigaByte = 'GB';
sRxMegaByte = 'MB';
sRxKiloByte = 'KB';
sRxByte = 'B';
implementation
end.

View File

@ -233,16 +233,18 @@ function RomanToInt(const S: string): Longint; deprecated; //use this function f
procedure StrToStrings(const S:string; const List:TStrings; const Delims:Char);
function FileToString(const AFileName:string):string;
function RxPrettySizeName(ASize:Int64):string;
const
DigitChars = ['0'..'9'];
Brackets = ['(',')','[',']','{','}'];
StdWordDelims = [#0..' ',',','.',';','/','\',':','''','"','`'] + Brackets;
implementation
uses
{$IFDEF WINDOWS}
uses Windows;
Windows,
{$ENDIF}
rxconst;
function StrToOem(const AnsiStr: string): string;
begin
@ -1149,4 +1151,21 @@ begin
Result:='';
end;
function RxPrettySizeName(ASize: Int64): string;
begin
if ASize div (1024 * 1024 * 1024 * 1024) > 0 then
Result := IntToStr(ASize div (1024 * 1024 * 1024 * 1024)) + ' ' +sRxTerraByte
else
if ASize div (1024 * 1024 * 1024) > 0 then
Result := IntToStr(ASize div (1024 * 1024 * 1024)) + ' ' +sRxGigaByte
else
if ASize div (1024 * 1024) > 0 then
Result := IntToStr(ASize div (1024 * 1024)) + ' ' +sRxMegaByte
else
if ASize div 1024 > 0 then
Result := IntToStr(ASize div (1024)) + ' ' +sRxKiloByte
else
Result := IntToStr(ASize div (1024)) + ' ' +sRxByte;
end;
end.