BrowseFiles Class Reference

#include <c4d_browsefiles.h>

Public Member Functions

 BrowseFiles ()
 
 ~BrowseFiles ()
 
void Init (const Filename &directory, Int32 flags)
 
Bool GetNext ()
 
Int64 GetSize ()
 
Bool IsDir ()
 
Bool IsHidden ()
 
Bool IsBundle ()
 
Bool IsReadOnly ()
 
void GetFileTime (Int32 mode, LocalFileTime *out)
 
Filename GetFilename ()
 
Filename GetFilePath ()
 

Private Attributes

SysBrowseFiles * uncached
 

Detailed Description

Helper to browse through files.

Since
R19

Constructor & Destructor Documentation

◆ BrowseFiles()

◆ ~BrowseFiles()

Member Function Documentation

◆ Init()

void Init ( const Filename directory,
Int32  flags 
)

Initializes the class to browse a certain directory.

Parameters
[in]directoryThe directory to browse.
[in]flagsThe browser files flags: BROWSEFILES

◆ GetNext()

Bool GetNext ( )

Gets the next file or subdirectory in the browsed directory.

Note
To retrieve the first file call GetNext() once. Example: BrowseFiles *bf = AllocBrowseFiles(dir, false); if (bf) { while (bf->GetNext()) { GePrint(bf->GetFilename().GetString()); } FreeBrowseFiles(bf); }
Returns
true if another file was found, otherwise false.

◆ GetSize()

Int64 GetSize ( )

Gets the size for the current file.

Returns
The byte size of the file.
Warning
Not valid for directories.

◆ IsDir()

Bool IsDir ( )

Checks if the current element is a directory.

Returns
true if the current element is a directory, otherwise false.

◆ IsHidden()

Bool IsHidden ( )

Checks if the current file or directory is hidden.

Returns
true if the current file is hidden, otherwise false.

◆ IsBundle()

Bool IsBundle ( )

Checks if the current file or directory is a bundle.

Returns
true if the current file is a bundle, otherwise false.

◆ IsReadOnly()

Bool IsReadOnly ( )

Checks if the current file or directory is read-only.

Returns
true if the current file is read-only, otherwise false.

◆ GetFileTime()

void GetFileTime ( Int32  mode,
LocalFileTime out 
)

Gets a time for the current file or directory.

Parameters
[in]modeThe file time mode: GE_FILETIME
[out]outFilled with the retrieved file time. The caller owns the pointed file time.

◆ GetFilename()

Filename GetFilename ( )

Gets the name of the current file or directory.

Returns
The name of the current file or directory.

◆ GetFilePath()

Filename GetFilePath ( )

Gets the name of the current file path or directory.

Returns
The path of the current file or directory.

Member Data Documentation

◆ uncached

SysBrowseFiles* uncached
private