aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language/filecontextbase.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-02-27 17:35:52 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2014-02-28 12:42:44 +0100
commit85b234c3a0a4d1c40dd509f8a1a24907eea7d2ba (patch)
treef547648f13239d9fea0eccfe12fd840a55dde0d3 /src/lib/corelib/language/filecontextbase.h
parent08a4a71c7ced7b799e4b706377a39a5146431c38 (diff)
give FileContext and ResolvedFileContext a common base
Change-Id: I76f0e5e0b9f99a6f33c3381436ee6c4879e36a68 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/corelib/language/filecontextbase.h')
-rw-r--r--src/lib/corelib/language/filecontextbase.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/lib/corelib/language/filecontextbase.h b/src/lib/corelib/language/filecontextbase.h
new file mode 100644
index 000000000..3a465ffaa
--- /dev/null
+++ b/src/lib/corelib/language/filecontextbase.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Build Suite.
+**
+** 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
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef QBS_FILECONTEXTBASE_H
+#define QBS_FILECONTEXTBASE_H
+
+#include "jsimports.h"
+
+namespace qbs {
+namespace Internal {
+
+class FileContextBase
+{
+ friend class ItemReaderASTVisitor;
+
+public:
+ void setFilePath(const QString &filePath);
+ QString filePath() const;
+
+ void setJsImports(const JsImports &jsImports);
+ JsImports jsImports() const;
+
+ void setJsExtensions(const QStringList &extensions);
+ QStringList jsExtensions() const;
+
+ QString dirPath() const;
+
+protected:
+ FileContextBase() {}
+ FileContextBase(const FileContextBase &other);
+
+ QString m_filePath;
+ JsImports m_jsImports;
+ QStringList m_jsExtensions;
+};
+
+inline void FileContextBase::setFilePath(const QString &filePath)
+{
+ m_filePath = filePath;
+}
+
+inline QString FileContextBase::filePath() const
+{
+ return m_filePath;
+}
+
+inline void FileContextBase::setJsImports(const JsImports &jsImports)
+{
+ m_jsImports = jsImports;
+}
+
+inline JsImports FileContextBase::jsImports() const
+{
+ return m_jsImports;
+}
+
+inline void FileContextBase::setJsExtensions(const QStringList &extensions)
+{
+ m_jsExtensions = extensions;
+}
+
+inline QStringList FileContextBase::jsExtensions() const
+{
+ return m_jsExtensions;
+}
+
+} // namespace Internal
+} // namespace qbs
+
+#endif // QBS_FILECONTEXTBASE_H