| 1 |
/* |
| 2 |
* This file is part of the API Extractor project. |
| 3 |
* |
| 4 |
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 5 |
* |
| 6 |
* Contact: PySide team <contact@pyside.org> |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU General Public License |
| 10 |
* version 2 as published by the Free Software Foundation. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, but |
| 13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 20 |
* 02110-1301 USA |
| 21 |
* |
| 22 |
*/ |
| 23 |
|
| 24 |
#include "include.h" |
| 25 |
#include <QTextStream> |
| 26 |
#include <QHash> |
| 27 |
|
| 28 |
QString Include::toString() const |
| 29 |
{ |
| 30 |
if (m_type == IncludePath) |
| 31 |
return "#include <" + m_name + '>'; |
| 32 |
else if (m_type == LocalPath) |
| 33 |
return "#include \"" + m_name + "\""; |
| 34 |
else |
| 35 |
return "import " + m_name + ";"; |
| 36 |
} |
| 37 |
|
| 38 |
uint qHash(const Include& inc) |
| 39 |
{ |
| 40 |
return qHash(inc.m_name); |
| 41 |
} |
| 42 |
|
| 43 |
QTextStream& operator<<(QTextStream& out, const Include& include) |
| 44 |
{ |
| 45 |
if (include.isValid()) |
| 46 |
out << include.toString() << endl; |
| 47 |
return out; |
| 48 |
} |