#include <vabstractconverter.h>
Public Member Functions | |
VAbstractConverter (const QString &fileName) | |
virtual | ~VAbstractConverter () Q_DECL_EQ_DEFAULT |
QString | Convert () |
int | GetCurrentFormatVarsion () const |
QString | GetVersionStr () const |
Public Member Functions inherited from VDomDocument | |
VDomDocument () | |
virtual | ~VDomDocument () Q_DECL_EQ_DEFAULT |
QDomElement | elementById (quint32 id, const QString &tagName=QString()) |
template<typename T > | |
void | SetAttribute (QDomElement &domElement, const QString &name, const T &value) const |
SetAttribute set attribute in pattern file. Replace "," by ".". More... | |
Unit | MUnit () const |
virtual void | setXMLContent (const QString &fileName) |
virtual bool | SaveDocument (const QString &fileName, QString &error) |
QString | Major () const |
QString | Minor () const |
QString | Patch () const |
QDomNode | ParentNodeById (const quint32 &nodeId) |
QDomElement | CloneNodeById (const quint32 &nodeId) |
QDomElement | NodeById (const quint32 &nodeId) |
QVector< VLabelTemplateLine > | GetLabelTemplate (const QDomElement &element) const |
void | SetLabelTemplate (QDomElement &element, const QVector< VLabelTemplateLine > &lines) |
template<> | |
void | SetAttribute (QDomElement &domElement, const QString &name, const QString &value) const |
template<> | |
void | SetAttribute (QDomElement &domElement, const QString &name, const bool &value) const |
template<> | |
void | SetAttribute (QDomElement &domElement, const QString &name, const MeasurementsType &value) const |
Static Public Member Functions | |
static int | GetVersion (const QString &version) |
Static Public Member Functions inherited from VDomDocument | |
static quint32 | GetParametrUInt (const QDomElement &domElement, const QString &name, const QString &defValue) |
Returns the long long value of the given attribute. RENAME: GetParameterLongLong? More... | |
static bool | getParameterBool (const QDomElement &domElement, const QString &name, const QString &defValue) |
static NodeUsage | GetParametrUsage (const QDomElement &domElement, const QString &name) |
static void | SetParametrUsage (QDomElement &domElement, const QString &name, const NodeUsage &value) |
static QString | GetParametrString (const QDomElement &domElement, const QString &name, const QString &defValue=QString()) |
Returns the string value of the given attribute. RENAME: see above. More... | |
static QString | GetParametrEmptyString (const QDomElement &domElement, const QString &name) |
static qreal | GetParametrDouble (const QDomElement &domElement, const QString &name, const QString &defValue) |
Returns the double value of the given attribute. More... | |
static quint32 | getParameterId (const QDomElement &domElement) |
getParameterId return value id attribute. More... | |
static void | ValidateXML (const QString &schema, const QString &fileName) |
ValidateXML validate xml file by xsd schema. More... | |
static QString | UnitsHelpString () |
static void | RemoveAllChildren (QDomElement &domElement) |
RemoveAllChildren remove all children from file. More... | |
static bool | SafeCopy (const QString &source, const QString &destination, QString &error) |
Protected Member Functions | |
void | ValidateInputFile (const QString ¤tSchema) const |
Q_NORETURN void | InvalidVersion (int ver) const |
void | Save () |
void | SetVersion (const QString &version) |
virtual int | MinVer () const =0 |
virtual int | MaxVer () const =0 |
virtual QString | MinVerStr () const =0 |
virtual QString | MaxVerStr () const =0 |
virtual QString | XSDSchema (int ver) const =0 |
virtual void | ApplyPatches ()=0 |
virtual void | DowngradeToCurrentMaxVersion ()=0 |
virtual bool | IsReadOnly () const =0 |
void | Replace (QString &formula, const QString &newName, int position, const QString &token, int &bias) const |
void | CorrectionsPositions (int position, int bias, QMap< int, QString > &tokens) const |
Protected Member Functions inherited from VDomDocument | |
bool | setTagText (const QString &tag, const QString &text) |
bool | setTagText (const QDomElement &domElement, const QString &text) |
QString | UniqueTagText (const QString &tagName, const QString &defVal=QString()) const |
void | TestUniqueId () const |
TestUniqueId test exist unique id in pattern file. Each id must be unique. More... | |
void | CollectId (const QDomElement &node, QVector< quint32 > &vector) const |
Static Protected Member Functions | |
static void | BiasTokens (int position, int bias, QMap< int, QString > &tokens) |
Protected Attributes | |
int | m_ver |
QString | m_convertedFileName |
Private Member Functions | |
void | ReserveFile () const |
Static Private Member Functions | |
static void | ValidateVersion (const QString &version) |
static QString | removeVersionNumber (const QString &fileName) |
Removes version number from. More... | |
static QString | removeBakExtension (const QString &fileName) |
Removes single or repeated '.bak' extension (as long as it is at the end of. More... | |
Private Attributes | |
QTemporaryFile | m_tmpFile |
Additional Inherited Members | |
Static Public Attributes inherited from VDomDocument | |
static const QString | AttrId = QStringLiteral("id") |
static const QString | AttrText = QStringLiteral("text") |
static const QString | AttrBold = QStringLiteral("bold") |
static const QString | AttrItalic = QStringLiteral("italic") |
static const QString | AttrAlignment = QStringLiteral("alignment") |
static const QString | AttrFSIncrement = QStringLiteral("sfIncrement") |
static const QString | TagVersion = QStringLiteral("version") |
static const QString | TagUnit = QStringLiteral("unit") |
static const QString | TagLine = QStringLiteral("line") |
Definition at line 73 of file vabstractconverter.h.
|
explicit |
Definition at line 75 of file vabstractconverter.cpp.
References GetVersion(), GetVersionStr(), m_convertedFileName, m_ver, and VDomDocument::setXMLContent().
|
virtual |
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by Convert().
|
staticprotected |
Definition at line 323 of file vabstractconverter.cpp.
Referenced by CorrectionsPositions().
QString VAbstractConverter::Convert | ( | ) |
Definition at line 88 of file vabstractconverter.cpp.
References ApplyPatches(), DowngradeToCurrentMaxVersion(), IsReadOnly(), m_convertedFileName, m_tmpFile, m_ver, MaxVer(), and ReserveFile().
Referenced by MainWindow::CheckPathToMeasurements(), QT_WARNING_POP::createUnion(), TMainWindow::ImportFromPattern(), TMainWindow::LoadFile(), TMainWindow::LoadFromExistingFile(), MainWindow::LoadPattern(), and MainWindow::OpenMeasurementFile().
|
protected |
Definition at line 312 of file vabstractconverter.cpp.
References BiasTokens().
Referenced by VPatternConverter::FixIncrementInFormulaToV0_2_0(), and VPatternConverter::FixMeasurementInFormulaToV0_2_0().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by Convert().
int VAbstractConverter::GetCurrentFormatVarsion | ( | ) | const |
Definition at line 119 of file vabstractconverter.cpp.
References m_ver.
Referenced by TMainWindow::LoadFile(), TMainWindow::LoadFromExistingFile(), and MainWindow::LoadPattern().
|
static |
Definition at line 154 of file vabstractconverter.cpp.
References ValidateVersion().
Referenced by VAbstractConverter().
QString VAbstractConverter::GetVersionStr | ( | ) | const |
Definition at line 125 of file vabstractconverter.cpp.
References VDomDocument::TagVersion.
Referenced by TMainWindow::LoadFile(), TMainWindow::LoadFromExistingFile(), MainWindow::LoadPattern(), ReserveFile(), and VAbstractConverter().
|
protected |
Definition at line 343 of file vabstractconverter.cpp.
References MaxVer(), MaxVerStr(), MinVer(), and MinVerStr().
Referenced by VLabelTemplateConverter::ApplyPatches(), VPatternConverter::ApplyPatches(), VVITConverter::ApplyPatches(), VVSTConverter::ApplyPatches(), VLabelTemplateConverter::XSDSchema(), VPatternConverter::XSDSchema(), VVITConverter::XSDSchema(), and VVSTConverter::XSDSchema().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by Convert(), and ReserveFile().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by Convert(), InvalidVersion(), and ValidateInputFile().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by InvalidVersion().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by InvalidVersion(), and ValidateInputFile().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by InvalidVersion().
|
staticprivate |
Removes single or repeated '.bak' extension (as long as it is at the end of.
Definition at line 228 of file vabstractconverter.cpp.
Referenced by ReserveFile().
|
staticprivate |
Removes version number from.
It removes both, "old style" ie. "(v0.6.0)" and new style "v060" patterns.
Definition at line 184 of file vabstractconverter.cpp.
Referenced by ReserveFile().
|
protected |
Definition at line 304 of file vabstractconverter.cpp.
Referenced by VPatternConverter::FixIncrementInFormulaToV0_2_0(), and VPatternConverter::FixMeasurementInFormulaToV0_2_0().
|
private |
Definition at line 261 of file vabstractconverter.cpp.
References GetVersionStr(), IsReadOnly(), m_convertedFileName, removeBakExtension(), removeVersionNumber(), and VDomDocument::SafeCopy().
Referenced by Convert().
|
protected |
Definition at line 399 of file vabstractconverter.cpp.
References m_tmpFile, and VDomDocument::TestUniqueId().
Referenced by VLabelTemplateConverter::DowngradeToCurrentMaxVersion(), VPatternConverter::DowngradeToCurrentMaxVersion(), VVITConverter::DowngradeToCurrentMaxVersion(), VVSTConverter::DowngradeToCurrentMaxVersion(), VVITConverter::ToV0_3_0(), VVITConverter::ToV0_3_1(), VVITConverter::ToV0_3_2(), VVITConverter::ToV0_3_3(), VVSTConverter::ToV0_4_0(), VVSTConverter::ToV0_4_1(), VVSTConverter::ToV0_4_2(), VVSTConverter::ToV0_4_3(), VVSTConverter::ToV0_4_4(), VPatternConverter::toVersion0_1_1(), VPatternConverter::toVersion0_1_2(), VPatternConverter::toVersion0_1_3(), VPatternConverter::toVersion0_1_4(), VPatternConverter::toVersion0_2_0(), VPatternConverter::toVersion0_2_1(), VPatternConverter::toVersion0_2_2(), VPatternConverter::toVersion0_2_3(), VPatternConverter::toVersion0_2_4(), VPatternConverter::toVersion0_2_5(), VPatternConverter::toVersion0_2_6(), VPatternConverter::toVersion0_2_7(), VPatternConverter::toVersion0_3_0(), VPatternConverter::toVersion0_3_1(), VPatternConverter::toVersion0_3_2(), VPatternConverter::toVersion0_3_3(), VPatternConverter::toVersion0_3_4(), VPatternConverter::toVersion0_3_5(), VPatternConverter::toVersion0_3_6(), VPatternConverter::toVersion0_3_7(), VPatternConverter::toVersion0_3_8(), VPatternConverter::toVersion0_3_9(), VPatternConverter::toVersion0_4_0(), VPatternConverter::toVersion0_4_1(), VPatternConverter::toVersion0_4_2(), VPatternConverter::toVersion0_4_3(), VPatternConverter::toVersion0_4_4(), VPatternConverter::toVersion0_4_5(), VPatternConverter::toVersion0_4_6(), VPatternConverter::toVersion0_4_7(), VPatternConverter::toVersion0_4_8(), VPatternConverter::toVersion0_5_0(), VPatternConverter::toVersion0_5_1(), VPatternConverter::toVersion0_6_0(), VPatternConverter::toVersion0_6_1(), VPatternConverter::toVersion0_6_2(), VPatternConverter::toVersion0_6_3(), VPatternConverter::toVersion0_6_4(), VPatternConverter::toVersion0_6_5(), VPatternConverter::toVersion0_6_6(), VPatternConverter::toVersion0_6_7(), and VPatternConverter::toVersion0_6_8().
|
protected |
Definition at line 426 of file vabstractconverter.cpp.
References VDomDocument::setTagText(), VDomDocument::TagVersion, and ValidateVersion().
Referenced by VLabelTemplateConverter::DowngradeToCurrentMaxVersion(), VPatternConverter::DowngradeToCurrentMaxVersion(), VVITConverter::DowngradeToCurrentMaxVersion(), VVSTConverter::DowngradeToCurrentMaxVersion(), VVITConverter::ToV0_3_0(), VVITConverter::ToV0_3_1(), VVITConverter::ToV0_3_2(), VVITConverter::ToV0_3_3(), VVSTConverter::ToV0_4_0(), VVSTConverter::ToV0_4_1(), VVSTConverter::ToV0_4_2(), VVSTConverter::ToV0_4_3(), VVSTConverter::ToV0_4_4(), VPatternConverter::toVersion0_1_1(), VPatternConverter::toVersion0_1_2(), VPatternConverter::toVersion0_1_3(), VPatternConverter::toVersion0_1_4(), VPatternConverter::toVersion0_2_0(), VPatternConverter::toVersion0_2_1(), VPatternConverter::toVersion0_2_2(), VPatternConverter::toVersion0_2_3(), VPatternConverter::toVersion0_2_4(), VPatternConverter::toVersion0_2_5(), VPatternConverter::toVersion0_2_6(), VPatternConverter::toVersion0_2_7(), VPatternConverter::toVersion0_3_0(), VPatternConverter::toVersion0_3_1(), VPatternConverter::toVersion0_3_2(), VPatternConverter::toVersion0_3_3(), VPatternConverter::toVersion0_3_4(), VPatternConverter::toVersion0_3_5(), VPatternConverter::toVersion0_3_6(), VPatternConverter::toVersion0_3_7(), VPatternConverter::toVersion0_3_8(), VPatternConverter::toVersion0_3_9(), VPatternConverter::toVersion0_4_0(), VPatternConverter::toVersion0_4_1(), VPatternConverter::toVersion0_4_2(), VPatternConverter::toVersion0_4_3(), VPatternConverter::toVersion0_4_4(), VPatternConverter::toVersion0_4_5(), VPatternConverter::toVersion0_4_6(), VPatternConverter::toVersion0_4_7(), VPatternConverter::toVersion0_4_8(), VPatternConverter::toVersion0_5_0(), VPatternConverter::toVersion0_5_1(), VPatternConverter::toVersion0_6_0(), VPatternConverter::toVersion0_6_1(), VPatternConverter::toVersion0_6_2(), VPatternConverter::toVersion0_6_3(), VPatternConverter::toVersion0_6_4(), VPatternConverter::toVersion0_6_5(), VPatternConverter::toVersion0_6_6(), VPatternConverter::toVersion0_6_7(), and VPatternConverter::toVersion0_6_8().
|
protected |
Definition at line 362 of file vabstractconverter.cpp.
References m_convertedFileName, m_ver, MaxVer(), MinVer(), VDomDocument::ValidateXML(), and XSDSchema().
Referenced by VLabelTemplateConverter::VLabelTemplateConverter(), VVITConverter::VVITConverter(), and VVSTConverter::VVSTConverter().
|
staticprivate |
Definition at line 243 of file vabstractconverter.cpp.
Referenced by GetVersion(), and SetVersion().
|
protectedpure virtual |
Implemented in VVSTConverter, VVITConverter, VPatternConverter, and VLabelTemplateConverter.
Referenced by ValidateInputFile().
|
protected |
Definition at line 89 of file vabstractconverter.h.
Referenced by VPatternConverter::ApplyPatches(), VVITConverter::ApplyPatches(), VVSTConverter::ApplyPatches(), Convert(), ReserveFile(), VPatternConverter::TagMeasurementsToV0_2_0(), VAbstractConverter(), and ValidateInputFile().
|
private |
Definition at line 116 of file vabstractconverter.h.
|
protected |
Definition at line 88 of file vabstractconverter.h.
Referenced by VLabelTemplateConverter::ApplyPatches(), VPatternConverter::ApplyPatches(), VVITConverter::ApplyPatches(), VVSTConverter::ApplyPatches(), Convert(), GetCurrentFormatVarsion(), VAbstractConverter(), and ValidateInputFile().