summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-01-11 21:18:08 -0500
committerRusty Wagner <rusty@vector35.com>2017-01-11 21:18:08 -0500
commit844e1aa5b4f89de2ffc1990824b094c553068642 (patch)
tree7e3c220249b0a27cd86a0f0c91728f4a229eec49
parent09a68bdd84d4789626f5c8b8631f61e7a41ca03d (diff)
Create qualified name object
-rw-r--r--architecture.cpp20
-rw-r--r--binaryninjaapi.h95
-rw-r--r--binaryview.cpp67
-rw-r--r--demangle.cpp4
-rw-r--r--python/generator.cpp4
-rw-r--r--type.cpp218
6 files changed, 281 insertions, 127 deletions
diff --git a/architecture.cpp b/architecture.cpp
index d0d87df4..657d7bf0 100644
--- a/architecture.cpp
+++ b/architecture.cpp
@@ -746,8 +746,8 @@ void Architecture::SetBinaryViewTypeConstant(const string& type, const string& n
bool Architecture::ParseTypesFromSource(const string& source, const string& fileName,
- map<vector<string>, Ref<Type>>& types, map<vector<string>, Ref<Type>>& variables,
- map<vector<string>, Ref<Type>>& functions, string& errors, const vector<string>& includeDirs)
+ map<QualifiedName, Ref<Type>>& types, map<QualifiedName, Ref<Type>>& variables,
+ map<QualifiedName, Ref<Type>>& functions, string& errors, const vector<string>& includeDirs)
{
BNTypeParserResult result;
char* errorStr;
@@ -769,21 +769,21 @@ bool Architecture::ParseTypesFromSource(const string& source, const string& file
for (size_t i = 0; i < result.typeCount; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < result.types[i].nameCount; j++)
name.push_back(result.types[i].name[j]);
types[name] = new Type(BNNewTypeReference(result.types[i].type));
}
for (size_t i = 0; i < result.variableCount; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < result.variables[i].nameCount; j++)
name.push_back(result.variables[i].name[j]);
types[name] = new Type(BNNewTypeReference(result.variables[i].type));
}
for (size_t i = 0; i < result.functionCount; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < result.functions[i].nameCount; j++)
name.push_back(result.functions[i].name[j]);
types[name] = new Type(BNNewTypeReference(result.functions[i].type));
@@ -793,8 +793,8 @@ bool Architecture::ParseTypesFromSource(const string& source, const string& file
}
-bool Architecture::ParseTypesFromSourceFile(const string& fileName, map<vector<string>, Ref<Type>>& types,
- map<vector<string>, Ref<Type>>& variables, map<vector<string>, Ref<Type>>& functions,
+bool Architecture::ParseTypesFromSourceFile(const string& fileName, map<QualifiedName, Ref<Type>>& types,
+ map<QualifiedName, Ref<Type>>& variables, map<QualifiedName, Ref<Type>>& functions,
string& errors, const vector<string>& includeDirs)
{
BNTypeParserResult result;
@@ -817,21 +817,21 @@ bool Architecture::ParseTypesFromSourceFile(const string& fileName, map<vector<s
for (size_t i = 0; i < result.typeCount; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < result.types[i].nameCount; j++)
name.push_back(result.types[i].name[j]);
types[name] = new Type(BNNewTypeReference(result.types[i].type));
}
for (size_t i = 0; i < result.variableCount; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < result.variables[i].nameCount; j++)
name.push_back(result.variables[i].name[j]);
variables[name] = new Type(BNNewTypeReference(result.variables[i].type));
}
for (size_t i = 0; i < result.functionCount; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < result.functions[i].nameCount; j++)
name.push_back(result.functions[i].name[j]);
functions[name] = new Type(BNNewTypeReference(result.functions[i].type));
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 15c86a58..478cc090 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -277,6 +277,7 @@ namespace BinaryNinja
class MainThreadAction;
class MainThreadActionHandler;
class InteractionHandler;
+ class QualifiedName;
struct FormInputField;
/*! Logs to the error console with the given BNLogLevel.
@@ -368,7 +369,7 @@ namespace BinaryNinja
bool DemangleMS(Architecture* arch,
const std::string& mangledName,
Type** outType,
- std::vector<std::string>& outVarName);
+ QualifiedName& outVarName);
void RegisterMainThread(MainThreadActionHandler* handler);
Ref<MainThreadAction> ExecuteOnMainThread(const std::function<void()>& action);
@@ -408,6 +409,47 @@ namespace BinaryNinja
BNMessageBoxButtonResult ShowMessageBox(const std::string& title, const std::string& text,
BNMessageBoxButtonSet buttons = OKButtonSet, BNMessageBoxIcon icon = InformationIcon);
+ class QualifiedName
+ {
+ std::vector<std::string> m_name;
+
+ public:
+ QualifiedName();
+ QualifiedName(const std::string& name);
+ QualifiedName(const std::vector<std::string>& name);
+ QualifiedName(const QualifiedName& name);
+
+ QualifiedName& operator=(const std::string& name);
+ QualifiedName& operator=(const std::vector<std::string>& name);
+ QualifiedName& operator=(const QualifiedName& name);
+
+ bool operator==(const QualifiedName& other) const;
+ bool operator!=(const QualifiedName& other) const;
+ bool operator<(const QualifiedName& other) const;
+
+ QualifiedName operator+(const QualifiedName& other) const;
+
+ std::string& operator[](size_t i);
+ const std::string& operator[](size_t i) const;
+ std::vector<std::string>::iterator begin();
+ std::vector<std::string>::iterator end();
+ std::vector<std::string>::const_iterator begin() const;
+ std::vector<std::string>::const_iterator end() const;
+ std::string& front();
+ const std::string& front() const;
+ std::string& back();
+ const std::string& back() const;
+ void insert(std::vector<std::string>::iterator loc, const std::string& name);
+ void insert(std::vector<std::string>::iterator loc, std::vector<std::string>::iterator b,
+ std::vector<std::string>::iterator e);
+ void erase(std::vector<std::string>::iterator i);
+ void clear();
+ void push_back(const std::string& name);
+ size_t size() const;
+
+ std::string GetString() const;
+ };
+
class DataBuffer
{
BNDataBuffer* m_buffer;
@@ -610,8 +652,8 @@ namespace BinaryNinja
virtual void OnDataVariableUpdated(BinaryView* view, const DataVariable& var) { (void)view; (void)var; }
virtual void OnStringFound(BinaryView* data, BNStringType type, uint64_t offset, size_t len) { (void)data; (void)type; (void)offset; (void)len; }
virtual void OnStringRemoved(BinaryView* data, BNStringType type, uint64_t offset, size_t len) { (void)data; (void)type; (void)offset; (void)len; }
- virtual void OnTypeDefined(BinaryView* data, const std::vector<std::string>& name, Type* type) { (void)data; (void)name; (void)type; }
- virtual void OnTypeUndefined(BinaryView* data, const std::vector<std::string>& name, Type* type) { (void)data; (void)name; (void)type; }
+ virtual void OnTypeDefined(BinaryView* data, const QualifiedName& name, Type* type) { (void)data; (void)name; (void)type; }
+ virtual void OnTypeUndefined(BinaryView* data, const QualifiedName& name, Type* type) { (void)data; (void)name; (void)type; }
};
class FileAccessor
@@ -979,19 +1021,13 @@ namespace BinaryNinja
bool ParseTypeString(const std::string& text, QualifiedNameAndType& result, std::string& errors);
- std::map<std::vector<std::string>, Ref<Type>> GetTypes();
- Ref<Type> GetTypeByName(const std::string& name);
- Ref<Type> GetTypeByName(const std::vector<std::string>& name);
- bool IsTypeAutoDefined(const std::string& name);
- bool IsTypeAutoDefined(const std::vector<std::string>& name);
- void DefineType(const std::string& name, Ref<Type> type);
- void DefineType(const std::vector<std::string>& name, Ref<Type> type);
- void DefineUserType(const std::string& name, Ref<Type> type);
- void DefineUserType(const std::vector<std::string>& name, Ref<Type> type);
- void UndefineType(const std::string& name);
- void UndefineType(const std::vector<std::string>& name);
- void UndefineUserType(const std::string& name);
- void UndefineUserType(const std::vector<std::string>& name);
+ std::map<QualifiedName, Ref<Type>> GetTypes();
+ Ref<Type> GetTypeByName(const QualifiedName& name);
+ bool IsTypeAutoDefined(const QualifiedName& name);
+ void DefineType(const QualifiedName& name, Ref<Type> type);
+ void DefineUserType(const QualifiedName& name, Ref<Type> type);
+ void UndefineType(const QualifiedName& name);
+ void UndefineUserType(const QualifiedName& name);
bool FindNextData(uint64_t start, const DataBuffer& data, uint64_t& result, BNFindFlag flags = NoFindFlags);
@@ -1441,14 +1477,14 @@ namespace BinaryNinja
void SetBinaryViewTypeConstant(const std::string& type, const std::string& name, uint64_t value);
bool ParseTypesFromSource(const std::string& source, const std::string& fileName,
- std::map<std::vector<std::string>, Ref<Type>>& types,
- std::map<std::vector<std::string>, Ref<Type>>& variables,
- std::map<std::vector<std::string>, Ref<Type>>& functions, std::string& errors,
+ std::map<QualifiedName, Ref<Type>>& types,
+ std::map<QualifiedName, Ref<Type>>& variables,
+ std::map<QualifiedName, Ref<Type>>& functions, std::string& errors,
const std::vector<std::string>& includeDirs = std::vector<std::string>());
bool ParseTypesFromSourceFile(const std::string& fileName,
- std::map<std::vector<std::string>, Ref<Type>>& types,
- std::map<std::vector<std::string>, Ref<Type>>& variables,
- std::map<std::vector<std::string>, Ref<Type>>& functions, std::string& errors,
+ std::map<QualifiedName, Ref<Type>>& types,
+ std::map<QualifiedName, Ref<Type>>& variables,
+ std::map<QualifiedName, Ref<Type>>& functions, std::string& errors,
const std::vector<std::string>& includeDirs = std::vector<std::string>());
void RegisterCallingConvention(CallingConvention* cc);
@@ -1523,7 +1559,7 @@ namespace BinaryNinja
struct QualifiedNameAndType
{
- std::vector<std::string> name;
+ QualifiedName name;
Ref<Type> type;
};
@@ -1553,7 +1589,7 @@ namespace BinaryNinja
void SetFunctionCanReturn(bool canReturn);
std::string GetString() const;
- std::string GetTypeAndName(const std::vector<std::string>& name) const;
+ std::string GetTypeAndName(const QualifiedName& name) const;
std::string GetStringBeforeName() const;
std::string GetStringAfterName() const;
@@ -1569,15 +1605,13 @@ namespace BinaryNinja
static Ref<Type> FloatType(size_t width, const std::string& typeName = "");
static Ref<Type> StructureType(Structure* strct);
static Ref<Type> NamedType(NamedTypeReference* ref, size_t width = 0, size_t align = 1);
- static Ref<Type> NamedType(const std::vector<std::string>& name, Type* type);
+ static Ref<Type> NamedType(const QualifiedName& name, Type* type);
static Ref<Type> EnumerationType(Architecture* arch, Enumeration* enm, size_t width = 0, bool issigned = false);
static Ref<Type> PointerType(Architecture* arch, Type* type, bool cnst = false, bool vltl = false,
BNReferenceType refType = PointerReferenceType);
static Ref<Type> ArrayType(Type* type, uint64_t elem);
static Ref<Type> FunctionType(Type* returnValue, CallingConvention* callingConvention,
const std::vector<NameAndType>& params, bool varArg = false);
-
- static std::string GetQualifiedName(const std::vector<std::string>& names);
};
class NamedTypeReference: public CoreRefCountObject<BNNamedTypeReference, BNNewNamedTypeReference,
@@ -1585,11 +1619,12 @@ namespace BinaryNinja
{
public:
NamedTypeReference(BNNamedTypeReference* nt);
- NamedTypeReference(BNNamedTypeReferenceClass cls, const std::vector<std::string>& name = {});
+ NamedTypeReference(BNNamedTypeReferenceClass cls = UnknownNamedTypeClass,
+ const QualifiedName& name = QualifiedName());
BNNamedTypeReferenceClass GetTypeClass() const;
void SetTypeClass(BNNamedTypeReferenceClass cls);
- std::vector<std::string> GetName() const;
- void SetName(const std::vector<std::string>& name);
+ QualifiedName GetName() const;
+ void SetName(const QualifiedName& name);
};
struct StructureMember
diff --git a/binaryview.cpp b/binaryview.cpp
index 9fdd5748..8394fc57 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -135,7 +135,7 @@ void BinaryDataNotification::TypeDefinedCallback(void* ctxt, BNBinaryView* data,
BinaryDataNotification* notify = (BinaryDataNotification*)ctxt;
Ref<BinaryView> view = new BinaryView(BNNewViewReference(data));
Ref<Type> typeObj = new Type(BNNewTypeReference(type));
- vector<string> nameList;
+ QualifiedName nameList;
for (size_t i = 0; i < nameCount; i++)
nameList.push_back(name[i]);
notify->OnTypeDefined(view, nameList, typeObj);
@@ -148,7 +148,7 @@ void BinaryDataNotification::TypeUndefinedCallback(void* ctxt, BNBinaryView* dat
BinaryDataNotification* notify = (BinaryDataNotification*)ctxt;
Ref<BinaryView> view = new BinaryView(BNNewViewReference(data));
Ref<Type> typeObj = new Type(BNNewTypeReference(type));
- vector<string> nameList;
+ QualifiedName nameList;
for (size_t i = 0; i < nameCount; i++)
nameList.push_back(name[i]);
notify->OnTypeUndefined(view, nameList, typeObj);
@@ -1476,15 +1476,15 @@ bool BinaryView::ParseTypeString(const string& text, QualifiedNameAndType& resul
}
-map<vector<string>, Ref<Type>> BinaryView::GetTypes()
+map<QualifiedName, Ref<Type>> BinaryView::GetTypes()
{
size_t count;
BNQualifiedNameAndType* types = BNGetAnalysisTypeList(m_object, &count);
- map<vector<string>, Ref<Type>> result;
+ map<QualifiedName, Ref<Type>> result;
for (size_t i = 0; i < count; i++)
{
- vector<string> name;
+ QualifiedName name;
for (size_t j = 0; j < types[i].nameCount; j++)
name.push_back(types[i].name[j]);
result[name] = new Type(BNNewTypeReference(types[i].type));
@@ -1495,17 +1495,7 @@ map<vector<string>, Ref<Type>> BinaryView::GetTypes()
}
-Ref<Type> BinaryView::GetTypeByName(const string& name)
-{
- const char* nameStr = name.c_str();
- BNType* type = BNGetAnalysisTypeByName(m_object, &nameStr, 1);
- if (!type)
- return nullptr;
- return new Type(type);
-}
-
-
-Ref<Type> BinaryView::GetTypeByName(const vector<string>& name)
+Ref<Type> BinaryView::GetTypeByName(const QualifiedName& name)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
@@ -1520,14 +1510,7 @@ Ref<Type> BinaryView::GetTypeByName(const vector<string>& name)
}
-bool BinaryView::IsTypeAutoDefined(const string& name)
-{
- const char* nameStr = name.c_str();
- return BNIsAnalysisTypeAutoDefined(m_object, &nameStr, 1);
-}
-
-
-bool BinaryView::IsTypeAutoDefined(const vector<string>& name)
+bool BinaryView::IsTypeAutoDefined(const QualifiedName& name)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
@@ -1538,14 +1521,7 @@ bool BinaryView::IsTypeAutoDefined(const vector<string>& name)
}
-void BinaryView::DefineType(const string& name, Ref<Type> type)
-{
- const char* nameStr = name.c_str();
- BNDefineAnalysisType(m_object, &nameStr, 1, type->GetObject());
-}
-
-
-void BinaryView::DefineType(const vector<string>& name, Ref<Type> type)
+void BinaryView::DefineType(const QualifiedName& name, Ref<Type> type)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
@@ -1555,14 +1531,7 @@ void BinaryView::DefineType(const vector<string>& name, Ref<Type> type)
}
-void BinaryView::DefineUserType(const string& name, Ref<Type> type)
-{
- const char* nameStr = name.c_str();
- BNDefineUserAnalysisType(m_object, &nameStr, 1, type->GetObject());
-}
-
-
-void BinaryView::DefineUserType(const vector<string>& name, Ref<Type> type)
+void BinaryView::DefineUserType(const QualifiedName& name, Ref<Type> type)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
@@ -1572,14 +1541,7 @@ void BinaryView::DefineUserType(const vector<string>& name, Ref<Type> type)
}
-void BinaryView::UndefineType(const string& name)
-{
- const char* nameStr = name.c_str();
- BNUndefineAnalysisType(m_object, &nameStr, 1);
-}
-
-
-void BinaryView::UndefineType(const vector<string>& name)
+void BinaryView::UndefineType(const QualifiedName& name)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
@@ -1589,14 +1551,7 @@ void BinaryView::UndefineType(const vector<string>& name)
}
-void BinaryView::UndefineUserType(const string& name)
-{
- const char* nameStr = name.c_str();
- BNUndefineUserAnalysisType(m_object, &nameStr, 1);
-}
-
-
-void BinaryView::UndefineUserType(const vector<string>& name)
+void BinaryView::UndefineUserType(const QualifiedName& name)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
diff --git a/demangle.cpp b/demangle.cpp
index a12303ca..70a2fe08 100644
--- a/demangle.cpp
+++ b/demangle.cpp
@@ -6,7 +6,7 @@ using namespace std;
bool DemangleMS(Architecture* arch,
const std::string& mangledName,
Type** outType,
- std::vector<std::string>& outVarName)
+ QualifiedName& outVarName)
{
BNType* localType = (*outType)->GetObject();
char** localVarName = nullptr;
@@ -26,7 +26,7 @@ bool DemangleMS(Architecture* arch,
bool DemangleGNU3(Architecture* arch,
const std::string& mangledName,
Type** outType,
- std::vector<std::string>& outVarName)
+ QualifiedName& outVarName)
{
BNType* localType = (*outType)->GetObject();
char** localVarName = nullptr;
diff --git a/python/generator.cpp b/python/generator.cpp
index 4c313fdd..485655c2 100644
--- a/python/generator.cpp
+++ b/python/generator.cpp
@@ -98,7 +98,7 @@ void OutputType(FILE* out, Type* type, bool isReturnType = false, bool isCallbac
fprintf(out, "ctypes.c_double");
break;
case NamedTypeReferenceClass:
- fprintf(out, "%s", type->GetQualifiedName(type->GetNamedTypeReference()->GetName()).c_str());
+ fprintf(out, "%s", type->GetNamedTypeReference()->GetName().GetString().c_str());
break;
case PointerTypeClass:
if (isCallback || (type->GetChildType()->GetClass() == VoidTypeClass))
@@ -153,7 +153,7 @@ int main(int argc, char* argv[])
Architecture::Register(new GeneratorArchitecture());
// Parse API header to get type and function information
- map<vector<string>, Ref<Type>> types, vars, funcs;
+ map<QualifiedName, Ref<Type>> types, vars, funcs;
string errors;
bool ok = Architecture::GetByName("generator")->ParseTypesFromSourceFile(argv[1], types, vars, funcs, errors);
fprintf(stderr, "%s", errors.c_str());
diff --git a/type.cpp b/type.cpp
index 0571f743..ae8f04d3 100644
--- a/type.cpp
+++ b/type.cpp
@@ -24,6 +24,191 @@ using namespace BinaryNinja;
using namespace std;
+QualifiedName::QualifiedName()
+{
+}
+
+
+QualifiedName::QualifiedName(const string& name)
+{
+ m_name.push_back(name);
+}
+
+
+QualifiedName::QualifiedName(const vector<string>& name): m_name(name)
+{
+}
+
+
+QualifiedName::QualifiedName(const QualifiedName& name): m_name(name.m_name)
+{
+}
+
+
+QualifiedName& QualifiedName::operator=(const string& name)
+{
+ m_name = vector<string>{name};
+ return *this;
+}
+
+
+QualifiedName& QualifiedName::operator=(const vector<string>& name)
+{
+ m_name = name;
+ return *this;
+}
+
+
+QualifiedName& QualifiedName::operator=(const QualifiedName& name)
+{
+ m_name = name.m_name;
+ return *this;
+}
+
+
+bool QualifiedName::operator==(const QualifiedName& other) const
+{
+ return m_name == other.m_name;
+}
+
+
+bool QualifiedName::operator!=(const QualifiedName& other) const
+{
+ return m_name != other.m_name;
+}
+
+
+bool QualifiedName::operator<(const QualifiedName& other) const
+{
+ return m_name < other.m_name;
+}
+
+
+QualifiedName QualifiedName::operator+(const QualifiedName& other) const
+{
+ QualifiedName result(*this);
+ result.m_name.insert(result.m_name.end(), other.m_name.begin(), other.m_name.end());
+ return result;
+}
+
+
+string& QualifiedName::operator[](size_t i)
+{
+ return m_name[i];
+}
+
+
+const string& QualifiedName::operator[](size_t i) const
+{
+ return m_name[i];
+}
+
+
+vector<string>::iterator QualifiedName::begin()
+{
+ return m_name.begin();
+}
+
+
+vector<string>::iterator QualifiedName::end()
+{
+ return m_name.end();
+}
+
+
+vector<string>::const_iterator QualifiedName::begin() const
+{
+ return m_name.begin();
+}
+
+
+vector<string>::const_iterator QualifiedName::end() const
+{
+ return m_name.end();
+}
+
+
+string& QualifiedName::front()
+{
+ return m_name.front();
+}
+
+
+const string& QualifiedName::front() const
+{
+ return m_name.front();
+}
+
+
+string& QualifiedName::back()
+{
+ return m_name.back();
+}
+
+
+const string& QualifiedName::back() const
+{
+ return m_name.back();
+}
+
+
+void QualifiedName::insert(vector<string>::iterator loc, const string& name)
+{
+ m_name.insert(loc, name);
+}
+
+
+void QualifiedName::insert(vector<string>::iterator loc, vector<string>::iterator b, vector<string>::iterator e)
+{
+ m_name.insert(loc, b, e);
+}
+
+
+void QualifiedName::erase(vector<string>::iterator i)
+{
+ m_name.erase(i);
+}
+
+
+void QualifiedName::clear()
+{
+ m_name.clear();
+}
+
+
+void QualifiedName::push_back(const string& name)
+{
+ m_name.push_back(name);
+}
+
+
+size_t QualifiedName::size() const
+{
+ return m_name.size();
+}
+
+
+string QualifiedName::GetString() const
+{
+ bool first = true;
+ string out;
+ for (auto &name : m_name)
+ {
+ if (!first)
+ {
+ out += "::" + name;
+ }
+ else
+ {
+ out += name;
+ }
+ if (name.length() != 0)
+ first = false;
+ }
+ return out;
+}
+
+
Type::Type(BNType* type)
{
m_object = type;
@@ -148,27 +333,6 @@ uint64_t Type::GetElementCount() const
}
-string Type::GetQualifiedName(const vector<string>& names)
-{
- bool first = true;
- string out;
- for (auto &name : names)
- {
- if (!first)
- {
- out += "::" + name;
- }
- else
- {
- out += name;
- }
- if (name.length() != 0)
- first = false;
- }
- return out;
-}
-
-
string Type::GetString() const
{
char* str = BNGetTypeString(m_object);
@@ -178,7 +342,7 @@ string Type::GetString() const
}
-string Type::GetTypeAndName(const vector<string>& nameList) const
+string Type::GetTypeAndName(const QualifiedName& nameList) const
{
const char ** str = new const char*[nameList.size()];
for (size_t i = 0; i < nameList.size(); i++)
@@ -322,7 +486,7 @@ Ref<Type> Type::NamedType(NamedTypeReference* ref, size_t width, size_t align)
}
-Ref<Type> Type::NamedType(const vector<string>& name, Type* type)
+Ref<Type> Type::NamedType(const QualifiedName& name, Type* type)
{
const char** nameList = new const char*[name.size()];
for (size_t i = 0; i < name.size(); i++)
@@ -382,7 +546,7 @@ NamedTypeReference::NamedTypeReference(BNNamedTypeReference* nt)
}
-NamedTypeReference::NamedTypeReference(BNNamedTypeReferenceClass cls, const vector<string>& names)
+NamedTypeReference::NamedTypeReference(BNNamedTypeReferenceClass cls, const QualifiedName& names)
{
m_object = BNCreateNamedType();
BNSetTypeReferenceClass(m_object, cls);
@@ -408,7 +572,7 @@ BNNamedTypeReferenceClass NamedTypeReference::GetTypeClass() const
}
-void NamedTypeReference::SetName(const vector<string>& names)
+void NamedTypeReference::SetName(const QualifiedName& names)
{
const char ** nameList = new const char*[names.size()];
for (size_t i = 0; i < names.size(); i++)
@@ -420,11 +584,11 @@ void NamedTypeReference::SetName(const vector<string>& names)
}
-vector<string> NamedTypeReference::GetName() const
+QualifiedName NamedTypeReference::GetName() const
{
size_t size;
char** name = BNGetTypeReferenceName(m_object, &size);
- vector<string> result;
+ QualifiedName result;
for (size_t i = 0; i < size; i++)
{
result.push_back(name[i]);