MCPcopy Create free account
hub / github.com/KLayout/klayout / endElement

Method endElement

src/laybasic/laybasic/gtf.cc:1737–1782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1735}
1736
1737bool
1738GtfXmlHandler::endElement (const QString & /*namespaceURI*/, const QString &localName, const QString & /*qName*/)
1739{
1740 if (localName == QString::fromUtf8 ("block")) {
1741
1742 tl_assert (m_data_stack.size () >= 2);
1743 m_data_stack.end ()[-2].push (m_data_stack.end ()[-1]);
1744 m_data_stack.pop_back ();
1745
1746 } else if (localName == QString::fromUtf8 ("string")) {
1747
1748 tl_assert (m_data_stack.size () >= 1);
1749 m_data_stack.end ()[-1].push (tl::Variant (tl::to_string (m_cdata)));
1750
1751 } else if (localName == QString::fromUtf8 ("int")) {
1752
1753 long l = 0;
1754 tl::from_string (tl::to_string (m_cdata), l);
1755 tl_assert (m_data_stack.size () >= 1);
1756 m_data_stack.end ()[-1].push (tl::Variant (l));
1757
1758 } else if (localName == QString::fromUtf8 ("img")) {
1759
1760 QByteArray ba (QByteArray::fromBase64 (m_cdata.toUtf8 ()));
1761 QImage img;
1762 img.loadFromData (ba);
1763 tl_assert (m_data_stack.size () >= 1);
1764 m_data_stack.end ()[-1].push (image_to_variant (img));
1765
1766 } else if (localName == QString::fromUtf8 ("mouse_button_release") ||
1767 localName == QString::fromUtf8 ("mouse_button_press") ||
1768 localName == QString::fromUtf8 ("mouse_button_dbl_click") ||
1769 localName == QString::fromUtf8 ("mouse_move") ||
1770 localName == QString::fromUtf8 ("key_press") ||
1771 localName == QString::fromUtf8 ("key_release") ||
1772 localName == QString::fromUtf8 ("action") ||
1773 localName == QString::fromUtf8 ("resize") ||
1774 localName == QString::fromUtf8 ("probe") ||
1775 localName == QString::fromUtf8 ("error") ||
1776 localName == QString::fromUtf8 ("block")) {
1777 leave_event ();
1778 }
1779
1780 // continue
1781 return true;
1782}
1783
1784bool
1785GtfXmlHandler::startElement (const QString & /*namespaceURI*/, const QString &localName, const QString & /*qName*/, const QXmlAttributes &atts)

Callers

nothing calls this directly

Calls 9

image_to_variantFunction · 0.85
leave_eventFunction · 0.70
VariantClass · 0.50
to_stringFunction · 0.50
from_stringFunction · 0.50
sizeMethod · 0.45
pushMethod · 0.45
endMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected