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

Method deserialize

src/laybasic/laybasic/layDragDropData.cc:71–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool
72CellDragDropData::deserialize (const QByteArray &ba)
73{
74 QDataStream stream (const_cast<QByteArray *> (&ba), QIODevice::ReadOnly);
75
76 QString tag;
77 stream >> tag;
78
79 if (tag == QString::fromUtf8 ("CellDragDropData")) {
80
81 quintptr p = 0;
82 stream >> p;
83 mp_layout = reinterpret_cast <const db::Layout *> (p);
84 stream >> p;
85 mp_library = reinterpret_cast <const db::Library *> (p);
86 stream >> m_cell_index;
87 stream >> m_is_pcell;
88
89 m_pcell_params.clear ();
90 int n = 0;
91 stream >> n;
92 while (n-- > 0) {
93 QString s;
94 stream >> s;
95 std::string stl_s = tl::to_string (s);
96 tl::Extractor ex (stl_s.c_str ());
97 m_pcell_params.push_back (tl::Variant ());
98 ex.read (m_pcell_params.back ());
99 }
100
101 return true;
102
103 } else {
104
105 return false;
106
107 }
108}
109
110}
111

Callers 1

get_drag_drop_dataFunction · 0.45

Calls 7

to_stringFunction · 0.50
VariantClass · 0.50
clearMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45
readMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected