1 #include <vector> 2 #include <algorithm> 3 #include <rtl/ustring.hxx> 4 #include <tools/string.hxx> 5 6 #ifdef WNT 7 #else 8 #include <dirent.h> 9 #include <unistd.h> 10 #include <sys/stat.h> 11 #endif 12 13 #include <stdio.h> 14 15 #ifndef L10NTOOLS_FILE_HXX 16 #define L10NTOOLS_FILE_HXX 17 #include <l10ntools/file.hxx> 18 #endif 19 20 namespace transex{ 21 22 class Directory 23 { 24 private: 25 rtl::OUString sDirectoryName; 26 rtl::OUString sFullName; 27 bool bSkipLinks; 28 29 std::vector<Directory> aDirVec; 30 std::vector<File> aFileVec; 31 32 public: 33 std::vector<Directory> getSubDirectories() { return aDirVec; } 34 std::vector<File> getFiles() { return aFileVec; } 35 36 void readDirectory(); 37 void readDirectory( const rtl::OUString& sFullpath ); 38 void scanSubDir( int nLevels = 0 ); 39 40 rtl::OUString getDirectoryName() { return sDirectoryName; } 41 rtl::OUString getFullName() { return sFullName ; } 42 void setSkipLinks( bool is_skipped ); 43 44 void dump(); 45 Directory(){}; 46 47 Directory( const rtl::OUString sFullPath ); 48 Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) ; 49 Directory( const ByteString sFullPath ); 50 51 static bool lessDir ( const Directory& rKey1, const Directory& rKey2 ) ; 52 }; 53 54 } 55