Added operator== implementation

This commit is contained in:
Stephan Aßmus
2012-05-06 16:50:02 +02:00
parent 7a20125661
commit 2d35ee03c0
2 changed files with 31 additions and 3 deletions
+29 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2009, Haiku.
* Copyright 2006-2012, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -317,6 +317,34 @@ VectorPath::operator=(const VectorPath& from)
}
bool
VectorPath::operator==(const VectorPath& other) const
{
if (fClosed != other.fClosed)
return false;
if (fPointCount != other.fPointCount)
return false;
if (fPath == NULL && other.fPath == NULL)
return true;
if (fPath == NULL || other.fPath == NULL)
return false;
for (int32 i = 0; i < fPointCount; i++) {
if (fPath[i].point != other.fPath[i].point
|| fPath[i].point_in != other.fPath[i].point_in
|| fPath[i].point_out != other.fPath[i].point_out
|| fPath[i].connected != other.fPath[i].connected) {
return false;
}
}
return true;
}
void
VectorPath::MakeEmpty()
{
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007, Haiku.
* Copyright 2006-2012, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -89,7 +89,7 @@ class VectorPath {
// VectorPath
VectorPath& operator=(const VectorPath& from);
// bool operator==(const VectorPath& from) const;
bool operator==(const VectorPath& from) const;
void MakeEmpty();