| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/info/hwiddatasource.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "hwiddatasource.h"cxx . . $ `<file>/src/core/info/hwiddatasource.h`/ |
| 5 | |
| 6 | #include "common/fileutils.h"cxx . . $ `<file>/src/common/fileutils.h`/ |
| 7 | #include <utility> |
| 8 | |
| 9 | HWIDDataSourcecxx . . $ HWIDDataSource#::HWIDDataSourcecxx . . $ HWIDDataSource#HWIDDataSource(36024da72fa271e1).(stdcxx . . $ std/::stringcxx . . $ std/string# const &path) noexcept |
| 10 | : path_cxx . . $ HWIDDataSource#path_.(path) |
| 11 | { |
| 12 | } |
| 13 | |
| 14 | stdcxx . . $ std/::stringcxx . . $ std/string# HWIDDataSourcecxx . . $ HWIDDataSource#::sourcecxx . . $ HWIDDataSource#source(219584694fe2b248).() const |
| 15 | { |
| 16 | return path_cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).; |
| 17 | } |
| 18 | |
| 19 | bool HWIDDataSourcecxx . . $ HWIDDataSource#::readcxx . . $ HWIDDataSource#read(f7745933424cf9c).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<char> &data) |
| 20 | { |
| 21 | auto fileData = Utilscxx . . $ Utils/::Filecxx . . $ Utils/File/::readFilecxx . . $ Utils/File/readFile(ca87ac95f82c0a15).(path_cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).); |
| 22 | if (!fileData.emptycxx . . $ std/vector#empty(3482b152b9333168).()) { |
| 23 | stdcxx . . $ std/::swapcxx . . $ std/swap(90aec5ea4c4ede5e).(data, fileData); |
| 24 | return true; |
| 25 | } |
| 26 | return false; |
| 27 | } |