aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Symbol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Symbol.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Symbol.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbol.cpp b/src/libs/3rdparty/cplusplus/Symbol.cpp
index e98b33a8a78..e9c7edb0dc6 100644
--- a/src/libs/3rdparty/cplusplus/Symbol.cpp
+++ b/src/libs/3rdparty/cplusplus/Symbol.cpp
@@ -32,6 +32,7 @@
#include "cppassert.h"
+#include <utils/link.h>
using namespace CPlusPlus;
@@ -435,3 +436,19 @@ void Symbol::copy(Symbol *other)
_isGenerated = other->_isGenerated;
_isDeprecated = other->_isDeprecated;
}
+
+Utils::Link Symbol::toLink() const
+{
+ const QString filename = QString::fromUtf8(fileName(), static_cast<int>(fileNameLength()));
+
+ int line = static_cast<int>(this->line());
+ int column = static_cast<int>(this->column());
+
+ if (column)
+ --column;
+
+ if (isGenerated())
+ column = 0;
+
+ return Utils::Link(filename, line, column);
+}