@@ -45,8 +45,8 @@ SOFTWARE.
4545#include < sstream>
4646#include < vector>
4747
48- // On iOS < 13.0 we use 'dirent' instead of std::filesystem, since std::filesystem
49- // becomes available only from iOS 13.0.
48+ // On iOS < 13.0 we use 'dirent' instead of std::filesystem, since
49+ // std::filesystem becomes available only from iOS 13.0.
5050#if CFG_OS_NAME != CFG_OS_NAME_IOS || CFG_OS_IOS_DEPLOYMENT_TARGET >= 130000
5151# include < filesystem>
5252#endif
@@ -128,8 +128,7 @@ size_t native_file::seek_backward_internal(size_t num_bytes_to_seek) const
128128{
129129 ASSERT (this ->handle )
130130
131- // NOTE: fseek() accepts 'long int' as offset argument which is signed and can
132- // be
131+ // NOTE: fseek() accepts 'long int' as offset argument which is signed and can be
133132 // less than size_t value passed as argument to this function.
134133 // Therefore, do several seek operations with smaller offset if
135134 // necessary.
@@ -230,8 +229,8 @@ void native_file::make_dir()
230229 throw std::invalid_argument (" invalid directory name, should end with '/'" );
231230 }
232231
233- // On iOS the std::filesystem is available only starting from iOS 13.0, so for iOS < 13.0 we do not support directory
234- // creation.
232+ // On iOS the std::filesystem is available only starting from iOS 13.0, so for
233+ // iOS < 13.0 we do not support directory creation.
235234#if (CFG_OS == CFG_OS_LINUX || CFG_OS == CFG_OS_MACOSX || CFG_OS == CFG_OS_WINDOWS) && \
236235 (CFG_OS_NAME != CFG_OS_NAME_IOS || CFG_OS_IOS_DEPLOYMENT_TARGET >= 130000 )
237236 std::filesystem::create_directories (this ->path ());
@@ -295,9 +294,9 @@ std::vector<std::string> native_file::list_dir(size_t max_size) const
295294 std::vector<std::string> files;
296295
297296// For all systems except iOS < 13.0 we use new implementation via std::filesystem.
298- // On iOS the std::filesystem is available only starting from iOS 13.0 while it
299- // is still desired to support iOS 11.0 at least, so for iOS < 13.0 we fall back to old
300- // implementation via 'dirent.h'.
297+ // On iOS the std::filesystem is available only starting from iOS 13.0,
298+ // while it is still desired to support iOS 11.0 at least, so for iOS < 13.0
299+ // we fall back to old implementation via 'dirent.h'.
301300#if CFG_OS_NAME != CFG_OS_NAME_IOS || CFG_OS_IOS_DEPLOYMENT_TARGET >= 130000
302301 std::filesystem::directory_iterator iter (this ->path ());
303302
@@ -400,8 +399,10 @@ std::vector<std::string> native_file::list_dir(size_t max_size) const
400399 errno = 0 ;
401400 while (dirent* pent = readdir (pdir)) {
402401 std::string s (pent->d_name );
403- if (s == " ." || s == " .." )
404- continue ; // do not add ./ and ../ directories, we are not interested in them
402+ if (s == " ." || s == " .." ) {
403+ // do not add ./ and ../ directories, we are not interested in them
404+ continue ;
405+ }
405406
406407 struct stat fileStats;
407408 if (stat ((this ->path () + s).c_str (), &fileStats) < 0 ) {
@@ -410,8 +411,10 @@ std::vector<std::string> native_file::list_dir(size_t max_size) const
410411 throw std::system_error (errno, std::system_category (), ss.str ());
411412 }
412413
413- if (fileStats.st_mode & S_IFDIR) // if this entry is a directory append '/' symbol to its end
414+ if (fileStats.st_mode & S_IFDIR) {
415+ // if this entry is a directory append '/' symbol to its end
414416 s += " /" ;
417+ }
415418
416419 files.push_back (s);
417420
0 commit comments