About
The BrowseFiles class provides means to iterate through the content of a directory.
Using the BrowseFiles class always follows the same concept:
- Note
- For browsing files with the MAXON API ALIASES see Url Manual.
if (bf == nullptr)
bf->
Init(folderName, bfFlags);
{
maxon::String sIsBundle =
"_"_s, sIsHidden =
"_"_s, sIsReadOnly =
"_"_s, sIsDir =
"_"_s;
sIsBundle = "b"_s;
sIsHidden = "h"_s;
sIsReadOnly = "r"_s;
sIsDir = "d"_s;
else
sSize = maxon::String::MemorySizeToString(bf->
GetSize());
sTimeCreated = maxon::String::IntToString(timeCreated.
year);
sTimeCreated +=
"-"_s + maxon::String::IntToString(timeCreated.
month);
sTimeCreated +=
"-"_s + maxon::String::IntToString(timeCreated.
day);
sTimeCreated +=
" "_s + maxon::String::IntToString(timeCreated.
hour);
sTimeCreated +=
":"_s + maxon::String::IntToString(timeCreated.
minute);
sTimeCreated +=
":"_s + maxon::String::IntToString(timeCreated.
second);
ApplicationOutput(
"[@ @ @ @] - @ - @ - @ - @"_s, sIsDir, sIsBundle, sIsHidden, sIsReadOnly, sSize, sTimeCreated, sAttr, fileName);
}
Allocation/Deallocation
BrowseFiles objects are created with the usual tools, see Entity Creation and Destruction Manual (Classic).
Use
Browse
- Note
- BrowseFiles::GetNext() needs to be called at least once, in order to get the first element and for the following "File Info" functions to work.
File Info
Further Reading
@ DIRECTORY
Folder selection dialog.
UInt16 hour
Actual hour. (Between 0 and 23. 4 pm = 16.)
Definition: c4d_file.h:794
Filename GetFilename(void)
void GetFileTime(Int32 mode, LocalFileTime *out)
UInt16 minute
Actual minute. (Between 0 and 59.)
Definition: c4d_file.h:795
#define GE_FILETIME_CREATED
File time created.
Definition: c4d_file.h:907
Definition: string.h:1225
#define BROWSEFILES_CALCSIZE
Specifies if BrowseFiles::GetSize() can be called later on. Only works for files, not for folders.
Definition: c4d_file.h:915
return OK
Definition: apibase.h:2620
UInt16 month
Month. (Actual month, e.g. September = 9.)
Definition: c4d_file.h:792
#define iferr_return
Definition: resultbase.h:1465
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
UInt16 year
Year. (Actual year, e.g. 2005 A.D. = 2005.)
Definition: c4d_file.h:791
UInt16 second
Actual second. (Between 0 and 59.)
Definition: c4d_file.h:796
String GetFileString(void) const
void Init(const Filename &directory, Int32 flags)
UInt16 day
Day. (Actual day, e.g. 30 = 30.)
Definition: c4d_file.h:793
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
Definition: ge_autoptr.h:36
Represents a date time.
Definition: c4d_file.h:788