| forlist : output |
Output the block to the stream.
Any other method of any other object can call this method. This is called 'public' access.
The data-type returned is "voidtype";
This method is contained in the object "forlist".
The method takes the following arguments:
filedef : Pointer to tgl_structure_parser
Not sure.
obj : Pointer to @schemaobj
Not sure.
This method is overridden from an abstract method with the same signature found in the object @block.
The files "schema/schema_obj.hpp", "tgl_list_parser.hpp" and "tgl_forlist_parser.hpp" are included.
Loop over all members of a list using the forlist_parser.
std::vector<std::string> v;
tgl_list_parser parser;
if (_list == "")
{
std::string list = obj->get(_listmember);
// use the member in the object.
if (!parser.parse_to_vector(list, &v))
{
filedef->error("List not in correct format [" + list + "].");
return;
}
}
else
{
// parse out the list...
if (!parser.parse_to_vector(_list, &v))
{
filedef->error("List not in correct format.");
return;
}
}
for (std::vector<std::string>::iterator i=v.begin(); i != v.end(); i++)
{
bool first = i == v.begin();
bool last = (i+1) == v.end();
tgl_forlist_parser p(this, obj, *i, first, last, filedef);
if (!p.write_output(_structure))
{
filedef->error("Could not process blocks.");
return;
}
}