Add a using-declaration to derived class to inherit the constructors, and remove the ones manually duplicated.
This commit is contained in:
parent
587d7aadd4
commit
2f53e38ad7
|
@ -15,12 +15,14 @@
|
||||||
|
|
||||||
#include "drw_textcodec.h"
|
#include "drw_textcodec.h"
|
||||||
|
|
||||||
class dxfWriter {
|
class dxfWriter
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
explicit dxfWriter(std::ofstream *stream)
|
explicit dxfWriter(std::ofstream *stream)
|
||||||
: filestr(stream),
|
: filestr(stream),
|
||||||
encoder()
|
encoder()
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~dxfWriter() = default;
|
virtual ~dxfWriter() = default;
|
||||||
virtual auto writeString(int code, std::string text) -> bool = 0;
|
virtual auto writeString(int code, std::string text) -> bool = 0;
|
||||||
|
@ -32,22 +34,23 @@ public:
|
||||||
virtual auto writeInt64(int code, unsigned long long int data) -> bool = 0;
|
virtual auto writeInt64(int code, unsigned long long int data) -> bool = 0;
|
||||||
virtual auto writeDouble(int code, double data) -> bool = 0;
|
virtual auto writeDouble(int code, double data) -> bool = 0;
|
||||||
virtual auto writeBool(int code, bool data) -> bool = 0;
|
virtual auto writeBool(int code, bool data) -> bool = 0;
|
||||||
void setVersion(const std::string &v, bool dxfFormat){encoder.setVersion(v, dxfFormat);}
|
void setVersion(const std::string &v, bool dxfFormat) { encoder.setVersion(v, dxfFormat); }
|
||||||
void setCodePage(const std::string &c){encoder.setCodePage(c, true);}
|
void setCodePage(const std::string &c) { encoder.setCodePage(c, true); }
|
||||||
auto getCodePage() const -> std::string { return encoder.getCodePage(); }
|
auto getCodePage() const -> std::string { return encoder.getCodePage(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::ofstream *filestr;
|
std::ofstream *filestr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY_MOVE(dxfWriter) // NOLINT
|
Q_DISABLE_COPY_MOVE(dxfWriter) // NOLINT
|
||||||
DRW_TextCodec encoder;
|
DRW_TextCodec encoder;
|
||||||
};
|
};
|
||||||
|
|
||||||
class dxfWriterBinary : public dxfWriter {
|
class dxfWriterBinary : public dxfWriter
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
explicit dxfWriterBinary(std::ofstream *stream)
|
using dxfWriter::dxfWriter;
|
||||||
: dxfWriter(stream)
|
|
||||||
{}
|
|
||||||
virtual ~dxfWriterBinary() = default;
|
virtual ~dxfWriterBinary() = default;
|
||||||
virtual auto writeString(int code, std::string text) -> bool override;
|
virtual auto writeString(int code, std::string text) -> bool override;
|
||||||
virtual auto writeInt16(int code, int data) -> bool override;
|
virtual auto writeInt16(int code, int data) -> bool override;
|
||||||
|
@ -57,7 +60,8 @@ public:
|
||||||
virtual auto writeBool(int code, bool data) -> bool override;
|
virtual auto writeBool(int code, bool data) -> bool override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class dxfWriterAscii final : public dxfWriter {
|
class dxfWriterAscii final : public dxfWriter
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
explicit dxfWriterAscii(std::ofstream *stream);
|
explicit dxfWriterAscii(std::ofstream *stream);
|
||||||
virtual ~dxfWriterAscii() = default;
|
virtual ~dxfWriterAscii() = default;
|
||||||
|
|
|
@ -52,10 +52,7 @@ struct DestinationItem
|
||||||
|
|
||||||
struct VAbstractOperationInitData : VDrawToolInitData
|
struct VAbstractOperationInitData : VDrawToolInitData
|
||||||
{
|
{
|
||||||
VAbstractOperationInitData()
|
using VDrawToolInitData::VDrawToolInitData;
|
||||||
: VDrawToolInitData()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QString suffix{};
|
QString suffix{};
|
||||||
QVector<SourceItem> source{};
|
QVector<SourceItem> source{};
|
||||||
|
|
|
@ -46,10 +46,7 @@ class VFormula;
|
||||||
|
|
||||||
struct VToolCutInitData : VToolSinglePointInitData
|
struct VToolCutInitData : VToolSinglePointInitData
|
||||||
{
|
{
|
||||||
VToolCutInitData()
|
using VToolSinglePointInitData::VToolSinglePointInitData;
|
||||||
: VToolSinglePointInitData()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
quint32 baseCurveId{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes)
|
quint32 baseCurveId{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||||
QString formula{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
QString formula{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||||
|
|
|
@ -43,10 +43,7 @@ template <class T> class QSharedPointer;
|
||||||
|
|
||||||
struct VToolLinePointInitData : VToolSinglePointInitData
|
struct VToolLinePointInitData : VToolSinglePointInitData
|
||||||
{
|
{
|
||||||
VToolLinePointInitData()
|
using VToolSinglePointInitData::VToolSinglePointInitData;
|
||||||
: VToolSinglePointInitData()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QString typeLine{TypeLineLine};
|
QString typeLine{TypeLineLine};
|
||||||
QString lineColor{ColorBlack};
|
QString lineColor{ColorBlack};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user