summaryrefslogtreecommitdiff
path: root/src/shared/proparser/prowriter.h
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-01-14 22:58:55 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-01-25 16:53:56 +0100
commit6c7b2d1c8718a964f42c40aab33b2dc4b289d7ec (patch)
tree8ba75b9e00a0a13dcd5bc53b5378c3672bd911c0 /src/shared/proparser/prowriter.h
parent93b6820e8c3b09da1e0f7634f585fa539651e28e (diff)
downloadqt-creator-6c7b2d1c8718a964f42c40aab33b2dc4b289d7ec.tar.gz
actually edit pro files instead of rewriting them from the "AST"
that way the file formatting is better preserved.
Diffstat (limited to 'src/shared/proparser/prowriter.h')
-rw-r--r--src/shared/proparser/prowriter.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/shared/proparser/prowriter.h b/src/shared/proparser/prowriter.h
index 27a2bea92f..804c11e1d5 100644
--- a/src/shared/proparser/prowriter.h
+++ b/src/shared/proparser/prowriter.h
@@ -32,13 +32,11 @@
#include "namespace_global.h"
-#include <QtCore/QTextStream>
+#include <QStringList>
QT_BEGIN_NAMESPACE
+class QDir;
class ProFile;
-class ProValue;
-class ProItem;
-class ProBlock;
QT_END_NAMESPACE
namespace Qt4ProjectManager {
@@ -47,26 +45,12 @@ namespace Internal {
class ProWriter
{
public:
- bool write(ProFile *profile, const QString &fileName);
- QString contents(ProFile *profile);
-
-protected:
- QString fixComment(const QString &comment, const QString &indent) const;
- void writeValue(ProValue *value, const QString &indent);
- void writeOther(ProItem *item, const QString &indent);
- void writeBlock(ProBlock *block, const QString &indent);
- void writeItem(ProItem *item, const QString &indent);
-
-private:
- enum ProWriteState {
- NewLine = 0x01,
- FirstItem = 0x02,
- LastItem = 0x04
- };
-
- QTextStream m_out;
- int m_writeState;
- QString m_comment;
+ static void addFiles(ProFile *profile, QStringList *lines,
+ const QDir &proFileDir, const QStringList &filePaths,
+ const QStringList &vars);
+ static QStringList removeFiles(ProFile *profile, QStringList *lines,
+ const QDir &proFileDir, const QStringList &filePaths,
+ const QStringList &vars);
};
} // namespace Internal