FileMgt.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @file FileMgt.h
  3. * @brief Misc file management utilities
  4. * @author Erik Rodner
  5. * @date 10/26/2007
  6. */
  7. #ifndef FILEMGTINCLUDE
  8. #define FILEMGTINCLUDE
  9. #include <vector>
  10. #include <string>
  11. namespace NICE {
  12. /** @brief Misc file management utilities */
  13. class FileMgt
  14. {
  15. protected:
  16. public:
  17. /** collect all files in a directory (including all subdirectories
  18. @param files resulting list of files
  19. @param dir input directory
  20. */
  21. static void DirectoryRecursive ( std::vector<std::string> & files, const std::string & dir );
  22. /** create a temporary file using a template prefix
  23. @param templatefn template prefix of the temporary filename
  24. @return generated temporary filename
  25. */
  26. static std::string createTempFile ( const std::string & templatefn );
  27. /** delete a temporary filename
  28. @param tempfile name of the file which will be deleted
  29. */
  30. static void deleteTempFile ( const std::string & tempfile );
  31. /** returns true if a file exists
  32. @param file input filename
  33. @return true if the file exists
  34. */
  35. static bool fileExists ( const std::string & file );
  36. };
  37. } // namespace
  38. #endif