mirror of
https://github.com/QuasarApp/macdependency.git
synced 2025-04-28 05:14:32 +00:00
- Applied all recommended XCode (8) settings. - Removed boost and replaced that code by standard functions. - Implemented name mangling via abi::__cxa_demangle instead of running an external process to use c++filt. - Enabled C++11. Min deployment target is now OSX 10.7. - Some code clean up (e.g. formatting, std namespace).
41 lines
749 B
C++
41 lines
749 B
C++
/*
|
|
* machocache.cpp
|
|
* MachO
|
|
*
|
|
* Created by Konrad Windszus on 13.07.09.
|
|
* Copyright 2009 __MyCompanyName__. All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#include "machocache.h"
|
|
#include "macho.h"
|
|
|
|
MachOCache::MachOCache() {
|
|
|
|
}
|
|
|
|
MachOCache::~MachOCache() {
|
|
// remove all cache entries
|
|
for (CacheMapIterator it = cache.begin(); it != cache.end(); it++) {
|
|
delete it->second;
|
|
}
|
|
}
|
|
|
|
MachO* MachOCache::getFile(const std::string& filename, const MachO* parent) {
|
|
CacheMapIterator it = cache.find(filename);
|
|
|
|
// check if already in cache?
|
|
if (it == cache.end()) {
|
|
MachO* file = new MachO(filename, parent);
|
|
cache[filename] = file;
|
|
return file;
|
|
}
|
|
else {
|
|
return it->second;
|
|
}
|
|
}
|
|
|
|
unsigned int MachOCache::getNumEntries() {
|
|
return cache.size();
|
|
}
|