Audacity  2.2.2
Classes | Macros | Typedefs | Enumerations | Functions
DirManager.h File Reference
#include "MemoryX.h"
#include <wx/list.h>
#include <wx/string.h>
#include <wx/filename.h>
#include <wx/hashmap.h>
#include <wx/utils.h>
#include "audacity/Types.h"
#include "xml/XMLTagHandler.h"
#include "wxFileNameWrapper.h"
#include <unordered_map>

Go to the source code of this file.

Classes

class  DirManager
 Creates and manages BlockFile objects. More...
 
struct  DirManager::BalanceInfo
 

Macros

#define FSCKstatus_CLOSE_REQ   0x1
 
#define FSCKstatus_CHANGED   0x2
 
#define FSCKstatus_SAVE_AUP   0x4
 

Typedefs

using DirHash = std::unordered_map< int, int >
 
using BlockFilePtr = std::shared_ptr< BlockFile >
 
using BlockHash = std::unordered_map< wxString, std::weak_ptr< BlockFile > >
 

Enumerations

enum  { kCleanTopDirToo = 1, kCleanDirsOnlyIfEmpty = 2, kCleanFiles = 4, kCleanDirs = 8 }
 

Functions

wxMemorySize GetFreeMemory ()
 

Macro Definition Documentation

#define FSCKstatus_CHANGED   0x2

Definition at line 34 of file DirManager.h.

Referenced by AudacityProject::OpenFile(), and DirManager::ProjectFSCK().

#define FSCKstatus_CLOSE_REQ   0x1

Definition at line 33 of file DirManager.h.

Referenced by AudacityProject::OpenFile(), and DirManager::ProjectFSCK().

#define FSCKstatus_SAVE_AUP   0x4

Definition at line 35 of file DirManager.h.

Referenced by AudacityProject::OpenFile(), and DirManager::ProjectFSCK().

Typedef Documentation

using BlockFilePtr = std::shared_ptr<BlockFile>

Definition at line 40 of file DirManager.h.

using BlockHash = std::unordered_map< wxString, std::weak_ptr<BlockFile> >

Definition at line 42 of file DirManager.h.

using DirHash = std::unordered_map<int, int>

Definition at line 37 of file DirManager.h.

Enumeration Type Documentation

anonymous enum
Enumerator
kCleanTopDirToo 
kCleanDirsOnlyIfEmpty 
kCleanFiles 
kCleanDirs 

Definition at line 46 of file DirManager.h.

46  {
47  kCleanTopDirToo = 1, // The top directory can be excluded from clean.
48  kCleanDirsOnlyIfEmpty = 2, // Otherwise non empty dirs may be removed.
49  kCleanFiles = 4, // Remove files
50  kCleanDirs = 8 // Remove dirs.
51 };

Function Documentation

wxMemorySize GetFreeMemory ( )

Definition at line 120 of file DirManager.cpp.

Referenced by DirManager::FillBlockfilesCache(), and SimpleBlockFile::GetCache().

121 {
122  wxMemorySize avail;
123 
124 #if defined(__WXMAC__)
125  mach_port_t port = mach_host_self();
126  mach_msg_type_number_t cnt = HOST_VM_INFO_COUNT;
127  vm_statistics_data_t stats;
128  vm_size_t pagesize = 0;
129 
130  memset(&stats, 0, sizeof(stats));
131 
132  host_page_size(port, &pagesize);
133  host_statistics(port, HOST_VM_INFO, (host_info_t) &stats, &cnt);
134  avail = stats.free_count * pagesize;
135 #else
136  avail = wxGetFreeMemory();
137 #endif
138 
139  return avail;
140 }