top | up | prev | next

DirectoryIterationTable Class

Definition at line 24 of Directory.cpp

Constructors

DirectoryIterationTable()

Member Functions

int32_t BeginIterate(const char* directoryPath)
void Done() static
void EndIterate(int32_t handle)
void Init() static
DirectoryIterationTable& Instance() static
const char* IterateDirectories(int32_t handle)
const char* IterateFiles(int32_t handle)

Member Variables

std::unique_ptr<DirectoryIterationTable> instance static
std::unordered_map<int32_t, Iteration> iterationMap
std::mutex mtx
int32_t nextIterationHandle

Constructor Details

DirectoryIterationTable Constructor

cmajor::rt::DirectoryIterationTable::DirectoryIterationTable()

Definition at line 54 of Directory.cpp :
 54 : nextIterationHandle(0)
 55 {
 56 }


Declaration at line 36 of Directory.cpp


Member Function Details

BeginIterate Member Function

int32_t cmajor::rt::DirectoryIterationTable::BeginIterate(const char * directoryPath)

Definition at line 58 of Directory.cpp :
 59 {
 60     std::lock_guard<std::mutex> lock(mtx);
 61     int32_t handle = nextIterationHandle++;
 62     Iteration iteration;
 63     iteration.directoryName = GetFullPath(Path::MakeCanonical(directoryPath));
 64     iteration.directoryIterator = boost::filesystem::directory_iterator(iteration.directoryName);
 65     iterationMap[handle] = iteration;
 66     return handle;
 67 }


Declaration at line 30 of Directory.cpp

Calls: soulng::util::Path::MakeCanonical


Done Member Function

void cmajor::rt::DirectoryIterationTable::Done() static

Definition at line 49 of Directory.cpp :
 50 {
 51     instance.reset();
 52 }


Declaration at line 28 of Directory.cpp


EndIterate Member Function

void cmajor::rt::DirectoryIterationTable::EndIterate(int32_t handle)

Definition at line 69 of Directory.cpp :
 70 {
 71     std::lock_guard<std::mutex> lock(mtx);
 72     iterationMap.erase(handle);
 73 }


Declaration at line 33 of Directory.cpp


Init Member Function

void cmajor::rt::DirectoryIterationTable::Init() static

Definition at line 44 of Directory.cpp :
 45 {
 46     instance.reset(new DirectoryIterationTable());
 47 }


Declaration at line 27 of Directory.cpp


Instance Member Function

DirectoryIterationTable & cmajor::rt::DirectoryIterationTable::Instance() static

Definition at line 29 of Directory.cpp :
 29 { return *instance; }


IterateDirectories Member Function

const char * cmajor::rt::DirectoryIterationTable::IterateDirectories(int32_t handle)

Definition at line 100 of Directory.cpp
Declaration at line 32 of Directory.cpp

Calls: soulng::util::Path::Combine


IterateFiles Member Function

const char * cmajor::rt::DirectoryIterationTable::IterateFiles(int32_t handle)

Definition at line 75 of Directory.cpp
Declaration at line 31 of Directory.cpp

Calls: soulng::util::Path::Combine


top | up | prev | next