void value_t::set(value_id_t value_id, const string_t& value) { pi_t::pro_t::item_t id_item(pi_t::pro_t::uint_t(value_id), NULL); const str_t& value_str = value.str(); pi_t::pro_t::item_t value_item(value_str, &id_item); pi_t::pro_t pro(&value_item); value_ = pi_ext_t::__build(pro); }
bool value_t::set(const pi_t& pi_value) { const value_id_t value_id = pi_value.s_ind(0).s_uint(); const str_t& value_str = pi_value.s_ind(1).s_str(); if(value_id == INVALID_VALUE_ID || value_str.size() == 0) { return false; } pi_t::pro_t::item_t id_item(pi_t::pro_t::uint_t(value_id), NULL); pi_t::pro_t::item_t value_item(value_str, &id_item); pi_t::pro_t pro(&value_item); value_ = pi_ext_t::__build(pro); return true; }
static void j2x_object( store::Item_t const &object_item, store::Item_t *parent_xml_item ) { ZORBA_ASSERT( parent_xml_item ); store::Item_t junk_item, key_item, type_name; store::Iterator_t k( object_item->getObjectKeys() ); k->open(); while ( k->next( key_item ) ) { store::Item_t att_name; GENV_ITEMFACTORY->createQName( att_name, "", "", key_item->getStringValue() ); store::Item_t value_item( object_item->getObjectValue( key_item ) ); zstring value_str( value_item->getStringValue() ); GENV_ITEMFACTORY->createString( value_item, value_str ); type_name = GENV_TYPESYSTEM.XS_UNTYPED_QNAME; GENV_ITEMFACTORY->createAttributeNode( junk_item, *parent_xml_item, att_name, type_name, value_item ); } k->close(); }