2009-09-17 13:06:04 +00:00
|
|
|
#ifndef DYLIBCOMMAND_H
|
|
|
|
#define DYLIBCOMMAND_H
|
|
|
|
|
|
|
|
#include "macho_global.h"
|
|
|
|
#include "loadcommand.h"
|
2009-09-29 15:01:48 +00:00
|
|
|
class EXPORT DylibCommand : public LoadCommand
|
2009-09-17 13:06:04 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum DependencyType {
|
|
|
|
DependencyWeak, // dependency is allowed to be missing
|
|
|
|
DependencyDelayed, // dependency is loaded when it is needed (not at start)
|
|
|
|
DependencyNormal,
|
|
|
|
DependencyId
|
|
|
|
};
|
|
|
|
|
|
|
|
DylibCommand(MachOHeader* header, DependencyType type);
|
|
|
|
virtual ~DylibCommand();
|
|
|
|
virtual unsigned int getSize() const;
|
|
|
|
virtual unsigned int getStructureSize() const { return sizeof(command); }
|
|
|
|
bool isId() const { return type==DependencyId; }
|
|
|
|
bool isNecessary() const { return type!=DependencyWeak; }
|
|
|
|
DependencyType getType() const { return type; }
|
2016-11-19 16:23:39 +01:00
|
|
|
std::string getName() const;
|
2009-09-17 13:06:04 +00:00
|
|
|
unsigned int getCurrentVersion() const;
|
|
|
|
unsigned int getCompatibleVersion() const;
|
|
|
|
time_t getTimeStamp() const;
|
2016-11-19 16:23:39 +01:00
|
|
|
static std::string getVersionString(unsigned int version);
|
2009-09-17 13:06:04 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
dylib_command command;
|
|
|
|
DependencyType type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DYLIBCOMMAND_H
|