About
The BrowseVolumes class provides means to iterate through the volumes/drives mounted in the system.
Using the BrowseVolumes class always follows the same concept:
- Allocate a BrowseVolumes instance.
 
- Initializes the BrowseVolumes instance via BrowseVolumes::Init().
 
- Call BrowseVolumes::GetNext() at least once (but most likely in a loop) to get the first/next element (if any).
 
- Use the below mentioned volume info functions on each element.
 
  
 
  AutoAlloc<BrowseVolumes> browseVolumes;
  if (browseVolumes == nullptr)
 
  browseVolumes->Init();
 
  while (browseVolumes->GetNext())  
  {
    const Filename fn = browseVolumes->GetFilename();
    const maxon::String volumeName = browseVolumes->GetVolumeName(&bvFlags);
 
 
    {
      UInt64        freecaller = 0, total = 0, freespace = 0;
 
 
      {
        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;
      }
 
    }
  }
Definition: string.h:1287
 
#define BROWSEVOLUMES_VOLUME_NOT_AVAILABLE
Volume not available.
Definition: c4d_file.h:1019
 
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
 
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
 
Bool GeFGetDiskFreeSpace(const Filename &vol, UInt64 &freecaller, UInt64 &total, UInt64 &freespace)
 
maxon::UInt64 UInt64
Definition: ge_sys_math.h:54
 
maxon::Int32 Int32
Definition: ge_sys_math.h:51
 
Allocation/Deallocation
BrowseVolumes objects are created with the usual tools, see Entity Creation and Destruction Manual (Cinema API).
- BrowseVolumes::Alloc(): Allocates a BrowseVolumes instance.
 
- BrowseVolumes::Free(): Destroys a BrowseVolumes instance.
 
Use
Browsing
- BrowseVolumes::Init(): Initializes the class to browse volumes.
 
- BrowseVolumes::GetNext(): Gets the first or next volume.
 
Volume Info
- BrowseVolumes::GetFilename(): Gets the Filename of the current volume.
 
- BrowseVolumes::GetVolumeName(): Gets the current volume name.
 
Further Reading