forked from rime/weasel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActionLoader.cpp
More file actions
31 lines (25 loc) · 925 Bytes
/
Copy pathActionLoader.cpp
File metadata and controls
31 lines (25 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "stdafx.h"
#include <StringAlgorithm.hpp>
#include "Deserializer.h"
#include "ActionLoader.h"
#include <algorithm>
using namespace weasel;
Deserializer::Ptr ActionLoader::Create(ResponseParser* pTarget) {
return Deserializer::Ptr(new ActionLoader(pTarget));
}
ActionLoader::ActionLoader(ResponseParser* pTarget) : Deserializer(pTarget) {}
ActionLoader::~ActionLoader() {}
void ActionLoader::Store(Deserializer::KeyType const& key,
std::wstring const& value) {
if (key.size() == 1) // no extention parts
{
// split value by L","
std::vector<std::wstring> vecAction;
split(vecAction, value, L",");
// require specified action deserializers
std::for_each(vecAction.begin(), vecAction.end(),
[this](std::wstring& action) {
Deserializer::Require(action, m_pTarget);
});
}
}