src/linux_parser.cpp
string LinuxParser::Uid(int pid) { 
    string key,temp_uid,uid;
    string line;
    std::ifstream stream(kProcDirectory + "/" + to_string(pid) + kStatusFilename);
    if (stream) {
        while(std::getline(stream,line)){
            std::istringstream linestream(line);
            while(linestream >> key >> temp_uid){
                if ( key == "Uid:") {
                  uid = temp_uid;
                  break;
                }
            }
        }
    }
    return uid;
}
// Done: Read and return the user ID associated with a process
Read and return the user ID associated with a process
Read and return the user ID associated with a process
string LinuxParser::Uid(int pid) { 
    string key,temp_uid,uid;
    string line;
    std::ifstream stream(kProcDirectory + "/" + to_string(pid) + kStatusFilename);
    if (stream) {
        while(std::getline(stream,line)){
            std::istringstream linestream(line);
            while(linestream >> key >> temp_uid){
                if ( key == "Uid:") {
                  uid = temp_uid;
                  break;
                }
            }
        }
    }
    return uid;
}
string LinuxParser :: Uid ( int pid ) { string key , temp_uid , uid ; string line ; std :: ifstream stream ( kProcDirectory + " " + to_string ( pid ) + kStatusFilename ) ; if ( stream ) { while ( std :: getline ( stream , line ) ) { std :: istringstream linestream ( line ) ; while ( linestream >> key >> temp_uid ) { if ( key == " " ) { uid = temp_uid ; break ; } } } } return uid ; }
Done: Read and return the user ID associated with a process
Done : Read and return the user ID associated with a process