Engauge Digitizer  2
LoadFileInfo.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "Document.h"
8 #include "LoadFileInfo.h"
9 #include "Logger.h"
10 #include <QUrl>
11 
13 {
14 }
15 
16 LoadFileInfo::~LoadFileInfo()
17 {
18 }
19 
20 bool LoadFileInfo::loadsAsDigFile (const QString &urlString) const
21 {
22  LOG4CPP_INFO_S ((*mainCat)) << "LoadFileInfo::loadsAsDigFile";
23 
24  bool success = false;
25 
26  if (urlString.length() > 0) {
27 
28  QString fileName = urlString;
29 
30  QUrl url (urlString);
31  if (url.isLocalFile ()) {
32  fileName = url.toLocalFile();
33  }
34 
35  Document document (fileName);
36 
37  success = document.successfulRead();
38  }
39 
40  return success;
41 }
bool loadsAsDigFile(const QString &urlString) const
Returns true if specified file name can be loaded as a DIG file.
bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
Definition: Document.cpp:1061
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
LoadFileInfo()
Single constructor.