@@ -175,7 +175,7 @@ void ElementHashtable::ShowContainerInfo(const QString& fileName)
|
|||||||
{
|
{
|
||||||
QString relPath="./../output/";
|
QString relPath="./../output/";
|
||||||
relPath+=fileName+".txt";
|
relPath+=fileName+".txt";
|
||||||
QFile file(relPath.toLocal8Bit());
|
QFile file(relPath);
|
||||||
if(file.open(QFile::WriteOnly|QFile::Text))
|
if(file.open(QFile::WriteOnly|QFile::Text))
|
||||||
{
|
{
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
|
|||||||
@@ -3,9 +3,12 @@
|
|||||||
#include "regexextract.h"
|
#include "regexextract.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include "readwrite.h"
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
|
// ReadWrite aa;
|
||||||
|
// return a.exec();
|
||||||
ElementHashtable eleReader;
|
ElementHashtable eleReader;
|
||||||
eleReader.Parse("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml","D:/Project/佛山项目/佛山收资/exportmodel_zwyth20141204/exportmodel_zwyth.xml");
|
eleReader.Parse("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml","D:/Project/佛山项目/佛山收资/exportmodel_zwyth20141204/exportmodel_zwyth.xml");
|
||||||
// eleReader.GoPath();
|
// eleReader.GoPath();
|
||||||
|
|||||||
30
testHasttable/readwrite.cpp
Normal file
30
testHasttable/readwrite.cpp
Normal file
@@ -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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
15
testHasttable/readwrite.h
Normal file
15
testHasttable/readwrite.h
Normal file
@@ -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/line.cpp \
|
||||||
element/transformer.cpp \
|
element/transformer.cpp \
|
||||||
element/switch.cpp \
|
element/switch.cpp \
|
||||||
task.cpp
|
task.cpp \
|
||||||
|
readwrite.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
elementhashtable.h \
|
elementhashtable.h \
|
||||||
@@ -60,7 +61,8 @@ HEADERS += \
|
|||||||
element/line.h \
|
element/line.h \
|
||||||
element/transformer.h \
|
element/transformer.h \
|
||||||
element/switch.h \
|
element/switch.h \
|
||||||
task.h
|
task.h \
|
||||||
|
readwrite.h
|
||||||
|
|
||||||
#release{
|
#release{
|
||||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||||
|
|||||||
Reference in New Issue
Block a user