Skip to content

Commit 1e5550c

Browse files
committed
feat: add overload with buffer args for Container::load
1 parent 58cdea0 commit 1e5550c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

include/VGG/Container/IContainer.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ class VGG_RUNTIME_DLL_DECLARE IContainer
4242
return container()->load(filePath, designDocSchemaFilePath, layoutDocSchemaFilePath);
4343
}
4444

45+
virtual bool load(
46+
std::vector<char>& buffer,
47+
const char* designDocSchemaFilePath = nullptr,
48+
const char* layoutDocSchemaFilePath = nullptr)
49+
{
50+
return container()->load(buffer, designDocSchemaFilePath, layoutDocSchemaFilePath);
51+
}
52+
4553
void run()
4654
{
4755
container()->paint();

src/Entry/Container/Container.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ class ContainerImpl
124124
layoutDocSchemaFilePath);
125125
}
126126

127+
bool load(
128+
std::vector<char>& buffer,
129+
const char* designDocSchemaFilePath = nullptr,
130+
const char* layoutDocSchemaFilePath = nullptr) override
131+
{
132+
INFO("ContainerImpl::load, buffer, designDocSchemaFilePath: %s, layoutDocSchemaFilePath: %s",
133+
designDocSchemaFilePath ? designDocSchemaFilePath : "<null>",
134+
layoutDocSchemaFilePath ? layoutDocSchemaFilePath : "<null>");
135+
return m_mainComposer->controller()->start(
136+
buffer,
137+
designDocSchemaFilePath,
138+
layoutDocSchemaFilePath);
139+
}
140+
127141
void setGraphicsContext(
128142
std::unique_ptr<layer::SkiaGraphicsContext>& context,
129143
int w,

0 commit comments

Comments
 (0)