From fa498f379cfe89edae5218bcdd3e99bb3f484efb Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sun, 13 Nov 2011 12:05:03 -0500 Subject: [PATCH] libsaria: Added an is_visible() function This will return true if the given inode is visible. --- include/libsaria/library.h | 1 + libsaria/library/index.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/libsaria/library.h b/include/libsaria/library.h index f4bd3c45..41859dfa 100644 --- a/include/libsaria/library.h +++ b/include/libsaria/library.h @@ -33,6 +33,7 @@ namespace libsaria unsigned int size(); void filter(string &text); + bool is_visible(ino_t &); } } diff --git a/libsaria/library/index.cpp b/libsaria/library/index.cpp index 78fef13b..48e44848 100644 --- a/libsaria/library/index.cpp +++ b/libsaria/library/index.cpp @@ -167,4 +167,14 @@ namespace libsaria trigger_callback(REFILTER); } + bool library::is_visible(ino_t &inode) + { + set::iterator it; + + if (filtered == false) + return true; + it = results.find(inode); + return it != results.end(); + } + }; /* Namespace: libsaria */