diff --git a/src/drw_base.h b/src/drw_base.h index b90a2d7..b4dbded 100644 --- a/src/drw_base.h +++ b/src/drw_base.h @@ -103,9 +103,9 @@ BAD_READ_ENTITIES, /*!< error in entities read process. */ BAD_READ_OBJECTS /*!< error in objects read process. */ }; -enum DBG_LEVEL { - NONE, - DEBUG +enum class DebugLevel { + None, + Debug }; //! Special codes for colors diff --git a/src/drw_entities.cpp b/src/drw_entities.cpp index 2957016..dd566f0 100644 --- a/src/drw_entities.cpp +++ b/src/drw_entities.cpp @@ -1267,7 +1267,7 @@ bool DRW_LWPolyline::parseDwg(DRW::Version version, dwgBuffer *buf, duint32 bs){ } } } - if (DRW_DBGGL == DRW_dbg::DEBUG){ + if (DRW_DBGGL == DRW_dbg::Level::Debug){ DRW_DBG("\nVertex list: "); for (auto& pv: vertlist) { DRW_DBG("\n x: "); DRW_DBG(pv->x); DRW_DBG(" y: "); DRW_DBG(pv->y); DRW_DBG(" bulge: "); DRW_DBG(pv->bulge); @@ -2155,7 +2155,7 @@ bool DRW_Spline::parseDwg(DRW::Version version, dwgBuffer *buf, duint32 bs){ for (dint32 i= 0; i(buf->get3BitDouble())); - if (DRW_DBGGL == DRW_dbg::DEBUG){ + if (DRW_DBGGL == DRW_dbg::Level::Debug){ DRW_DBG("\nknots list: "); for (auto const& v: knotslist) { DRW_DBG("\n"); DRW_DBG(v); diff --git a/src/drw_header.cpp b/src/drw_header.cpp index 94bea5c..5243f03 100644 --- a/src/drw_header.cpp +++ b/src/drw_header.cpp @@ -2362,7 +2362,7 @@ bool DRW_Header::parseDwg(DRW::Version version, dwgBuffer *buf, dwgBuffer *hBbuf DRW_DBG("\nstring buf position: "); DRW_DBG(buf->getPosition()); DRW_DBG(" string buf bit position: "); DRW_DBG(buf->getBitPos()); - if (DRW_DBGGL == DRW_dbg::DEBUG){ + if (DRW_DBGGL == DRW_dbg::Level::Debug){ for (std::map::iterator it=vars.begin(); it!=vars.end(); ++it){ DRW_DBG("\n"); DRW_DBG(it->first); DRW_DBG(": "); switch (it->second->type()){ diff --git a/src/intern/drw_dbg.cpp b/src/intern/drw_dbg.cpp index 0e0a5ea..4ad64b1 100644 --- a/src/intern/drw_dbg.cpp +++ b/src/intern/drw_dbg.cpp @@ -58,18 +58,19 @@ DRW_dbg::DRW_dbg(){ prClass.reset( new print_none ); } -void DRW_dbg::setLevel(LEVEL lvl){ +void DRW_dbg::setLevel(Level lvl){ level = lvl; switch (level){ - case DEBUG: + case Level::Debug: prClass.reset(new print_debug); break; - default: + case Level::None: prClass.reset(new print_none); + break; } } -DRW_dbg::LEVEL DRW_dbg::getLevel(){ +DRW_dbg::Level DRW_dbg::getLevel(){ return level; } diff --git a/src/intern/drw_dbg.h b/src/intern/drw_dbg.h index 30bc9b7..3c9bffb 100644 --- a/src/intern/drw_dbg.h +++ b/src/intern/drw_dbg.h @@ -31,12 +31,12 @@ class print_none; class DRW_dbg { public: - enum LEVEL { - NONE, - DEBUG + enum class Level { + None, + Debug }; - void setLevel(LEVEL lvl); - LEVEL getLevel(); + void setLevel(Level lvl); + Level getLevel(); static DRW_dbg *getInstance(); void print(const std::string& s); void print(int i); @@ -53,7 +53,7 @@ class DRW_dbg { private: DRW_dbg(); static DRW_dbg *instance; - LEVEL level{NONE}; + Level level{Level::None}; std::ios_base::fmtflags flags{std::cerr.flags()}; std::unique_ptr prClass; }; diff --git a/src/intern/dwgreader.cpp b/src/intern/dwgreader.cpp index 5be9529..d1363f8 100644 --- a/src/intern/dwgreader.cpp +++ b/src/intern/dwgreader.cpp @@ -613,7 +613,7 @@ bool dwgReader::readDwgTables(DRW_Header& hdr, dwgBuffer *dbuf) { } //RLZ: parse remaining object controls, TODO: implement all - if (DRW_DBGGL == DRW_dbg::DEBUG){ + if (DRW_DBGGL == DRW_dbg::Level::Debug){ mit = ObjectMap.find(hdr.viewCtrl); if (mit==ObjectMap.end()) { DRW_DBG("\nWARNING: View control not found\n"); @@ -1182,7 +1182,7 @@ bool dwgReader::readDwgObjects(DRW_Interface& intfa, dwgBuffer *dbuf){ if (ret) ret = ret2; } - if (DRW_DBGGL == DRW_dbg::DEBUG) { + if (DRW_DBGGL == DRW_dbg::Level::Debug) { for (std::map::iterator it=remainingMap.begin(); it != remainingMap.end(); ++it){ DRW_DBG("\nnum.# "); DRW_DBG(i++); DRW_DBG(" Remaining object Handle, loc, type= "); DRW_DBG(it->first); DRW_DBG(" "); DRW_DBG(it->second.loc); DRW_DBG(" "); DRW_DBG(it->second.type); diff --git a/src/libdwgr.cpp b/src/libdwgr.cpp index 7a38468..a577272 100644 --- a/src/libdwgr.cpp +++ b/src/libdwgr.cpp @@ -38,18 +38,18 @@ dwgR::dwgR(const char* name) : fileName{ name } { - DRW_DBGSL(DRW_dbg::NONE); + DRW_DBGSL(DRW_dbg::Level::None); } dwgR::~dwgR() = default; -void dwgR::setDebug(DRW::DBG_LEVEL lvl){ +void dwgR::setDebug(DRW::DebugLevel lvl){ switch (lvl){ - case DRW::DEBUG: - DRW_DBGSL(DRW_dbg::DEBUG); + case DRW::DebugLevel::Debug: + DRW_DBGSL(DRW_dbg::Level::Debug); break; - default: - DRW_DBGSL(DRW_dbg::NONE); + case DRW::DebugLevel::None: + DRW_DBGSL(DRW_dbg::Level::None); } } diff --git a/src/libdwgr.h b/src/libdwgr.h index c15eee8..64c4530 100644 --- a/src/libdwgr.h +++ b/src/libdwgr.h @@ -34,7 +34,7 @@ class dwgR { DRW::Version getVersion(){return version;} DRW::error getError(){return error;} bool testReader(); - void setDebug(DRW::DBG_LEVEL lvl); + void setDebug(DRW::DebugLevel lvl); private: bool openFile(std::ifstream *filestr); diff --git a/src/libdxfrw.cpp b/src/libdxfrw.cpp index 105039f..8714f74 100644 --- a/src/libdxfrw.cpp +++ b/src/libdxfrw.cpp @@ -33,7 +33,7 @@ };*/ dxfRW::dxfRW(const char* name){ - DRW_DBGSL(DRW_dbg::NONE); + DRW_DBGSL(DRW_dbg::Level::None); fileName = name; reader = NULL; writer = NULL; @@ -51,13 +51,13 @@ dxfRW::~dxfRW(){ imageDef.clear(); } -void dxfRW::setDebug(DRW::DBG_LEVEL lvl){ +void dxfRW::setDebug(DRW::DebugLevel lvl){ switch (lvl){ - case DRW::DEBUG: - DRW_DBGSL(DRW_dbg::DEBUG); + case DRW::DebugLevel::Debug: + DRW_DBGSL(DRW_dbg::Level::Debug); break; - default: - DRW_DBGSL(DRW_dbg::NONE); + case DRW::DebugLevel::None: + DRW_DBGSL(DRW_dbg::Level::None); } } diff --git a/src/libdxfrw.h b/src/libdxfrw.h index fdec45a..82d140b 100644 --- a/src/libdxfrw.h +++ b/src/libdxfrw.h @@ -27,7 +27,7 @@ class dxfRW { public: dxfRW(const char* name); ~dxfRW(); - void setDebug(DRW::DBG_LEVEL lvl); + void setDebug(DRW::DebugLevel lvl); /// reads the file specified in constructor /*! * An interface must be provided. It is used by the class to signal various