src/linux_parser.cpp
string LinuxParser::Uid(int pid) {
    string key, value,line;
  std::ifstream stream(kProcDirectory + std::to_string(pid) + kStatusFilename);
  if (stream.is_open()) {
    while (std::getline(stream, line)){
      std::istringstream linestream(line);
      while (linestream >> key >> value) {
        if (key == "Uid:") { 
          return value;
               }
      }
    }
    }
  return string();
}
// TODO: Read and return the user ID associated with a process
// REMOVE: [[maybe_unused]] once you define the function
Read and return the user ID associated with a process
REMOVE: [[maybe_unused]] once you define the function
Read and return the user ID associated with a process REMOVE : [[ maybe_unused ]] once you define the function
string LinuxParser::Uid(int pid) {
    string key, value,line;
  std::ifstream stream(kProcDirectory + std::to_string(pid) + kStatusFilename);
  if (stream.is_open()) {
    while (std::getline(stream, line)){
      std::istringstream linestream(line);
      while (linestream >> key >> value) {
        if (key == "Uid:") { 
          return value;
               }
      }
    }
    }
  return string();
}
string LinuxParser :: Uid ( int pid ) { string key , value , line ; std :: ifstream stream ( kProcDirectory + std :: to_string ( pid ) + kStatusFilename ) ; if ( stream . is_open ( ) ) { while ( std :: getline ( stream , line ) ) { std :: istringstream linestream ( line ) ; while ( linestream >> key >> value ) { if ( key == " " ) { return value ; } } } } return string ( ) ; }
TODO: Read and return the user ID associated with a process
REMOVE: [[maybe_unused]] once you define the function
TODO : Read and return the user ID associated with a process REMOVE : [[ maybe_unused ]] once you define the function