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 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
UInt16 hour
Actual hour. (Between 0 and 23. 4 pm = 16.)
Definition: c4d_file.h:767
Filename GetFilename(void)
void GetFileTime(Int32 mode, LocalFileTime *out)
UInt16 minute
Actual minute. (Between 0 and 59.)
Definition: c4d_file.h:768
#define GE_FILETIME_CREATED
File time created.
Definition: c4d_file.h:880
Definition: string.h:1199
#define BROWSEFILES_CALCSIZE
Specifies if BrowseFiles::GetSize() can be called later on. Only works for files, not for folders.
Definition: c4d_file.h:888
return OK
Definition: apibase.h:2462
UInt16 month
Month. (Actual month, e.g. September = 9.)
Definition: c4d_file.h:765
#define iferr_return
Definition: resultbase.h:1419
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
UInt16 year
Year. (Actual year, e.g. 2005 A.D. = 2005.)
Definition: c4d_file.h:764
UInt16 second
Actual second. (Between 0 and 59.)
Definition: c4d_file.h:769
String GetFileString(void) const
void Init(const Filename &directory, Int32 flags)
UInt16 day
Day. (Actual day, e.g. 30 = 30.)
Definition: c4d_file.h:766
maxon::Int32 Int32
Definition: ge_sys_math.h:45
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:209
Definition: ge_autoptr.h:32
Represents a date time.
Definition: c4d_file.h:761