| 11 | |
| 12 | |
| 13 | class TreeHandlerTest : public TreeHandler |
| 14 | { |
| 15 | std::unordered_map<std::string, Position> m_mapKeyPosition; |
| 16 | |
| 17 | public: |
| 18 | virtual ~TreeHandlerTest() = default; |
| 19 | |
| 20 | |
| 21 | // Inherited via TreeHandler |
| 22 | HTREEITEM InsertToTree(HTREEITEM /*parent*/, const std::string& text) override |
| 23 | { |
| 24 | m_mapKeyPosition[text] = {}; |
| 25 | return HTREEITEM(); |
| 26 | } |
| 27 | |
| 28 | HTREEITEM InsertToTree(HTREEITEM /*parent*/, const std::string& text, const Position& pos) override |
| 29 | { |
| 30 | m_mapKeyPosition[text] = pos; |
| 31 | return HTREEITEM(); |
| 32 | } |
| 33 | |
| 34 | void AppendNodeCount(HTREEITEM /*node*/, unsigned /*elementCount*/, bool /*bArray*/) override {} |
| 35 | |
| 36 | auto GetPosition(const std::string& text) const -> std::optional<Position> |
| 37 | { |
| 38 | auto find = m_mapKeyPosition.find(text); |
| 39 | |
| 40 | std::optional<Position> retVal = std::nullopt; |
| 41 | if (find != m_mapKeyPosition.cend()) |
| 42 | retVal = find->second; |
| 43 | |
| 44 | return retVal; |
| 45 | } |
| 46 | }; |
| 47 | |
| 48 | namespace JsonNavigation |
| 49 | { |
nothing calls this directly
no outgoing calls
no test coverage detected