summaryrefslogtreecommitdiff
path: root/plugins/CurrencyRates/src/CurrencyRatesProviderVisitorTendency.cpp
blob: 2d5260aab5a8d73e3eeb210ac0608414e1a8e972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "stdafx.h"

CCurrencyRatesProviderVisitorTendency::CCurrencyRatesProviderVisitorTendency(MCONTACT hContact, wchar_t chr) :
	m_hContact(hContact), m_chr(chr)
{
}

void CCurrencyRatesProviderVisitorTendency::Visit(const CCurrencyRatesProviderBase&)
{
	switch (m_chr) {
	case 'r':
	case 'R':
		GetValue(DB_STR_CURRENCYRATE_CURR_VALUE);
		break;
	case 'p':
		GetValue(DB_STR_CURRENCYRATE_PREV_VALUE);
		break;
	}
}

void CCurrencyRatesProviderVisitorTendency::GetValue(LPCSTR pszDbKeyName)
{
	m_bValid = CurrencyRates_DBReadDouble(m_hContact, CURRENCYRATES_MODULE_NAME, pszDbKeyName, m_dResult);
}