X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Ffileio.cpp;h=cde23ea546e09c040cd6c3562605b078666d9c26;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=3187bedfe0b5533d85c2b93befbeabe4d5f0ec89;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/fileio.cpp b/src/base/fileio.cpp index 3187bed..cde23ea 100644 --- a/src/base/fileio.cpp +++ b/src/base/fileio.cpp @@ -22,20 +22,20 @@ #include "filterdxf1.h" #include "filterinterface.h" -RS_FileIO * RS_FileIO::uniqueInstance = NULL; +FileIO * FileIO::uniqueInstance = NULL; // Constructor -RS_FileIO::RS_FileIO() +FileIO::FileIO() { } /** * @return Instance to the unique import object. */ -/*static*/ RS_FileIO * RS_FileIO::instance() +/*static*/ FileIO * FileIO::instance() { if (!uniqueInstance) - uniqueInstance = new RS_FileIO(); + uniqueInstance = new FileIO(); return uniqueInstance; } @@ -43,7 +43,7 @@ RS_FileIO::RS_FileIO() /** * Registers a new import filter. */ -void RS_FileIO::registerFilter(RS_FilterInterface * f) +void FileIO::registerFilter(FilterInterface * f) { filterList.append(f); } @@ -51,7 +51,7 @@ void RS_FileIO::registerFilter(RS_FilterInterface * f) /** * @return List of registered filters. */ -QList RS_FileIO::getFilterList() +QList FileIO::getFilterList() { return filterList; } @@ -59,11 +59,11 @@ QList RS_FileIO::getFilterList() /** * @return Filter which can import the given file type. */ -RS_FilterInterface * RS_FileIO::getImportFilter(RS2::FormatType t) +FilterInterface * FileIO::getImportFilter(RS2::FormatType t) { for(int i=0; icanImport(t)) return f; @@ -75,11 +75,11 @@ RS_FilterInterface * RS_FileIO::getImportFilter(RS2::FormatType t) /** * @return Filter which can export the given file type. */ -RS_FilterInterface * RS_FileIO::getExportFilter(RS2::FormatType t) +FilterInterface * FileIO::getExportFilter(RS2::FormatType t) { for(int i=0; icanExport(t)) return f; @@ -97,11 +97,11 @@ RS_FilterInterface * RS_FileIO::getExportFilter(RS2::FormatType t) * it can also be a polyline, text, ... * @param file Path and name of the file to import. */ -bool RS_FileIO::fileImport(Drawing & graphic, const QString & file, RS2::FormatType type) +bool FileIO::fileImport(Drawing & graphic, const QString & file, RS2::FormatType type) { - RS_DEBUG->print("Trying to import file '%s'...", file.toAscii().data()); + DEBUG->print("Trying to import file '%s'...", file.toAscii().data()); - RS_FilterInterface * filter = NULL; + FilterInterface * filter = NULL; RS2::FormatType t = (type == RS2::FormatUnknown ? detectFormat(file) : type); filter = getImportFilter(t); @@ -109,7 +109,7 @@ bool RS_FileIO::fileImport(Drawing & graphic, const QString & file, RS2::FormatT return filter->fileImport(graphic, file, t); else { - RS_DEBUG->print(RS_Debug::D_WARNING, "RS_FileIO::fileImport: failed to import file: %s", + DEBUG->print(Debug::D_WARNING, "FileIO::fileImport: failed to import file: %s", file.toAscii().data()); } @@ -122,9 +122,9 @@ bool RS_FileIO::fileImport(Drawing & graphic, const QString & file, RS2::FormatT * * @param file Path and name of the file to import. */ -bool RS_FileIO::fileExport(Drawing & graphic, const QString & file, RS2::FormatType type) +bool FileIO::fileExport(Drawing & graphic, const QString & file, RS2::FormatType type) { - RS_DEBUG->print("RS_FileIO::fileExport"); + DEBUG->print("FileIO::fileExport"); if (type == RS2::FormatUnknown) { @@ -136,12 +136,12 @@ bool RS_FileIO::fileExport(Drawing & graphic, const QString & file, RS2::FormatT type = RS2::FormatCXF; } - RS_FilterInterface * filter = getExportFilter(type); + FilterInterface * filter = getExportFilter(type); if (filter) return filter->fileExport(graphic, file, type); - RS_DEBUG->print("RS_FileIO::fileExport: no filter found"); + DEBUG->print("FileIO::fileExport: no filter found"); return false; } @@ -149,7 +149,7 @@ bool RS_FileIO::fileExport(Drawing & graphic, const QString & file, RS2::FormatT /** * Detects and returns the file format of the given file. */ -RS2::FormatType RS_FileIO::detectFormat(const QString & file) +RS2::FormatType FileIO::detectFormat(const QString & file) { RS2::FormatType type = RS2::FormatUnknown; QFileInfo info(file); @@ -167,13 +167,13 @@ RS2::FormatType RS_FileIO::detectFormat(const QString & file) if (!f.open(QIODevice::ReadOnly)) { // Error opening file: - RS_DEBUG->print(RS_Debug::D_WARNING, - "RS_FileIO::detectFormat: Cannot open file: %s", file.toAscii().data()); + DEBUG->print(Debug::D_WARNING, + "FileIO::detectFormat: Cannot open file: %s", file.toAscii().data()); type = RS2::FormatUnknown; } else { - RS_DEBUG->print("RS_FileIO::detectFormat: Successfully opened DXF file: %s", + DEBUG->print("FileIO::detectFormat: Successfully opened DXF file: %s", file.toAscii().data()); QTextStream ts(&f);