| 135 | } |
| 136 | |
| 137 | void vtkCMLParser::StartElement(const char* name, const char** attr) |
| 138 | { |
| 139 | if (strcmp(name, "atom") == 0) |
| 140 | { |
| 141 | this->NewAtom(attr); |
| 142 | } |
| 143 | else if (strcmp(name, "bond") == 0) |
| 144 | { |
| 145 | this->NewBond(attr); |
| 146 | } |
| 147 | else if (strcmp(name, "molecule") == 0) |
| 148 | { |
| 149 | this->NewMolecule(attr); |
| 150 | } |
| 151 | else if (this->GetDebug()) |
| 152 | { |
| 153 | std::string desc; |
| 154 | desc += "Unhandled CML Element. Name: "; |
| 155 | desc += name; |
| 156 | desc += "\n\tAttributes:"; |
| 157 | int attrIndex = 0; |
| 158 | while (const char* cur = attr[attrIndex]) |
| 159 | { |
| 160 | if (attrIndex > 0) |
| 161 | { |
| 162 | desc.push_back(' '); |
| 163 | } |
| 164 | desc += cur; |
| 165 | ++attrIndex; |
| 166 | } |
| 167 | vtkDebugMacro(<< desc); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | void vtkCMLParser::EndElement(const char*) {} |
| 172 |
nothing calls this directly
no test coverage detected