updated to the new pikotools api: changed the way how child_spaces are created in Space class

This commit is contained in:
2021-05-21 17:17:17 +02:00
parent fe67b5d72a
commit f1b9d1b870
9 changed files with 277 additions and 262 deletions

View File

@@ -75,18 +75,18 @@ void copy_space(const std::vector<Ezc::Var> & params, std::vector<std::wstring>
pt::Space * find_space(const std::vector<Ezc::Var> & params, pt::Space & space, size_t level = 0)
{
if( level + 1 < params.size() && space.child_spaces )
{
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
{
pt::Space & child = *(*space.child_spaces)[i];
pt::Space::TableType * child_table = space.find_child_space_table();
if( child.name && *child.name == params[level].str )
return find_space(params, child, level+1);
if( level + 1 < params.size() && child_table )
{
for(pt::Space * child : *child_table)
{
if( child->is_child_space_name(params[level].str.c_str()) )
return find_space(params, *child, level+1);
}
// there is no such a space
return 0;
return nullptr;
}
else
{