BrowseVolumes Manual

内容表

关于

The BrowseVolumes class provides means to iterate through the volumes/drives mounted in the system.

使用 BrowseVolumes class always follows the same concept:

// This example demonstrates browsing volumes with BrowseVolumes.
AutoAlloc<BrowseVolumes> browseVolumes; if (browseVolumes == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION );
browseVolumes-> Init (); ApplicationOutput ( "Available volumes:" _s); while (browseVolumes-> GetNext ()) // Note: GetNext() needs to be called at least once, to get the first element. { const Filename fn = browseVolumes-> GetFilename (); Int32 bvFlags = 0; const maxon::String volumeName = browseVolumes-> GetVolumeName (&bvFlags); if (bvFlags != BROWSEVOLUMES_VOLUME_NOT_AVAILABLE ) { UInt64 freecaller = 0, total = 0, freespace = 0; maxon::String freeText = "" _s; if ( GeFGetDiskFreeSpace (fn, freecaller, total, freespace)) { const maxon::String memoryFree = maxon::String::MemorySizeToString(freespace); const maxon::String memoryTotal = maxon::String::MemorySizeToString(total); const maxon::String memoryFreeForC4D = maxon::String::MemorySizeToString(freecaller); freeText = ": " _s + memoryFree + " of " _s + memoryTotal + " free, (" _s + memoryFreeForC4D + " available for C4D)" _s; } ApplicationOutput ( " @ (@)@" _s, maxon::String { fn. GetString () }, volumeName, freeText); } }

Allocation/Deallocation

BrowseVolumes objects are created with the usual tools, see Entity Creation and Destruction Manual (Classic) .

使用

Browsing

Volume Info

延伸阅读

BrowseVolumes::Init
void Init(void)
Initializes the class to browse volumes.
BrowseVolumes::GetFilename
Filename GetFilename(void)
maxon::String
定义: string.h:1197
Filename
Manages file and path names.
定义: c4d_file.h:93
MAXON_SOURCE_LOCATION
#define MAXON_SOURCE_LOCATION
定义: memoryallocationbase.h:66
GeFGetDiskFreeSpace
Bool GeFGetDiskFreeSpace(const Filename &vol, UInt64 &freecaller, UInt64 &total, UInt64 &freespace)
Filename::GetString
String GetString(void) const
BrowseVolumes::GetVolumeName
String GetVolumeName(Int32 *out_flags)
BrowseVolumes::GetNext
Bool GetNext(void)
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
ApplicationOutput
#define ApplicationOutput(formatString,...)
定义: debugdiagnostics.h:207
BROWSEVOLUMES_VOLUME_NOT_AVAILABLE
#define BROWSEVOLUMES_VOLUME_NOT_AVAILABLE
Volume not available.
定义: c4d_file.h:1006
AutoAlloc
定义: ge_autoptr.h:36
UInt64
maxon::UInt64 UInt64
定义: ge_sys_math.h:61

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1