src/linux_parser.cpp
string LinuxParser::Command(int pid) 
{ 
  string line,pidString,pidDirectory;
  pidString = to_string(pid);
  pidDirectory = "/" + pidString;

  std::ifstream filestream(kProcDirectory + pidDirectory + kCmdlineFilename);
  if (filestream.is_open()) 
  {
    std::getline(filestream, line);
  }
  else
  {
    return string(); 
  }
  
  return line; 
}
//  Read and return the command associated with a process
Read and return the command associated with a process
Read and return the command associated with a process
string LinuxParser::Command(int pid) 
{ 
  string line,pidString,pidDirectory;
  pidString = to_string(pid);
  pidDirectory = "/" + pidString;
  std::ifstream filestream(kProcDirectory + pidDirectory + kCmdlineFilename);
  if (filestream.is_open()) 
  {
    std::getline(filestream, line);
  }
  else
  {
    return string(); 
  }
  return line; 
}
string LinuxParser :: Command ( int pid ) { string line , pidString , pidDirectory ; pidString = to_string ( pid ) ; pidDirectory = " " + pidString ; std :: ifstream filestream ( kProcDirectory + pidDirectory + kCmdlineFilename ) ; if ( filestream . is_open ( ) ) { std :: getline ( filestream , line ) ; } else { return string ( ) ; } return line ; }
Read and return the command associated with a process
Read and return the command associated with a process