| trunk/Source/ShineOn.RTL/SysUtils.pas |
| 128 | 128 | class function TimeToStr(ATime:TDateTime):String; |
| 129 | 129 | class procedure FreeAndNil(var Obj); |
| 130 | 130 | |
| 131 | class function BytesOf(S: String): TBytes; |
| 132 | class function StringOf(B: TBytes): String; |
| 133 | |
| 131 | 134 | class function FileAge(const FileName: String; out FileDateTime: TDateTime): Boolean; |
| 132 | 135 | class function FileCreate(const FileName: String): TOpenedFile; |
| 133 | 136 | class function FileExists(FileName: String): Boolean; |
| ... | ... | |
| 321 | 324 | function PathSep: Char; public; |
| 322 | 325 | function PathSeparator: Char; public; |
| 323 | 326 | |
| 327 | function BytesOf(S: String): TBytes; public; |
| 328 | function StringOf(B: TBytes): String; public; |
| 329 | |
| 324 | 330 | function FloatToStr(Value: Extended): String; public; |
| 325 | 331 | function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision, Digits: Integer): String; public; |
| 326 | 332 | function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision, Digits: Integer; const FormatSettings: TFormatSettings ): String; public; |
| ... | ... | |
| 1539 | 1545 | NotImplemented; |
| 1540 | 1546 | end; |
| 1541 | 1547 | |
| 1548 | class function SysUtils.BytesOf(S: String): TBytes; |
| 1549 | begin |
| 1550 | Result := TEncoding.Unicode.GetBytes(S); |
| 1551 | end; |
| 1552 | |
| 1553 | class function SysUtils.StringOf(B: TBytes): String; |
| 1554 | begin |
| 1555 | Result := TEncoding.Unicode.GetString(B); |
| 1556 | end; |
| 1557 | |
| 1542 | 1558 | // DELPHI COMPATIBLE GLOBAL METHODS |
| 1543 | 1559 | |
| 1560 | function BytesOf(S: String): TBytes; |
| 1561 | begin |
| 1562 | Result := ShineOn.Rtl.SysUtils.BytesOf(S); |
| 1563 | end; |
| 1564 | |
| 1565 | function StringOf(B: TBytes): String; |
| 1566 | begin |
| 1567 | Result := ShineOn.Rtl.SysUtils.StringOf(B); |
| 1568 | end; |
| 1569 | |
| 1544 | 1570 | function FloatToStr(Value: Extended): String; |
| 1545 | 1571 | begin |
| 1546 | 1572 | result := ShineOn.Rtl.SysUtils.FloatToStr(Value); |