Commit b32d7cc
committed
libdxfrw: check the typed class table's invariants at compile time
With the registrars driven from one table, the properties they used to
hold simply by being written out one at a time are no longer guaranteed
by construction. Assert them instead: every row needs a non-empty key,
application name, class name and record name, and the key, record name
and class name have to be unique. A copy-paste slip in a new row now
fails the build rather than silently registering the wrong metadata.
Class numbers are deliberately excluded. The check was written to require
them to be unique too, and that immediately failed the build: MLEADERSTYLE
shares 504 with MATERIAL, TABLESTYLE shares 509 with IDBUFFER, and
EVALUATION_GRAPH shares 516 with FIELD. The custom-class range is assigned
per file and registerTypedObjectClass() hands a colliding type the next
free number, so those defaults are a starting point rather than an
identity. That is now recorded at the table.1 parent 1fcc8a6 commit b32d7cc
1 file changed
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
138 | 192 | | |
139 | 193 | | |
140 | 194 | | |
| |||
0 commit comments