updated to the new Pikotools api (new Space struct)

This commit is contained in:
2021-04-09 17:50:58 +02:00
parent 00b980e74b
commit 35e10ed469
52 changed files with 795 additions and 736 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2010-2018, Tomasz Sowa
* Copyright (c) 2010-2021, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -144,30 +144,36 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
{
file_tab.clear();
for(size_t i=0 ; i<space.spaces.size() ; ++i)
if( space.child_spaces )
{
PT::Space & sp = *space.spaces[i];
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
{
PT::Space & sp = *(*space.child_spaces)[i];
if( sp.name == L"param" )
CheckFile(file_tab, sp);
if( sp.name && (*sp.name) == L"param" )
CheckFile(file_tab, sp);
}
}
}
void SessionData::CheckFile(std::vector<long> & file_tab, PT::Space & space)
{
for(size_t i=0 ; i<space.spaces.size() ; ++i)
if( space.child_spaces )
{
PT::Space & subsp = *space.spaces[i];
if( subsp.name == L"file" )
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
{
std::wstring * file_id_str = subsp.GetFirstValue(L"itemid");
PT::Space & subsp = *(*space.child_spaces)[i];
if( file_id_str )
if( subsp.name && *subsp.name == L"file" )
{
long file_id = Tol(*file_id_str);
file_tab.push_back(file_id);
std::wstring * file_id_str = subsp.get_wstr(L"itemid");
if( file_id_str )
{
long file_id = Tol(*file_id_str);
file_tab.push_back(file_id);
}
}
}
}