解决了。只要保存为ASCI码,不用做其他处理就行了。
Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
parent
bdb5c72fa2
commit
d7e28294db
|
|
@ -175,7 +175,7 @@ void ElementHashtable::ShowContainerInfo(const QString& fileName)
|
|||
{
|
||||
QString relPath="./../output/";
|
||||
relPath+=fileName+".txt";
|
||||
QFile file(relPath.toLocal8Bit());
|
||||
QFile file(relPath);
|
||||
if(file.open(QFile::WriteOnly|QFile::Text))
|
||||
{
|
||||
QTextStream stream(&file);
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@
|
|||
#include "regexextract.h"
|
||||
#include "task.h"
|
||||
#include <iostream>
|
||||
#include "readwrite.h"
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
// ReadWrite aa;
|
||||
// return a.exec();
|
||||
ElementHashtable eleReader;
|
||||
eleReader.Parse("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml","D:/Project/佛山项目/佛山收资/exportmodel_zwyth20141204/exportmodel_zwyth.xml");
|
||||
// eleReader.GoPath();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
#include "readwrite.h"
|
||||
|
||||
ReadWrite::ReadWrite()
|
||||
{
|
||||
QFile in("./../task.txt");
|
||||
QString line;
|
||||
QStringList sep;
|
||||
if(in.open(QFile::ReadOnly|QFile::Text))
|
||||
{
|
||||
QTextStream instream(&in);
|
||||
line=instream.readLine();
|
||||
sep=line.split(",");
|
||||
// QFile out(QString("./../output/")+line.section(",",0,0));
|
||||
QFile out(QString("./../output/")+sep.at(0));
|
||||
if(out.open(QFile::WriteOnly))
|
||||
{
|
||||
QTextStream outstream(&out);
|
||||
outstream<<"fsdf";
|
||||
out.close();
|
||||
}
|
||||
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
ReadWrite::~ReadWrite()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef READWRITE_H
|
||||
#define READWRITE_H
|
||||
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QStringList>
|
||||
class ReadWrite
|
||||
{
|
||||
public:
|
||||
ReadWrite();
|
||||
~ReadWrite();
|
||||
};
|
||||
|
||||
#endif // READWRITE_H
|
||||
|
|
@ -37,7 +37,8 @@ SOURCES += main.cpp \
|
|||
element/line.cpp \
|
||||
element/transformer.cpp \
|
||||
element/switch.cpp \
|
||||
task.cpp
|
||||
task.cpp \
|
||||
readwrite.cpp
|
||||
|
||||
HEADERS += \
|
||||
elementhashtable.h \
|
||||
|
|
@ -60,7 +61,8 @@ HEADERS += \
|
|||
element/line.h \
|
||||
element/transformer.h \
|
||||
element/switch.h \
|
||||
task.h
|
||||
task.h \
|
||||
readwrite.h
|
||||
|
||||
#release{
|
||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
|
|
|
|||
Loading…
Reference in New Issue