20 #ifndef __VARMAP_TO_MARKUP_INC__
21 #define __VARMAP_TO_MARKUP_INC__
28 #include <libbbb/libbbb.h>
29 #include <libbbb/markup.h>
30 #include <libbbb/varmap.h>
56 void varmapToMarkup (
const VarMap * vm, Markup * mk, QScriptValue & destin_var ) {
57 Q_ASSERT( vm != NULL );
58 Q_ASSERT( mk != NULL );
61 QStringList sl = vm->names();
62 foreach(
const QString & s_name, sl ) {
64 VarData * vd = vm->value( s_name );
65 Q_ASSERT( vd != NULL );
66 int i_max = vd->count();
68 QScriptValue sv = mk->newArray( i_max );
70 for (
int i = 0; i < i_max; i++ ) {
71 sv.setProperty( i, vd->value( i ) );
74 destin_var.setProperty( s_name, sv );
85 #endif // __VARMAP_TO_MARKUP_INC__