Reading only layers names: how do I stop parsing?
Moderator: andrew
-
- Registered Member
- Posts: 1
- Joined: Fri Apr 27, 2012 12:20 pm
Reading only layers names: how do I stop parsing?
I inherited a class from DL_CreationAdapter for extracting layer names from a dxf file. The problem is that the code is VERY slow, because the DL_CreationAdapter correctly reads all layers but then contnues to read the file until the end. Is there a method to stop parsing when layers' data are all red?
Re: Reading only layers names: how do I stop parsing?
No.
You could add add that functionality to DL_CreationInterface as follows:
dl_creationinterface.h:
dl_creationadapter.h:
dl_dxf.cpp:
You could add add that functionality to DL_CreationInterface as follows:
dl_creationinterface.h:
Code: Select all
// implement this in your creation interface implementation to return true to stop parsing
bool DL_CreationInterface::stop() = 0;
Code: Select all
bool DL_CreationInterface::stop() {}
Code: Select all
DL_Dxf::in(...) {
...
while (readDxfGroups(fp, creationInterface, &errorCounter) && !creationInterface->stop()) {}
...
}