src/linux_parser.cpp
int LinuxParser::RunningProcesses() {
  string title, runningProcess;
  string line;
  std::ifstream stream(kProcDirectory + kStatFilename);
  if (stream.is_open()) {
    while(std::getline(stream, line)){
    std::istringstream linestream(line);
    linestream >> title >> runningProcess;
        if (title == "procs_running") {
            break;
        }
    }
  }
  if(runningProcess == ""){
    return 0;
  }
  return stoi(runningProcess.c_str());
}
// TODO: Read and return the number of running processes
Read and return the number of running processes
Read and return the number of running processes
int LinuxParser::RunningProcesses() {
  string title, runningProcess;
  string line;
  std::ifstream stream(kProcDirectory + kStatFilename);
  if (stream.is_open()) {
    while(std::getline(stream, line)){
    std::istringstream linestream(line);
    linestream >> title >> runningProcess;
        if (title == "procs_running") {
            break;
        }
    }
  }
  if(runningProcess == ""){
    return 0;
  }
  return stoi(runningProcess.c_str());
}
int LinuxParser :: RunningProcesses ( ) { string title , runningProcess ; string line ; std :: ifstream stream ( kProcDirectory + kStatFilename ) ; if ( stream . is_open ( ) ) { while ( std :: getline ( stream , line ) ) { std :: istringstream linestream ( line ) ; linestream >> title >> runningProcess ; if ( title == " " ) { break ; } } } if ( runningProcess == " " ) { return 0 ; } return stoi ( runningProcess . c_str ( ) ) ; }
TODO: Read and return the number of running processes
TODO : Read and return the number of running processes