CppEditor: Move two functions to cpptoolsreuse.{h,cpp}

They do not really depend on CppEditorWidget and will be re-used in a
follow-up change.

    CppEditorWidget::identifierUnderCursor()
    CppEditorWidget::findCanonicalMacro()

Change-Id: I553bb68694fb4b5f1baa331debf33ae234e3dedf
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-06-10 16:05:14 -04:00
committed by Erik Verbruggen
parent a87fa1e223
commit fa4e839bbe
5 changed files with 50 additions and 45 deletions

View File

@@ -32,11 +32,16 @@
#include "cpptools_global.h"
QT_FORWARD_DECLARE_CLASS(QChar)
QT_FORWARD_DECLARE_CLASS(QTextCursor)
QT_FORWARD_DECLARE_CLASS(QStringRef)
#include <cplusplus/CppDocument.h>
QT_BEGIN_NAMESPACE
class QChar;
class QStringRef;
class QTextCursor;
QT_END_NAMESPACE
namespace CPlusPlus {
class Macro;
class Symbol;
class LookupContext;
} // namespace CPlusPlus
@@ -46,15 +51,20 @@ namespace CppTools {
void CPPTOOLS_EXPORT moveCursorToEndOfIdentifier(QTextCursor *tc);
void CPPTOOLS_EXPORT moveCursorToStartOfIdentifier(QTextCursor *tc);
bool CPPTOOLS_EXPORT isOwnershipRAIIType(CPlusPlus::Symbol *symbol,
const CPlusPlus::LookupContext &context);
bool CPPTOOLS_EXPORT isQtKeyword(const QStringRef &text);
bool CPPTOOLS_EXPORT isValidAsciiIdentifierChar(const QChar &ch);
bool CPPTOOLS_EXPORT isValidFirstIdentifierChar(const QChar &ch);
bool CPPTOOLS_EXPORT isValidIdentifierChar(const QChar &ch);
bool CPPTOOLS_EXPORT isValidIdentifier(const QString &s);
bool CPPTOOLS_EXPORT isQtKeyword(const QStringRef &text);
QString CPPTOOLS_EXPORT identifierUnderCursor(QTextCursor *cursor);
bool CPPTOOLS_EXPORT isOwnershipRAIIType(CPlusPlus::Symbol *symbol,
const CPlusPlus::LookupContext &context);
const CPlusPlus::Macro CPPTOOLS_EXPORT *findCanonicalMacro(const QTextCursor &cursor,
CPlusPlus::Document::Ptr document);
QString CPPTOOLS_EXPORT correspondingHeaderOrSource(const QString &fileName, bool *wasHeader = 0);
void CPPTOOLS_EXPORT switchHeaderSource();