Exemplo n.º 1
0
std::string level1_connector::do_get_string_column_attribute(statement_handle const & handle, SQLUSMALLINT column_id, SQLUSMALLINT field_identifier) const
{
	cpp_odbc::level2::string_buffer attribute_value(1024);
	auto const return_code = level1_api_->column_attribute(
			handle.handle,
			column_id,
			field_identifier,
			attribute_value.data_pointer(),
			attribute_value.capacity(),
			attribute_value.size_pointer(),
			nullptr
		);

	impl::throw_on_error(return_code, *this, handle);

	return attribute_value;
}
Exemplo n.º 2
0
void DualSpinScale::set_from_attribute(SPObject* o)
{
    const gchar* val = attribute_value(o);
    if(val) {
        // Split val into parts
        gchar** toks = g_strsplit(val, " ", 2);

        if(toks) {
            double v1 = 0.0, v2 = 0.0;
            if(toks[0])
                v1 = v2 = Glib::Ascii::strtod(toks[0]);
            if(toks[1])
                v2 = Glib::Ascii::strtod(toks[1]);

            _link.set_active(toks[1] == 0);

            _s1.get_adjustment()->set_value(v1);
            _s2.get_adjustment()->set_value(v2);

            g_strfreev(toks);
        }
    }
}
Exemplo n.º 3
0
	inline Attribute *attribute()
	{
		Attribute *attr = new Attribute(randr(), *attribute_value());
		
		return attr;
	}