diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-08-27 09:05:06 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-08-27 09:05:06 +0000 |
commit | 219d1cca814f8a6cbf67df6f7b48e31dfc5d9e57 (patch) | |
tree | 7163e055531728de02afa1d848070e228756444a /lib | |
parent | ce6beccb0639bd0ad769ba84c2b47d6c9f18dabe (diff) |
Add inline helpers to check whether a directory entry is a file,
directory, old or deleted.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backupclient/BackupStoreDirectory.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/backupclient/BackupStoreDirectory.h b/lib/backupclient/BackupStoreDirectory.h index 958eee81..0dfe6422 100644 --- a/lib/backupclient/BackupStoreDirectory.h +++ b/lib/backupclient/BackupStoreDirectory.h @@ -90,7 +90,24 @@ public: }; // characters for textual listing of files -- see bbackupquery/BackupQueries #define BACKUPSTOREDIRECTORY_ENTRY_FLAGS_DISPLAY_NAMES "fdXoR" - + + // convenience methods + bool inline IsDir() + { + return GetFlags() & Flags_Dir; + } + bool inline IsFile() + { + return GetFlags() & Flags_File; + } + bool inline IsOld() + { + return GetFlags() & Flags_OldVersion; + } + bool inline IsDeleted() + { + return GetFlags() & Flags_Deleted; + } bool inline MatchesFlags(int16_t FlagsMustBeSet, int16_t FlagsNotToBeSet) { return ((FlagsMustBeSet == Flags_INCLUDE_EVERYTHING) || ((mFlags & FlagsMustBeSet) == FlagsMustBeSet)) |