updated to the new pikotools api: changed the way how child_spaces are created in Space class
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user