Replace "ReadFileToString" with a few semantically clearer wrappers.

This commit is contained in:
Henrik Rydgård committed 2024-01-25 09:55:54 +01:00
1 parent f0af76ec40
commit 1f129b6dca
15 files changed
+56 -41

No files matched your search

+3 -3
View File
@@ -60,7 +60,7 @@ private:
RiscVCPUInfoParser::RiscVCPUInfoParser() {
std::string procdata, line;
if (!File::ReadFileToString(true, Path(procfile), procdata))
if (!File::ReadSysTextFileToString(Path(procfile), &procdata))
return;
std::istringstream file(procdata);
@@ -94,7 +94,7 @@ int RiscVCPUInfoParser::ProcessorCount() {
int RiscVCPUInfoParser::TotalLogicalCount() {
std::string presentData, line;
bool presentSuccess = File::ReadFileToString(true, Path(syscpupresentfile), presentData);
bool presentSuccess = File::ReadSysTextFileToString(Path(syscpupresentfile), &presentData);
if (presentSuccess) {
std::istringstream presentFile(presentData);
@@ -136,7 +136,7 @@ bool RiscVCPUInfoParser::FirmwareMatchesCompatible(const std::string &str) {
firmwareLoaded_ = true;
std::string data;
if (!File::ReadFileToString(true, Path(firmwarefile), data))
if (!File::ReadSysTextFileToString(Path(firmwarefile), &data))
return false;
SplitString(data, '\0', firmware_);