1 // 2 // C++ Interface: parserm3u 3 // 4 // Description: Interface header parse Comma-Separated Values (CSV) formatted playlists (rfc4180) 5 // 6 // 7 // Author: Ingo Kossyk <kossyki@cs.tu-berlin.de>, (C) 2004 8 // Author: Tobias Rafreider trafreider@mixxx.org, (C) 2011 9 // Author: Daniel Schürmann daschuer@gmx.de, (C) 2011 10 // 11 // Copyright: See COPYING file that comes with this distribution 12 // 13 // 14 #pragma once 15 16 #include <QList> 17 #include <QString> 18 #include <QByteArray> 19 20 #include "library/parser.h" 21 #include "library/basesqltablemodel.h" 22 23 class ParserCsv : public Parser 24 { 25 Q_OBJECT 26 public: 27 ParserCsv(); 28 virtual ~ParserCsv(); 29 /**Overwriting function parse in class Parser**/ 30 QList<QString> parse(const QString&); 31 // Playlist Export 32 static bool writeCSVFile(const QString &file, BaseSqlTableModel* pPlaylistTableModel, bool useRelativePath); 33 // Readable Text export 34 static bool writeReadableTextFile(const QString &file, BaseSqlTableModel* pPlaylistTableModel, bool writeTimestamp); 35 private: 36 /**Reads a line from the file and returns filepath if a valid file**/ 37 QList<QList<QString> > tokenize(const QByteArray& str, char delimiter); 38 39 40 }; 41