| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/components/controls/cpu/cpufreqmodexmlparser.cpp`/ |
| 2 | // Copyright 2021 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "cpufreqmodexmlparser.h"cxx . . $ `<file>/src/core/components/controls/cpu/cpufreqmodexmlparser.h`/ |
| 5 | |
| 6 | #include "core/profilepartxmlparserprovider.h"cxx . . $ `<file>/src/core/profilepartxmlparserprovider.h`/ |
| 7 | #include "cpufreqmode.h"cxx . . $ `<file>/src/core/components/controls/cpu/cpufreqmode.h`/ |
| 8 | #include <memory> |
| 9 | |
| 10 | CPUFreqModeXMLParsercxx . . $ CPUFreqModeXMLParser#::CPUFreqModeXMLParsercxx . . $ CPUFreqModeXMLParser#CPUFreqModeXMLParser(ced63f7c635d850d).() noexcept |
| 11 | : ControlModeXMLParsercxx . . $ ControlModeXMLParser#(CPUFreqModecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::ItemIDcxx . . $ CPUFreqMode#ItemID.) |
| 12 | { |
| 13 | } |
| 14 | |
| 15 | void CPUFreqModeXMLParsercxx . . $ CPUFreqModeXMLParser#::loadPartFromcxx . . $ CPUFreqModeXMLParser#loadPartFrom(ad773084382c4c72).(pugicxx . . $ pugi/::xml_nodecxx . . $ pugi/xml_node# const &parentNode) |
| 16 | { |
| 17 | auto node = parentNode.find_childcxx . . $ pugi/xml_node#find_child(4699405ca595259d).([&](pugicxx . . $ pugi/::xml_nodecxx . . $ pugi/xml_node# const &node) { |
| 18 | return nodecxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)..namecxx . . $ pugi/xml_node#name(a9f41ea0e82d88cf).() == CPUFreqModecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::ItemIDcxx . . $ CPUFreqMode#ItemID.; |
| 19 | }); |
| 20 | |
| 21 | takeActivecxx . . $ ControlModeXMLParser#takeActive(b45ddcbc8423892c).(node.attributecxx . . $ pugi/xml_node#attribute(760b1819de0561d9).("active").as_boolcxx . . $ pugi/xml_attribute#as_bool(962fae8be55e1d9).(activeDefaultcxx . . $ ControlModeXMLParser#activeDefault(50ce9a9e25b4a850).())); |
| 22 | takeModecxx . . $ ControlModeXMLParser#takeMode(9c546c94e5fcce4e).(nodecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)..attributecxx . . $ pugi/xml_node#attribute(760b1819de0561d9).("mode").as_stringcxx . . $ pugi/xml_attribute#as_string(865ea18671f48fc1).(modeDefaultcxx . . $ ControlModeXMLParser#modeDefault(f4fff0029955a25f).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())); |
| 23 | |
| 24 | if (!cxx . . $ pugi/xml_node#`operator!`(50ce9a9e25b4a850).node) { |
| 25 | // Legacy control settings might be present in the profile. |
| 26 | // The old control settings were attach to this node parent, |
| 27 | // so we must pass it in order to load its settings. |
| 28 | node =cxx . . $ pugi/xml_node#`operator=`(2a58a64f7a59eb02). parentNode; |
| 29 | } |
| 30 | |
| 31 | loadComponentscxx . . $ ControlModeXMLParser#loadComponents(ad773084382c4c72).(node); |
| 32 | } |
| 33 | |
| 34 | bool const CPUFreqModeXMLParsercxx . . $ CPUFreqModeXMLParser#::registered_cxx . . $ CPUFreqModeXMLParser#registered_. = |
| 35 | ProfilePartXMLParserProvidercxx . . $ ProfilePartXMLParserProvider#::registerProvidercxx . . $ ProfilePartXMLParserProvider#registerProvider(1a5cc5494db8b601).(CPUFreqModecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::ItemIDcxx . . $ CPUFreqMode#ItemID., [cxx . . $ std/function#function(bdc3712e480e4d04).]() { |
| 36 | return stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<CPUFreqModeXMLParsercxx . . $ CPUFreqModeXMLParser#>(); |
| 37 | }); |