updated: to the new Ezc API
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@983 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -42,28 +42,28 @@ namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
bool are_spaces_the_same(const std::vector<std::wstring> & params, const std::vector<std::wstring> & spaces)
|
||||
bool are_spaces_the_same(const std::vector<Ezc::Var> & params, const std::vector<std::wstring> & spaces)
|
||||
{
|
||||
// last value from params is the parameter name (not a space)
|
||||
if( spaces.size() + 1 != params.size() )
|
||||
return false;
|
||||
|
||||
for(size_t i=0 ; i<spaces.size() ; ++i)
|
||||
if( spaces[i] != params[i] )
|
||||
if( spaces[i] != params[i].str )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void copy_space(const std::vector<std::wstring> & params, std::vector<std::wstring> & spaces)
|
||||
void copy_space(const std::vector<Ezc::Var> & params, std::vector<std::wstring> & spaces)
|
||||
{
|
||||
if( !params.empty() )
|
||||
{
|
||||
spaces.resize(params.size() - 1);
|
||||
|
||||
for(size_t i=0 ; i<params.size() - 1 ; ++i)
|
||||
spaces[i] = params[i];
|
||||
spaces[i] = params[i].str;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -72,13 +72,13 @@ void copy_space(const std::vector<std::wstring> & params, std::vector<std::wstri
|
||||
}
|
||||
|
||||
|
||||
PT::Space * find_space(const std::vector<std::wstring> & params, PT::Space & space, size_t level = 0)
|
||||
PT::Space * find_space(const std::vector<Ezc::Var> & params, PT::Space & space, size_t level = 0)
|
||||
{
|
||||
if( level + 1 < params.size() )
|
||||
{
|
||||
for(size_t i=0 ; i<space.spaces.size() ; ++i)
|
||||
{
|
||||
if( space.spaces[i]->name == params[level] )
|
||||
if( space.spaces[i]->name == params[level].str )
|
||||
return find_space(params, *space.spaces[i], level+1);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ static size_t space_reqid = 0;
|
||||
|
||||
|
||||
|
||||
void space_init(const std::vector<std::wstring> & params, PT::Space & space, SpaceInfo & space_info)
|
||||
void space_init(const std::vector<Ezc::Var> & params, PT::Space & space, SpaceInfo & space_info)
|
||||
{
|
||||
if( !space_info.inited || !are_spaces_the_same(params, space_info.spaces) )
|
||||
{
|
||||
@@ -151,13 +151,14 @@ void space(Info & i, PT::Space & space)
|
||||
|
||||
if( space_info.last_space )
|
||||
{
|
||||
const std::wstring & param = i.params.back();
|
||||
const std::wstring & param = i.params.back().str;
|
||||
const std::wstring * value = space_info.last_space->GetValue(param);
|
||||
|
||||
if( value )
|
||||
i.out << *value;
|
||||
// else
|
||||
// log << log1 << "nie ma takiej wartosci" << logend; // only for testing
|
||||
// !! IMPROVE ME
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +175,7 @@ void space_value_noescape(Info & i, PT::Space & space)
|
||||
|
||||
if( space_info.last_space )
|
||||
{
|
||||
const std::wstring & param = i.params.back();
|
||||
const std::wstring & param = i.params.back().str;
|
||||
const std::wstring * value = space_info.last_space->GetValue(param);
|
||||
|
||||
if( value )
|
||||
@@ -231,7 +232,7 @@ static size_t spaces_tab_reqid = 0;
|
||||
|
||||
|
||||
|
||||
bool spaces_tab_find_stack_item(std::vector<std::wstring> & params, SpacesTabInfo & spaces_tab_info)
|
||||
bool spaces_tab_find_stack_item(std::vector<Ezc::Var> & params, SpacesTabInfo & spaces_tab_info)
|
||||
{
|
||||
bool found = false;
|
||||
spaces_tab_info.cur_stack = spaces_tab_info.stack_tab.size();
|
||||
@@ -250,7 +251,7 @@ return found;
|
||||
}
|
||||
|
||||
|
||||
void spaces_tab_add_to_stack(std::vector<std::wstring> & params, PT::Space & space, SpacesTabInfo & spaces_tab_info)
|
||||
void spaces_tab_add_to_stack(std::vector<Ezc::Var> & params, PT::Space & space, SpacesTabInfo & spaces_tab_info)
|
||||
{
|
||||
if( !params.empty() )
|
||||
{
|
||||
@@ -261,7 +262,7 @@ void spaces_tab_add_to_stack(std::vector<std::wstring> & params, PT::Space & spa
|
||||
SpaceStackItem & stack_item = spaces_tab_info.stack_tab.back();
|
||||
|
||||
copy_space(params, stack_item.spaces);
|
||||
space.ListText(params.back(), stack_item.values);
|
||||
space.ListText(params.back().str, stack_item.values);
|
||||
stack_item.value_index = 0;
|
||||
}
|
||||
}
|
||||
@@ -277,7 +278,7 @@ void spaces_tab_check_reqid()
|
||||
}
|
||||
|
||||
|
||||
void spaces_tab_init(std::vector<std::wstring> & params, PT::Space & space, SpacesTabInfo & spaces_tab_info)
|
||||
void spaces_tab_init(std::vector<Ezc::Var> & params, PT::Space & space, SpacesTabInfo & spaces_tab_info)
|
||||
{
|
||||
PT::Space * child_space = find_space(params, space);
|
||||
|
||||
|
Reference in New Issue
Block a user