| 38 | } |
| 39 | |
| 40 | std::vector<UserTO> NetworkResourceParserService::decodeUserData(boost::property_tree::ptree const& tree) |
| 41 | { |
| 42 | std::vector<UserTO> result; |
| 43 | for (auto const& [key, subTree] : tree) { |
| 44 | UserTO entry; |
| 45 | entry.userName = subTree.get<std::string>("userName"); |
| 46 | entry.starsReceived = subTree.get<int>("starsReceived"); |
| 47 | entry.starsGiven = subTree.get<int>("starsGiven"); |
| 48 | entry.timestamp = subTree.get<std::string>("timestamp"); |
| 49 | entry.online = subTree.get<bool>("online"); |
| 50 | entry.lastDayOnline = subTree.get<bool>("lastDayOnline"); |
| 51 | entry.timeSpent = subTree.get<int>("timeSpent"); |
| 52 | entry.gpu = subTree.get<std::string>("gpu"); |
| 53 | result.emplace_back(entry); |
| 54 | } |
| 55 | return result; |
| 56 | } |