| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <regex> |
| 4 |
#include "Conversation.h" |
| 5 |
|
| 6 |
#include "ientity.h" |
| 7 |
|
| 8 |
namespace conversation |
| 9 |
{ |
| 10 |
|
| 11 |
/** |
| 12 |
* Entity Visitor which extracts conversation keyvalues (of the form "conv_<n>_yyyy") |
| 13 |
* and populates the given ConversationMap with the parsed conversation objects. |
| 14 |
*/ |
| 15 |
class ConversationKeyExtractor |
| 16 |
{ |
| 17 |
private: |
| 18 |
// Map of number->Conversation objects |
| 19 |
ConversationMap& _convMap; |
| 20 |
|
| 21 |
const std::regex _regexConvNum; |
| 22 |
const std::regex _regexConvCmd; |
| 23 |
|
| 24 |
public: |
| 25 |
|
| 26 |
/** |
| 27 |
* Constructor. Sets the map to populate. |
| 28 |
*/ |
| 29 |
ConversationKeyExtractor(ConversationMap& map); |
| 30 |
|
| 31 |
/** |
| 32 |
* Required visit function. |
| 33 |
*/ |
| 34 |
void operator()(const std::string& key, const std::string& value); |
| 35 |
}; |
| 36 |
|
| 37 |
} // namespace |