summaryrefslogtreecommitdiff
path: root/src/corelib/fpg_utils.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-14 11:14:52 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-23 16:24:33 +0200
commit7a2fa68530e488744b01cdf6bafb864786bb006d (patch)
treec791dd66645b5a6f3f194b359336a0dbbbead24c /src/corelib/fpg_utils.pas
parent7cf4dbd72681220a03eddef9feb6792f757c4648 (diff)
downloadfpGUI-7a2fa68530e488744b01cdf6bafb864786bb006d.tar.xz
adds new utility function fpgIsBitSet() to check if a specific Bit is set in a value.
Diffstat (limited to 'src/corelib/fpg_utils.pas')
-rw-r--r--src/corelib/fpg_utils.pas6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas
index 8e866922..a0509304 100644
--- a/src/corelib/fpg_utils.pas
+++ b/src/corelib/fpg_utils.pas
@@ -45,6 +45,7 @@ function fpgGetToolkitConfigDir: TfpgString;
{ This is so that when we support LTR and RTL languages, the colon will be
added at the correct place. }
function fpgAddColon(const AText: TfpgString): TfpgString;
+function fpgIsBitSet(const AData: integer; const AIndex: integer): boolean;
// RTL wrapper filesystem functions with platform independant encoding
@@ -261,6 +262,11 @@ begin
Result := AText + ':';
end;
+function fpgIsBitSet(const AData: integer; const AIndex: integer): boolean;
+begin
+ Result := (AData and (1 shl AIndex) <> 0);
+end;
+
end.