summaryrefslogtreecommitdiff
path: root/plugins/CurrencyRates/src/QuotesProviderVisitorTendency.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CurrencyRates/src/QuotesProviderVisitorTendency.cpp')
-rw-r--r--plugins/CurrencyRates/src/QuotesProviderVisitorTendency.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/CurrencyRates/src/QuotesProviderVisitorTendency.cpp b/plugins/CurrencyRates/src/QuotesProviderVisitorTendency.cpp
new file mode 100644
index 0000000000..123fed5015
--- /dev/null
+++ b/plugins/CurrencyRates/src/QuotesProviderVisitorTendency.cpp
@@ -0,0 +1,24 @@
+#include "stdafx.h"
+
+CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact, wchar_t chr)
+ : m_hContact(hContact), m_chr(chr), m_bValid(false), m_dResult(0.0)
+{
+}
+
+void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderBase&)
+{
+ switch (m_chr) {
+ case 'r':
+ case 'R':
+ GetValue(DB_STR_QUOTE_CURR_VALUE);
+ break;
+ case 'p':
+ GetValue(DB_STR_QUOTE_PREV_VALUE);
+ break;
+ }
+}
+
+void CQuotesProviderVisitorTendency::GetValue(LPCSTR pszDbKeyName)
+{
+ m_bValid = Quotes_DBReadDouble(m_hContact, QUOTES_MODULE_NAME, pszDbKeyName, m_dResult);
+}