state-server: Initial implementation of /info/ RPC calls

Nothing is published yet, but data is successfully passed to the state server

+ usages of scheduler replaced with executor

Change-Id: I9da9182edc4efe8e896e2452ef4f9f0d98a03da1
diff --git a/src/file-state.h b/src/file-state.h
index 91bb3d2..6c4ace2 100644
--- a/src/file-state.h
+++ b/src/file-state.h
@@ -78,20 +78,28 @@
   LookupFilesForHash (const Hash &hash);
 
   /**
-   * @brief Lookup all files in the specified folder
+   * @brief Lookup all files in the specified folder and call visitor(file) for each file
    */
-  FileItemsPtr
-  LookupFilesInFolder (const std::string &folder);
+  void
+  LookupFilesInFolder (const boost::function<void (const FileItem&)> &visitor, const std::string &folder, int offset=0, int limit=-1);
 
   /**
-   * @brief Recursively lookup all files in the specified folder
+   * @brief Lookup all files in the specified folder (wrapper around the overloaded version)
    */
   FileItemsPtr
-  LookupFilesInFolderRecursively (const std::string &folder);
+  LookupFilesInFolder (const std::string &folder, int offset=0, int limit=-1);
 
-private:
-  static void
-  directory_name_xFun (sqlite3_context *context, int argc, sqlite3_value **argv);
+  /**
+   * @brief Recursively lookup all files in the specified folder and call visitor(file) for each file
+   */
+  FileItemsPtr
+  LookupFilesInFolderRecursively (const boost::function<void (const FileItem&)> &visitor, const std::string &folder, int offset=0, int limit=-1);
+
+  /**
+   * @brief Recursively lookup all files in the specified folder (wrapper around the overloaded version)
+   */
+  FileItemsPtr
+  LookupFilesInFolderRecursively (const std::string &folder, int offset=0, int limit=-1);
 };
 
 typedef boost::shared_ptr<FileState> FileStatePtr;