src/linux_parser.cpp
string LinuxParser::Command(int pid) { 
  string line, cmd;
  std::ifstream stream(kProcDirectory + to_string(pid) + kCmdlineFilename);
  if (stream.is_open()){
    std::getline(stream, line);
    for (int i = 0; i < 50; i++){
        cmd = cmd + line[i];
    }
  }
  return cmd; 
}
// TODO: Read and return the command associated with a process
// REMOVE: [[maybe_unused]] once you define the function
Read and return the command associated with a process
REMOVE: [[maybe_unused]] once you define the function
Read and return the command associated with a process REMOVE : [[ maybe_unused ]] once you define the function
string LinuxParser::Command(int pid) { 
  string line, cmd;
  std::ifstream stream(kProcDirectory + to_string(pid) + kCmdlineFilename);
  if (stream.is_open()){
    std::getline(stream, line);
    for (int i = 0; i < 50; i++){
        cmd = cmd + line[i];
    }
  }
  return cmd; 
}
string LinuxParser :: Command ( int pid ) { string line , cmd ; std :: ifstream stream ( kProcDirectory + to_string ( pid ) + kCmdlineFilename ) ; if ( stream . is_open ( ) ) { std :: getline ( stream , line ) ; for ( int i = 0 ; i < 50 ; i ++ ) { cmd = cmd + line [ i ] ; } } return cmd ; }
TODO: Read and return the command associated with a process
REMOVE: [[maybe_unused]] once you define the function
TODO : Read and return the command associated with a process REMOVE : [[ maybe_unused ]] once you define the function