summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/PreprocessorClient.h
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2014-05-09 10:04:13 -0400
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-05-23 14:34:01 +0200
commitc6358e5d380c18f3ebff148a095ddf3a9d6b266c (patch)
tree84fc2fa9919e2d57720ae3944e2d3a94b6c28c68 /src/libs/cplusplus/PreprocessorClient.h
parentbb7da966b801a2884cd7cf47f640bf7ac7d775df (diff)
downloadqt-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/PreprocessorClient.h')
-rw-r--r--src/libs/cplusplus/PreprocessorClient.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/libs/cplusplus/PreprocessorClient.h b/src/libs/cplusplus/PreprocessorClient.h
index 4802289dfa..a990a39357 100644
--- a/src/libs/cplusplus/PreprocessorClient.h
+++ b/src/libs/cplusplus/PreprocessorClient.h
@@ -46,19 +46,19 @@ class Macro;
class CPLUSPLUS_EXPORT MacroArgumentReference
{
- unsigned _position;
- unsigned _length;
+ unsigned _utf16charsOffset;
+ unsigned _utf16charsLength;
public:
- explicit MacroArgumentReference(unsigned position = 0, unsigned length = 0)
- : _position(position), _length(length)
+ explicit MacroArgumentReference(unsigned utf16charsOffset = 0, unsigned utf16charsLength = 0)
+ : _utf16charsOffset(utf16charsOffset), _utf16charsLength(utf16charsLength)
{ }
- unsigned position() const
- { return _position; }
+ unsigned utf16charsOffset() const
+ { return _utf16charsOffset; }
- unsigned length() const
- { return _length; }
+ unsigned utf16charsLength() const
+ { return _utf16charsLength; }
};
class CPLUSPLUS_EXPORT Client
@@ -79,24 +79,26 @@ public:
virtual void macroAdded(const Macro &macro) = 0;
- virtual void passedMacroDefinitionCheck(unsigned offset, unsigned line, const Macro &macro) = 0;
- virtual void failedMacroDefinitionCheck(unsigned offset, const ByteArrayRef &name) = 0;
+ virtual void passedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
+ unsigned line, const Macro &macro) = 0;
+ virtual void failedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
+ const ByteArrayRef &name) = 0;
- virtual void notifyMacroReference(unsigned offset, unsigned line, const Macro &macro) = 0;
+ virtual void notifyMacroReference(unsigned bytesOffset, unsigned utf16charsOffset,
+ unsigned line, const Macro &macro) = 0;
- virtual void startExpandingMacro(unsigned offset,
- unsigned line,
- const Macro &macro,
+ virtual void startExpandingMacro(unsigned bytesOffset, unsigned utf16charsOffset,
+ unsigned line, const Macro &macro,
const QVector<MacroArgumentReference> &actuals
= QVector<MacroArgumentReference>()) = 0;
- virtual void stopExpandingMacro(unsigned offset, const Macro &macro) = 0;
+ virtual void stopExpandingMacro(unsigned bytesOffset, const Macro &macro) = 0; // TODO: ?!
/// Mark the given macro name as the include guard for the current file.
virtual void markAsIncludeGuard(const QByteArray &macroName) = 0;
- /// Start skipping from the given offset.
- virtual void startSkippingBlocks(unsigned offset) = 0;
- virtual void stopSkippingBlocks(unsigned offset) = 0;
+ /// Start skipping from the given utf16charsOffset.
+ virtual void startSkippingBlocks(unsigned utf16charsOffset) = 0;
+ virtual void stopSkippingBlocks(unsigned utf16charsOffset) = 0;
virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode) = 0;