| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/info/swinfo.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "swinfo.h"cxx . . $ `<file>/src/core/info/swinfo.h`/ |
| 5 | |
| 6 | #include <algorithm> |
| 7 | #include <iterator> |
| 8 | #include <utility> |
| 9 | |
| 10 | stdcxx . . $ std/::stringcxx . . $ std/string# SWInfocxx . . $ SWInfo#::infocxx . . $ SWInfo#info(3654cd48a63d288).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# key) const |
| 11 | { |
| 12 | auto const dataIt = info_cxx . . $ SWInfo#info_..findcxx . . $ std/unordered_map#find(f39fe4bedfa7a693).(stdcxx . . $ std/::stringcxx . . $ std/string#(key)); |
| 13 | if (dataIt != info_cxx . . $ SWInfo#info_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).()) |
| 14 | return dataItcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).->cxx . . $ std/__detail/_Node_const_iterator#`operator->`(8e614c7de0b1573e).secondcxx . . $ std/pair#second.; |
| 15 | |
| 16 | return stdcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).::stringcxx . . $ std/string#{}; |
| 17 | } |
| 18 | |
| 19 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> SWInfocxx . . $ SWInfo#::keyscxx . . $ SWInfo#keys(491c255a7e496038).() const |
| 20 | { |
| 21 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> keyscxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 22 | keys.reservecxx . . $ std/vector#reserve(2c44cd906ae4e829).(info_cxx . . $ SWInfo#info_..sizecxx . . $ std/unordered_map#size(fe713de6d184c8a).()); |
| 23 | |
| 24 | auto const keySelector = [](auto const &pair) { return pair.first; }; |
| 25 | stdcxx . . $ std/::transformcxx . . $ std/transform(da30451c4a040264).(info_cxx . . $ SWInfo#info_..cbegincxx . . $ std/unordered_map#cbegin(f3c6e12ee1fe7252).(), info_cxx . . $ SWInfo#info_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).(), stdcxx . . $ std/::back_insertercxx . . $ std/back_inserter(7b559d6bdd90ff74).(keys), |
| 26 | keySelector); |
| 27 | |
| 28 | return keyscxx . . $ std/vector#vector(6f559d22b039ccdb).; |
| 29 | } |
| 30 | |
| 31 | void SWInfocxx . . $ SWInfo#::initializecxx . . $ SWInfo#initialize(97df72f1a8cecba1).( |
| 32 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<ISWInfocxx . . $ ISWInfo#::IProvidercxx . . $ ISWInfo#IProvider#>> const &infoProviders) |
| 33 | { |
| 34 | for (auto const &provider : infoProviders) { |
| 35 | auto infos = provider->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).provideInfocxx . . $ ISWInfo#IProvider#provideInfo(949cec684fe0bd75).(); |
| 36 | for (auto &info : infos) |
| 37 | info_cxx . . $ SWInfo#info_..insertcxx . . $ std/unordered_map#insert(6eeaee941b6820c5).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(info)); |
| 38 | } |
| 39 | } |