A non-POD version of "struct passwd" for thread- and memory-safe data access.
More...
A non-POD version of "struct passwd" for thread- and memory-safe data access.
Wraps the contents of a "struct passwd" instance to a non-POD object containing RAII-style data (e.g. OFString instead of const char*). To handle the old pointer behavior, OFPasswd objects can have an invalid state in which case all members are undefined. You can test whether an OFPasswd object is invalid or not with the overloaded operators "operator !" and "operator OFBool". Therefore, it behaves quite the same way as pointers in this regard.
- Note
- The downside of this non-POD class is that it leads to some unnecessary string copy operations. The resulting performance penalty should be insignificant. However, implementing this class based on auto_ptr / unique_ptr or using c++11 move semantics would prevent that, if somebody thinks it is necessary.