mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
IPCCompiler: Add support for Vector<i32>
It would be a lot nicer to support arbitrary Vector<T> but for now I'm only adding Vector<i32> since I need it for something..
This commit is contained in:
parent
828aee9932
commit
a726fda546
1 changed files with 15 additions and 0 deletions
|
@ -319,6 +319,16 @@ int main(int argc, char** argv)
|
|||
out() << " return nullptr;";
|
||||
out() << " " << parameter.name << ".append(move(rect));";
|
||||
out() << " }";
|
||||
} else if (parameter.type == "Vector<i32>") {
|
||||
out() << " u64 " << parameter.name << "_size = 0;";
|
||||
out() << " stream >> " << parameter.name << "_size;";
|
||||
out() << " for (size_t i = 0; i < " << parameter.name << "_size; ++i) {";
|
||||
out() << " i32 value;";
|
||||
out() << " stream >> value;";
|
||||
out() << " if (stream.handle_read_failure())";
|
||||
out() << " return nullptr;";
|
||||
out() << " " << parameter.name << ".append(value);";
|
||||
out() << " }";
|
||||
} else {
|
||||
out() << " if (!decoder.decode(" << parameter.name << "))";
|
||||
out() << " return nullptr;";
|
||||
|
@ -363,6 +373,11 @@ int main(int argc, char** argv)
|
|||
out() << " stream << rect.width();";
|
||||
out() << " stream << rect.height();";
|
||||
out() << " }";
|
||||
} else if (parameter.type == "Vector<i32>") {
|
||||
out() << " stream << (u64)m_" << parameter.name << ".size();";
|
||||
out() << " for (auto value : m_" << parameter.name << ") {";
|
||||
out() << " stream << value;";
|
||||
out() << " }";
|
||||
} else if (parameter.type == "Gfx::ShareableBitmap") {
|
||||
out() << " stream << m_" << parameter.name << ".shbuf_id();";
|
||||
out() << " stream << m_" << parameter.name << ".width();";
|
||||
|
|
Loading…
Add table
Reference in a new issue