2014-12-10 18:18:22 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vabstractconverter.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 10 12, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2014 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VABSTRACTCONVERTER_H
|
|
|
|
#define VABSTRACTCONVERTER_H
|
|
|
|
|
2014-12-11 16:12:16 +01:00
|
|
|
#include "vdomdocument.h"
|
2014-12-10 18:18:22 +01:00
|
|
|
|
2014-12-11 16:12:16 +01:00
|
|
|
class VAbstractConverter :public VDomDocument
|
2014-12-10 18:18:22 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2014-12-11 16:51:24 +01:00
|
|
|
VAbstractConverter(const QString &fileName);
|
2014-12-11 20:44:48 +01:00
|
|
|
virtual ~VAbstractConverter();
|
|
|
|
|
2014-12-11 21:54:33 +01:00
|
|
|
void Convert() const;
|
|
|
|
|
2014-12-11 20:44:48 +01:00
|
|
|
protected:
|
2014-12-11 21:16:03 +01:00
|
|
|
int ver;
|
2014-12-11 21:54:33 +01:00
|
|
|
QString fileName;
|
2014-12-11 21:16:03 +01:00
|
|
|
|
|
|
|
int GetVersion(const QString &version) const;
|
|
|
|
void CheckVersion(int ver) const;
|
2014-12-11 20:44:48 +01:00
|
|
|
|
|
|
|
virtual int MinVer() const =0;
|
|
|
|
virtual int MaxVer() const =0;
|
|
|
|
|
|
|
|
virtual QString MinVerStr() const =0;
|
|
|
|
virtual QString MaxVerStr() const =0;
|
2014-12-11 16:12:16 +01:00
|
|
|
|
2014-12-11 21:16:03 +01:00
|
|
|
virtual QString XSDSchema(int ver) const =0;
|
2014-12-11 21:54:33 +01:00
|
|
|
virtual void ApplyPatches() const =0;
|
2014-12-11 21:16:03 +01:00
|
|
|
|
2014-12-11 16:12:16 +01:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(VAbstractConverter)
|
2014-12-11 16:51:24 +01:00
|
|
|
|
|
|
|
QString GetVersionStr() const;
|
2014-12-11 19:40:26 +01:00
|
|
|
|
2014-12-11 20:44:48 +01:00
|
|
|
void ValidateVersion(const QString &version) const;
|
2014-12-10 18:18:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VABSTRACTCONVERTER_H
|