- 
					
						首页
					
				
 
				- 
					
						C4D R23.110 C++ SDK
					
				
 
			
			
				
				
				
					BrowseFiles Class Reference
				
			 
			
				
					
#include <c4d_file.h>
					
				
				
					详细描述
				
				
					Helper to browse through files.
				
				
					- 
						注意
					
 
					- 
						Has to be created with
						
							Alloc()
						
						and destroyed with
						
							Free()
						
						。使用
						
							AutoAlloc
						
						to automate the allocation and destruction based on scope.
					
 
				
			 
			
			
			
			
				构造函数 & 析构函数文档编制
			
			
				
					
						◆ 
					
				
				BrowseFiles()
			
			
		 
	
	
		
			
				◆ 
			
		
		~BrowseFiles()
	
	
	
		成员函数文档编制
	
	
		
			
				◆ 
			
		
		Alloc()
	
	
	
		Allocates a file browser. Destroy the allocated file browser with
		
			Free()
		
		。使用
		
			AutoAlloc
		
		to automate the allocation and destruction based on scope.
	
	
		- 
			返回
		
 
		- 
			The allocated file browser, or
			
				nullptr
			
			if the allocation failed.
		
 
	
	
		◆ 
	
Free()
Destructs file browsers allocated with
	Alloc()
。使用
	AutoAlloc
to automate the allocation and destruction based on scope.
- 
	参数
 
- 
	
		
			| 
				[in,out]
			 | 
			
				bf
			 | 
			
				The file browser to destruct. If the pointer is
				
					nullptr
				
				nothing happens. The pointer is assigned
				
					nullptr
				
				afterwards.
			 | 
		
	
 
◆ 
Init()
Initializes the class to browse a certain directory.
- 
参数
 
- 
	| 
		[in]
	 | 
	
		directory
	 | 
	
		The directory to browse.
	 | 
	| 
		[in]
	 | 
	
		flags
	 | 
	
		The browser files flags:
		
			BROWSEFILES
		
	 | 
 
◆ 
GetNext()
Gets the next file or subdirectory in the browsed directory.
- 
注意
 
- 
To retrieve the first file call
GetNext()
once. Example:
AutoAlloc<BrowseFiles>
bf;
if
(bf ==
nullptr
)
return
;
bf->
Init
(dir,
BROWSEFILES_CALCSIZE
);
while
(bf->
GetNext
())
{
GePrint
(bf->
GetFilename
().
GetString
());
}
 
- 
返回
 
- 
true
if another file was found, otherwise
false
.
 
◆ 
GetSize()
Gets the size for the current file.
- 
返回
 
- 
The byte size of the file.
 
- 
警告
 
- 
Not valid for directories.
 
◆ 
IsDir()
Checks if the current element is a directory.
- 
返回
 
- 
true
if the current element is a directory, otherwise
false
.
 
◆ 
IsHidden()
Checks if the current file or directory is hidden.
- 
返回
 
- 
true
if the current file is hidden, otherwise
false
.
 
◆ 
IsBundle()
Checks if the current file or directory is a bundle.
- 
返回
 
- 
true
if the current file is a bundle, otherwise
false
.
 
◆ 
IsReadOnly()
Checks if the current file or directory is read-only.
- 
返回
 
- 
true
if the current file is read-only, otherwise
false
.
 
◆ 
GetFileTime()
Gets a time for the current file or directory.
- 
参数
 
- 
| 
[in]
 | 
mode
 | 
The file time mode:
GE_FILETIME
 | 
| 
[out]
 | 
out
 | 
Filled with the retrieved file time. The caller owns the pointed file time.
 | 
 
◆ 
GetFilename()
Gets the name of the current file or directory.
- 
返回
 
- 
The name of the current file or directory.
 
Filename GetFilename(void)
 
#define BROWSEFILES_CALCSIZE
Specifies if BrowseFiles::GetSize() can be called later on. Only works for files, not for folders.
定义:
c4d_file.h:900
 
void GePrint(const maxon::String &str)
 
String GetString(void) const
 
void Init(const Filename &directory, Int32 flags)