JosJuice
5ca3aee00a
FileUtil: Add a class for Exists/IsDirectory/GetSize
...
Some code was calling more than one of these functions in a row
(in particular, FileUtil.cpp itself did it a lot...), which is
a waste since it's possible to call stat a single time and then
read all three values from the stat struct. This commit adds a
File::FileInfo class that calls stat once on construction and
then lets Exists/IsDirectory/GetSize be executed very quickly.
The performance improvement mostly matters for functions that
can be handling a lot of files, such as File::ScanDirectoryTree.
I've also done some cleanup in code that uses these functions.
For instance, some code had checks like !Exists() || !IsDirectory(),
which is functionally equivalent to !IsDirectory(), and some
code was using File::GetSize even though there was an IOFile
object that the code could call GetSize on.
2017-06-29 19:07:29 +02:00
..
2017-06-18 23:38:42 -04:00
2017-06-18 23:38:42 -04:00
2017-03-04 16:39:50 +10:00
2017-01-05 12:55:13 +01:00
2017-06-07 20:09:44 -07:00
2017-05-26 00:53:58 -07:00
2016-06-24 10:43:46 +02:00
2016-06-24 10:43:46 +02:00
2017-04-18 21:55:22 +10:00
2017-04-18 21:55:22 +10:00
2017-01-23 16:05:32 -05:00
2017-01-23 16:07:03 -05:00
2017-04-18 21:55:22 +10:00
2016-01-17 20:11:45 -05:00
2017-06-13 00:41:51 -05:00
2017-01-27 19:04:56 +01:00
2017-01-27 19:04:56 +01:00
2017-04-04 09:52:18 -05:00
2016-06-24 10:43:46 +02:00
2017-01-05 12:55:13 +01:00
2017-03-03 17:18:18 -05:00
2016-06-24 12:16:10 +02:00
2016-06-24 10:43:46 +02:00
2017-05-03 19:33:56 -07:00
2017-05-03 19:33:56 -07:00
2017-06-25 20:47:30 -07:00
2017-03-26 23:08:33 -04:00
2016-06-24 10:43:46 +02:00
2016-06-24 10:43:46 +02:00
2017-03-09 23:39:48 +10:00
2017-03-09 23:39:48 +10:00
2017-02-01 12:19:55 -05:00
2017-02-01 12:19:55 -05:00
2016-12-10 17:33:51 -05:00
2016-06-26 12:34:59 +02:00
2017-06-18 12:57:05 -07:00
2017-06-23 17:25:53 -07:00
2017-06-13 00:41:56 -05:00
2017-06-15 21:34:04 +02:00
2016-10-08 12:02:49 +02:00
2017-06-07 19:52:07 -07:00
2016-06-24 10:43:46 +02:00
2017-02-01 12:19:55 -05:00
2017-02-01 01:06:00 -05:00
2016-06-24 10:43:46 +02:00
2017-06-03 18:13:02 +01:00
2016-06-26 16:13:19 +12:00
2016-10-15 12:44:37 +02:00
2016-10-15 12:44:37 +02:00
2017-01-27 19:04:56 +01:00
2017-02-08 00:05:17 -05:00
2016-06-24 10:43:46 +02:00
2016-06-24 10:43:46 +02:00
2017-01-27 07:49:47 +01:00
2017-02-28 07:01:50 -05:00
2017-05-03 19:33:56 -07:00
2017-01-04 20:02:31 +01:00
2017-03-04 16:53:07 +10:00
2017-03-04 16:53:07 +10:00
2017-06-23 17:25:53 -07:00
2017-04-25 14:27:05 +10:00
2017-06-05 20:03:56 -07:00
2017-04-24 00:39:25 -07:00
2017-04-18 21:55:23 +10:00
2017-04-18 21:55:23 +10:00
2016-06-24 10:43:46 +02:00
2017-04-04 09:52:18 -05:00
2017-03-26 23:50:09 -04:00
2016-06-24 10:43:46 +02:00
2017-06-29 19:07:29 +02:00
2017-06-13 00:41:56 -05:00
2017-06-13 00:41:51 -05:00
2017-06-13 00:41:56 -05:00
2017-06-17 12:17:09 +10:00
2017-04-12 00:11:22 +10:00
2017-03-03 17:18:18 -05:00
2017-03-03 17:18:18 -05:00
2017-01-15 20:23:26 +11:00
2017-03-13 14:28:01 +01:00
2017-04-12 00:11:22 +10:00
2017-03-03 17:18:18 -05:00
2016-01-17 20:11:45 -05:00
2017-03-03 17:18:18 -05:00
2017-03-03 17:18:18 -05:00
2017-03-03 17:18:18 -05:00
2017-03-03 17:18:18 -05:00
2017-03-03 17:18:18 -05:00
2017-03-03 17:18:18 -05:00
2016-09-17 16:47:12 +02:00
2016-06-24 10:43:46 +02:00
2016-09-27 18:45:14 +02:00
2016-06-24 10:43:46 +02:00
2017-03-26 23:49:59 -04:00
2017-06-07 19:52:07 -07:00
2017-05-18 17:01:12 -07:00
2017-03-26 23:50:09 -04:00
2016-06-24 10:43:46 +02:00
2017-05-20 09:35:53 +02:00
2016-06-24 10:43:46 +02:00
2017-04-05 17:23:16 -07:00
2017-04-05 17:23:16 -07:00
2017-04-05 17:23:16 -07:00
2017-04-04 09:52:18 -05:00
2017-06-15 16:38:10 +01:00
2017-06-15 16:38:10 +01:00
2017-05-18 17:01:12 -07:00
2017-01-27 19:04:56 +01:00
2017-06-13 00:41:56 -05:00
2017-06-13 00:41:51 -05:00
2017-06-18 22:58:02 -04:00
2017-06-15 16:38:10 +01:00
2017-06-15 16:38:10 +01:00
2016-08-21 23:30:38 -04:00
2016-06-26 12:34:59 +02:00
2016-01-17 20:11:45 -05:00
2017-01-05 12:55:13 +01:00
2017-03-26 23:09:30 -04:00