mirror of
https://github.com/QuasarApp/macdependency.git
synced 2025-04-27 12:54:31 +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).
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
//
|
|
// SymbolEntryModel.mm
|
|
// MacDependency
|
|
//
|
|
// Created by Konrad Windszus on 13.07.09.
|
|
// Copyright 2009 Konrad Windszus. All rights reserved.
|
|
//
|
|
|
|
#import "SymbolTableEntryModel.h"
|
|
#import "MachOModel.h"
|
|
#import "ConversionStdString.h"
|
|
#import "MyDocument.h"
|
|
#include "MachO/machodemangleexception.h"
|
|
|
|
@implementation SymbolTableEntryModel
|
|
|
|
- (id) initWithEntry:(const SymbolTableEntry*)anEntry demangleNamesPtr:(BOOL*)demangle document:(MyDocument*)aDocument {
|
|
self = [super init];
|
|
if (self) {
|
|
entry = anEntry;
|
|
self->demangleNames = demangle;
|
|
document = aDocument;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSString*) name {
|
|
try {
|
|
return [NSString stringWithStdString: entry->getName(*demangleNames)];
|
|
} catch (MachODemangleException& e) {
|
|
// in case of demangling problems (probably c++filt not installed)
|
|
NSString* error = NSLocalizedString(@"ERR_NO_DEMANGLER", nil);
|
|
[document appendLogLine:error withModel:nil state:StateError];
|
|
// disable name demangling
|
|
[[document symbolTableController] setDemangleNames:NO];
|
|
}
|
|
return [NSString stringWithStdString:entry->getName(false)];
|
|
}
|
|
|
|
- (NSNumber*) type {
|
|
return [NSNumber numberWithUnsignedInt:entry->getType()];
|
|
}
|
|
|
|
@end
|