diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-05-09 10:04:13 -0400 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-05-23 14:34:01 +0200 |
commit | c6358e5d380c18f3ebff148a095ddf3a9d6b266c (patch) | |
tree | 84fc2fa9919e2d57720ae3944e2d3a94b6c28c68 /src/libs/cplusplus/Macro.h | |
parent | bb7da966b801a2884cd7cf47f640bf7ac7d775df (diff) | |
download | qt-creator-c6358e5d380c18f3ebff148a095ddf3a9d6b266c.tar.gz |
C++: Add utf16 indices to Macro and Document::MacroUse
In most cases we need to work with the utf16 indices. Only in
cppfindreferences the byte interface is still needed since there we read
in files and work on a QByteArray to save memory.
Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/libs/cplusplus/Macro.h')
-rw-r--r-- | src/libs/cplusplus/Macro.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/libs/cplusplus/Macro.h b/src/libs/cplusplus/Macro.h index 0258345cfe..01bb3dce9f 100644 --- a/src/libs/cplusplus/Macro.h +++ b/src/libs/cplusplus/Macro.h @@ -71,6 +71,9 @@ public: QByteArray name() const { return _name; } + QString nameToQString() const + { return QString::fromUtf8(_name, _name.size()); } + void setName(const QByteArray &name) { _name = name; } @@ -107,11 +110,17 @@ public: void setLine(unsigned line) { _line = line; } - unsigned offset() const - { return _offset; } + unsigned bytesOffset() const + { return _bytesOffset; } + + void setBytesOffset(unsigned bytesOffset) + { _bytesOffset = bytesOffset; } + + unsigned utf16CharOffset() const + { return _utf16charsOffset; } - void setOffset(unsigned offset) - { _offset = offset; } + void setUtf16charOffset(unsigned utf16charOffset) + { _utf16charsOffset = utf16charOffset; } unsigned length() const { return _length; } @@ -161,7 +170,8 @@ private: unsigned _hashcode; unsigned _fileRevision; unsigned _line; - unsigned _offset; + unsigned _bytesOffset; + unsigned _utf16charsOffset; unsigned _length; union |