DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
User.cpp File Reference
#include <pwd.h>
#include <iostream>
#include <sstream>
#include "ers/ers.hpp"
#include "okssystem/User.hpp"
#include "okssystem/exceptions.hpp"
Include dependency graph for User.cpp:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &stream, const OksSystem::User &user) throw ()
bool operator== (const OksSystem::User &a, const OksSystem::User &b) throw ()
bool operator!= (const OksSystem::User &a, const OksSystem::User &b) throw ()

Function Documentation

◆ operator!=()

bool operator!= ( const OksSystem::User & a,
const OksSystem::User & b )
throw ( )

Inequality operator

Parameters
afirst user to compare
bsecond user to compare
Returns
true if they are not equal

Definition at line 276 of file User.cpp.

276 {
277 return a.identity() != b.identity();
278} //
uid_t identity() const
user-id
Definition User.cpp:101

◆ operator<<()

std::ostream & operator<< ( std::ostream & stream,
const OksSystem::User & user )
throw ( )

Output operator, writes username followed by uid between parenthesis

Parameters
streamthe stream to write into
userthe user object to write
Returns
parameter stream

Definition at line 253 of file User.cpp.

253 {
254 unsigned int i = (unsigned int) user.identity();
255 const std::string name = user.name_safe();
256 stream << name << '(' << i << ')';
257 return stream;
258} // operator<<
const std::string & name_safe() const
username - no exception
Definition User.cpp:209

◆ operator==()

bool operator== ( const OksSystem::User & a,
const OksSystem::User & b )
throw ( )

Equality operator

Parameters
afirst user to compare
bsecond user to compare
Returns
true if they are equal

Definition at line 266 of file User.cpp.

266 {
267 return a.identity() == b.identity();
268} //