src/linux_parser.cpp
// DONE: An example of how to read data from the filesystem
An example of how to read data from the filesystem
An example of how to read data from the filesystem
string LinuxParser::Kernel() {
  string os, kernel, kernel_version;
  string line;
  std::ifstream stream(kProcDirectory + kVersionFilename);
  if (stream.is_open()) {
    std::getline(stream, line);
    std::istringstream linestream(line);
    linestream >> os >> kernel>>kernel_version;
    kernel.append(" ");
    kernel.append(kernel_version);
  }
  return kernel;
}
string LinuxParser :: Kernel ( ) { string os , kernel , kernel_version ; string line ; std :: ifstream stream ( kProcDirectory + kVersionFilename ) ; if ( stream . is_open ( ) ) { std :: getline ( stream , line ) ; std :: istringstream linestream ( line ) ; linestream >> os >> kernel >> kernel_version ; kernel . append ( " " ) ; kernel . append ( kernel_version ) ; } return kernel ; }
DONE: An example of how to read data from the filesystem
DONE : An example of how to read data from the filesystem