2013-01-24 16:33:17 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-01-24 16:33:17 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-01-24 16:33:17 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-01-24 16:33:17 +01:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef SOURCE_UTILS_H
|
|
|
|
|
#define SOURCE_UTILS_H
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2015-07-17 16:33:25 +02:00
|
|
|
namespace TextEditor {
|
|
|
|
|
class TextDocument;
|
|
|
|
|
class TextEditorWidget;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-24 16:33:17 +01:00
|
|
|
namespace CPlusPlus { class Snapshot; }
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2015-07-17 16:33:25 +02:00
|
|
|
class ContextData;
|
|
|
|
|
|
2013-01-24 16:33:17 +01:00
|
|
|
// Editor tooltip support
|
2014-09-26 11:37:54 +02:00
|
|
|
QString cppExpressionAt(TextEditor::TextEditorWidget *editorWidget, int pos,
|
2014-11-15 13:33:40 +01:00
|
|
|
int *line, int *column, QString *function = 0,
|
|
|
|
|
int *scopeFromLine = 0, int *scopeToLine = 0);
|
2013-01-24 16:33:17 +01:00
|
|
|
QString fixCppExpression(const QString &exp);
|
2014-09-19 17:06:26 +02:00
|
|
|
QString cppFunctionAt(const QString &fileName, int line, int column = 0);
|
2013-01-24 16:33:17 +01:00
|
|
|
|
|
|
|
|
// Get variables that are not initialized at a certain line
|
|
|
|
|
// of a function from the code model. Shadowed variables will
|
|
|
|
|
// be reported using the debugger naming conventions '<shadowed n>'
|
|
|
|
|
bool getUninitializedVariables(const CPlusPlus::Snapshot &snapshot,
|
|
|
|
|
const QString &function, const QString &file, int line,
|
|
|
|
|
QStringList *uninitializedVariables);
|
|
|
|
|
|
2015-07-17 16:33:25 +02:00
|
|
|
ContextData getLocationContext(TextEditor::TextDocument *document, int lineNumber);
|
|
|
|
|
|
2013-01-24 16:33:17 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // SOURCE_UTILS_H
|