- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
ProcessorInfo ProcessorInfo::Get()
{
ProcessorInfo result;
String allCpuInfo = IO::DiskFile::ReadAsString("/proc/cpuinfo");
result.BrandString = allCpuInfo().Find(StringView("\nmodel name"))
.Find(':').Drop(2).ReadUntil('\n');
result.CoreNumber = allCpuInfo().Find(StringView("\ncpu cores"))
.Find(':').Drop(2).ReadUntil('\n').ParseAdvance<ushort>();
result.LogicalProcessorNumber = (ushort)allCpuInfo().Count(StringView("processor "));
result.Frequency = ulong64(1000000*allCpuInfo().Find(StringView("\ncpu MHz"))
.Find(':').Drop(2).ReadUntil('\n').ParseAdvance<double>());
return result;
}
> allCpuInfo()
Строка -- это функция без параметров?