Coverage report for Casbin.Core.Utilities.
Generated at 18/02/2019 12:10:19 by DelphiCodeCoverage - an open source tool for Delphi Code Coverage.
Statistics for Casbin.Core.Utilities.pas
| Number of lines covered | 2 |
| Number of lines with code gen | 2 |
| Line coverage | 100% |
| 1 | // Copyright 2018 by John Kouraklis and Contributors. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | unit Casbin.Core.Utilities; |
| 15 | |
| 16 | interface |
| 17 | |
| 18 | function findStartPos: Integer; |
| 19 | function findEndPos (const aLine: string): Integer; |
| 20 | |
| 21 | function version: string; |
| 22 | |
| 23 | implementation |
| 24 | |
| 25 | uses |
| 26 | System.SysUtils; |
| 27 | |
| 28 | {$I ..\Version.inc} |
| 29 | |
| 30 | function findStartPos: Integer; |
| 31 | begin |
| 32 | Result:=Low(string); |
| 33 | end; |
| 34 | |
| 35 | function findEndPos (const aLine: string): Integer; |
| 36 | begin |
| 37 | Result:=0; |
| 38 | if trim(aLine)<>'' then |
| 39 | if findStartPos=0 then |
| 40 | result:=Length(aLine)-1 |
| 41 | else |
| 42 | result:=Length(aLine); |
| 43 | end; |
| 44 | |
| 45 | |
| 46 | function version: string; |
| 47 | begin |
| 48 | result:=MajorVersion+'.'+MinorVersion+'.'+BugVersion; |
| 49 | if TypeVersion<>'' then |
| 50 | Result:=Result+' ('+TypeVersion+')' |
| 51 | end; |
| 52 | end. |