Example #1
0
	void ResultSetBinding::TransformValue(size_t index, SharedValue result)
	{
		MetaColumn::ColumnDataType type = rs->columnType(index);
		Poco::DynamicAny value = rs->value(index);
		
		if (value.isEmpty())
		{
			result->SetNull();
		}
		else if (type == MetaColumn::FDT_STRING)
		{
			std::string str;
			value.convert(str);
			result->SetString(str);
		}
		else if (type == MetaColumn::FDT_BOOL)
		{
			bool v = false;
			value.convert(v);
			result->SetBool(v);
		}
		else if (type == MetaColumn::FDT_FLOAT || type == MetaColumn::FDT_DOUBLE)
		{
			float f = 0;
			value.convert(f);
			result->SetDouble(f);
		}
		else if (type == MetaColumn::FDT_BLOB || type == MetaColumn::FDT_UNKNOWN)
		{
			std::string str;
			value.convert(str);
			result->SetString(str);
		}
		else
		{
			// the rest of these are ints:
			// FDT_INT8,
			// FDT_UINT8,
			// FDT_INT16,
			// FDT_UINT16,
			// FDT_INT32,
			// FDT_UINT32,
			// FDT_INT64,
			// FDT_UINT64,
			int i;
			value.convert(i);
			result->SetInt(i);
		}
	}
Example #2
0
	void Event::_GetTimestamp(const ValueList&, SharedValue result)
	{
		result->SetDouble((int) timestamp.epochMicroseconds() / 1000);
	}
	void UIBinding::_GetIdleTime(
		const ValueList& args,
		SharedValue result)
	{
		result->SetDouble(this->GetIdleTime());
	}
Example #4
0
	void Sound::GetVolume(const ValueList& args, SharedValue result)
	{
		result->SetDouble(this->GetVolume());
	}