1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "nel/misc/types_nl.h"
29 // Make directory even if not the whole path is not created
30 // Example : c:\temp is created and we call mkdir("c:\temp\aze\qsd")
31 // The function create c:\temp\aze and then c:\temp\aze\qsd
32 static void mkdir (const std::string
&FullDirName
);
34 // Change the directory. We can give directory relative to the current one
35 static void chdir (const std::string
&dirName
);
37 // Get the current directory
38 static std::string
pwd ();
40 // Convert a relative and not formated path to an absolute one
41 static std::string
normalizePath (const std::string
&path
);
43 // Return true if file exists
44 static bool fileExist (const std::string
&sFileName
);
46 // Return -1 if file1.date < file2.date (file1 is older than file2)
47 // Return 0 if file1.date = file2.date (file1 and file2 has the same date)
48 // Return 1 if file1.date > file2.date (file1 is newer than file2)
49 static int fileDateCmp (const std::string
&file1
, const std::string
&file2
);
51 // Return -1 if file1.date < (nDateLow+(nDateHigh<<32)) (file1 is older than nDate)
52 // Return 0 if file1.date = (nDateLow+(nDateHigh<<32)) (file1 and nDate has the same date)
53 // Return 1 if file1.date > (nDateLow+(nDateHigh<<32)) (file1 is newer than nDate)
54 static int fileDateCmp (const std::string
&file1
, uint32 nDateLow
, uint32 nDateHigh
);
56 // Return in sAllFiles all the files listed in the current directory
57 // bFullPath indicates if the returned names are fully qualified
58 static void dir (const std::string
&sFilter
, std::vector
<std::string
> &sAllFiles
, bool bFullPath
);
60 // Return in sAllFiles all the files listed in the current directory and subdirectories
61 // bFullPath indicates if the returned names are fully qualified
62 static void dirSub (const std::string
&sFilter
, std::vector
<std::string
> &sAllFiles
, bool bFullPath
);
65 static void copy (const std::string
&DstFile
, const std::string
&SrcFile
);
69 // Throw the last error
70 static void throwError (const char *message
);
73 static void dirSubRecurse (const std::string
&sFilter
, std::vector
<std::string
> &sAllFiles
, bool bFullPath
);