Changeset 25 for trunk/Library/ACLStringUtility.pas
- Timestamp:
- Aug 1, 2006, 8:51:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Library/ACLStringUtility.pas
r17 r25 284 284 Function BoolToStr( const b: boolean ): string; 285 285 286 // Return true if param matches the form287 // /Flag:value288 // dash (-) can be used instead of slash (/)289 // colon can be omitted290 function MatchValueParam( const Param: string;291 const Flag: string;292 var Value: string ): boolean;293 294 // Return true if param matches the form295 // /Flag296 // dash (-) can be used instead of slash (/)297 function MatchFlagParam( const Param: string;298 const Flag: string ): boolean;299 286 300 287 Implementation … … 1448 1435 end; 1449 1436 1450 // Return true if param matches the form1451 // /Flag:value1452 // dash (-) can be used instead of slash (/)1453 // colon can be omitted1454 function MatchValueParam( const Param: string;1455 const Flag: string;1456 var Value: string ): boolean;1457 begin1458 Result := false;1459 1460 if Param = '' then1461 exit;1462 1463 if ( Param[ 1 ] <> '/' )1464 and ( Param[ 1 ] <> '-' ) then1465 exit;1466 1467 if not StringsSame( Copy( Param, 2, Length( Flag ) ),1468 Flag ) then1469 exit;1470 1471 Result := true;1472 1473 Value := StrRightFrom( Param, 2 + Length( Flag ) );1474 if Value <> '' then1475 if Value[ 1 ] = ':' then1476 Delete( Value, 1, 1 );1477 end;1478 1479 // Return true if param matches the form1480 // /Flag1481 // dash (-) can be used instead of slash (/)1482 function MatchFlagParam( const Param: string;1483 const Flag: string ): boolean;1484 begin1485 Result := false;1486 1487 if Param = '' then1488 exit;1489 1490 if ( Param[ 1 ] <> '/' )1491 and ( Param[ 1 ] <> '-' ) then1492 exit;1493 1494 Result := StringsSame( StrRightFrom( Param, 2 ),1495 Flag );1496 end;1497 1498 1437 Initialization 1499 1438 InitHexDigitMap;
Note:
See TracChangeset
for help on using the changeset viewer.