src/linux_parser.cpp
int LinuxParser::TotalProcesses() { 
    string key;
    int total;
    string line;
    std::ifstream stream(kProcDirectory +kStatFilename);
    if (stream) {
        while(std::getline(stream,line)){
          std::istringstream linestream(line);
          linestream >> key >> total;
          if (key == "processes") {
            break;
          }        
        }
    }
    return total;
}
// Done: Read and return the total number of processes
Read and return the total number of processes
Read and return the total number of processes
int LinuxParser::TotalProcesses() { 
    string key;
    int total;
    string line;
    std::ifstream stream(kProcDirectory +kStatFilename);
    if (stream) {
        while(std::getline(stream,line)){
          std::istringstream linestream(line);
          linestream >> key >> total;
          if (key == "processes") {
            break;
          }        
        }
    }
    return total;
}
int LinuxParser :: TotalProcesses ( ) { string key ; int total ; string line ; std :: ifstream stream ( kProcDirectory + kStatFilename ) ; if ( stream ) { while ( std :: getline ( stream , line ) ) { std :: istringstream linestream ( line ) ; linestream >> key >> total ; if ( key == " " ) { break ; } } } return total ; }
Done: Read and return the total number of processes
Done : Read and return the total number of processes