/[svn]/linuxsampler/trunk/src/db/InstrumentsDbUtilities.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/db/InstrumentsDbUtilities.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1716 by persson, Thu Mar 6 20:42:22 2008 UTC revision 1717 by iliev, Sun Mar 16 17:43:20 2008 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2007 Grigor Iliev                                       *   *   Copyright (C) 2007, 2008 Grigor Iliev                                 *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 27  Line 27 
27  #include <vector>  #include <vector>
28  #include <gig.h>  #include <gig.h>
29  #include <sqlite3.h>  #include <sqlite3.h>
30  #include <sys/stat.h>  
31    #include "../common/File.h"
32    
33  namespace LinuxSampler {  namespace LinuxSampler {
34    
# Line 360  namespace LinuxSampler { Line 361  namespace LinuxSampler {
361                  int GetFileCount();                  int GetFileCount();
362      };      };
363            
364      class DirectoryScanner {      class DirectoryScanner: public File::DirectoryWalker {
365          public:          public:
366              /**              /**
367               * Recursively scans all subdirectories of the specified file               * Recursively scans all subdirectories of the specified file
# Line 368  namespace LinuxSampler { Line 369  namespace LinuxSampler {
369               * @param pProgress The progress used to monitor the scan process.               * @param pProgress The progress used to monitor the scan process.
370               * @throws Exception - if the specified directories are invalid.               * @throws Exception - if the specified directories are invalid.
371               */               */
372              static void Scan(String DbDir, String FsDir, bool Flat, ScanProgress* pProgress = NULL);             void Scan(String DbDir, String FsDir, bool Flat, ScanProgress* pProgress = NULL);
373    
374               virtual void DirectoryEntry(std::string Path);
375               virtual void FileEntry(std::string Path) { }
376    
377          private:          private:
378              static String DbDir;              String DbDir;
379              static String FsDir;              String FsDir;
380              static bool Flat;              bool Flat;
381              static ScanProgress* pProgress;              ScanProgress* pProgress;
382              static int FtwCallback(const char* fpath, const struct stat* sb, int typeflag);              bool HasInstrumentFiles(String Dir);
             static bool HasInstrumentFiles(String Dir);  
383      };      };
384            
385      class InstrumentFileCounter {      class InstrumentFileCounter: public File::DirectoryWalker {
386          public:          public:
387              /**              /**
388               * Recursively scans all subdirectories of the specified file               * Recursively scans all subdirectories of the specified file
# Line 387  namespace LinuxSampler { Line 390  namespace LinuxSampler {
390               * @param FsDir The file system directory to process.               * @param FsDir The file system directory to process.
391               * @throws Exception - if the specified directory is invalid.               * @throws Exception - if the specified directory is invalid.
392               */               */
393              static int Count(String FsDir);              int Count(String FsDir);
394    
395              static int FtwCallback(const char* fpath, const struct stat* sb, int typeflag);              virtual void DirectoryEntry(std::string Path) { }
396                virtual void FileEntry(std::string Path);
397    
398          private:          private:
399              static int FileCount;              int FileCount;
400      };      };
401                            
402  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.1716  
changed lines
  Added in v.1717

  ViewVC Help
Powered by ViewVC