summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2023-02-24 10:48:53 -0500
committerPeter LaFosse <peter@vector35.com>2023-02-25 07:52:55 -0500
commit0108ff005a358cda6912d0437ccd62558ba5ed3d (patch)
treecacc53f8062f48429ce13a4a564786df5cadf6c8 /type.cpp
parentd260db48d05dc38f1a60cedb8633434a7b6237b6 (diff)
Fix python constructor of QualifiedNames and some of the operators on the C++ API
Diffstat (limited to 'type.cpp')
-rw-r--r--type.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/type.cpp b/type.cpp
index 1cab11bd..f3ad65a6 100644
--- a/type.cpp
+++ b/type.cpp
@@ -41,8 +41,6 @@ NameList::NameList(const BNQualifiedName* name)
}
-
-
NameList::NameList(const string& name, const string& join) : m_join(join)
{
if (!name.empty())
@@ -76,31 +74,40 @@ NameList& NameList::operator=(const vector<string>& name)
NameList& NameList::operator=(const NameList& name)
{
m_name = name.m_name;
+ m_join = name.m_join;
return *this;
}
bool NameList::operator==(const NameList& other) const
{
- return m_name == other.m_name;
+ return m_name == other.m_name && m_join == other.m_join;
}
bool NameList::operator!=(const NameList& other) const
{
- return m_name != other.m_name;
+ return m_name != other.m_name && m_join != other.m_join;
}
bool NameList::operator<(const NameList& other) const
{
- return m_name < other.m_name;
+ if (m_name < other.m_name)
+ return true;
+ if (m_name > other.m_name)
+ return false;
+ return m_join < other.m_join;
}
bool NameList::operator>(const NameList& other) const
{
- return m_name > other.m_name;
+ if (m_name > other.m_name)
+ return true;
+ if (m_name < other.m_name)
+ return false;
+ return m_join > other.m_join;
}