some refactoring in miscspace(.h|.cpp)

space() renamed to space_value() and takes a third parameter: escape (bool)
space_noescape() removed

space_tab() renamed to space_list_tab()
space_tab_value() renamed to space_list_tab_value()
space_tab_has_next() renamed to space_list_tab_has_next()





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1035 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2016-03-22 14:53:43 +00:00
parent 7ed41a03ae
commit 42144bb31c
8 changed files with 138 additions and 85 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2012-2014, Tomasz Sowa
* Copyright (c) 2012-2016, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,24 +37,52 @@
namespace Winix
{
namespace TemplatesFunctions
{
// !! rename to 'space_value'
void space(Info & i, PT::Space & space);
void space_value_noescape(Info & i, PT::Space & space);
// !! rename to 'space_value_tab' etc.
void spaces_tab(Info & i, PT::Space & space);
void spaces_tab_value(Info & i, PT::Space & space);
void spaces_tab_has_next(Info & i, PT::Space & space);
/*
* return a value from a space
* you can define you own ezc function e.g. my_space_value(Info &i) in such a way:
*
* void my_space_value(Info & i)
* {
* space_value(i, the_space_object_i_am_interested_in);
* }
*
* and now you can call it from ezc template:
* [my_space_value "foo"] -> looking for parameter "foo" in the global space of the_space_object_i_am_interest_in
* [my_space_value "foo" "bar"] -> first looking for a space with "foo" name then looking for "bar" parameter
*
*
* there is some built-in optimization made:
* if you are looking for parameters from the same space e.g.
* [my_space_value "foo" "foo2" "param1"]
* [my_space_value "foo" "foo2" "param2"]
* [my_space_value "foo" "foo2" "param3"]
* after looking for param1 the address of foo2 space is cached in a local map (first we're looking for foo and then for foo2)
* and when looking for param2 and param3 the address of foo2 is taken from the map
*
*
*/
void space_value(Info & i, PT::Space & space, bool escape = true);
// !! IMPROVE ME
// add
// void space_list_tab_size(Info & i, PT::Space & space);
void space_list_tab(Info & i, PT::Space & space);
void space_list_tab_value(Info & i, PT::Space & space);
void space_list_tab_has_next(Info & i, PT::Space & space);
// !! IMPROVE ME
// !! add space_tab (iteration through spaces)
} // namespace TemplatesFunctions
} // namespace Winix