Information about a person (such as username, e-mail, Role).
More...
#include <Person.h>
|
| | Person (Role r, std::string name, std::string email, unsigned count=0) |
| | Create a Person with Role r, name, email and count of changes.
|
|
const Role & | role () const |
| | Get Role of this Person.
|
|
const std::string & | name () const |
| | Get name of this Person.
|
|
const std::string & | email () const |
| | Get e-mail of this Person.
|
|
std::string | userName () const |
| | Get user name (from e-mail).
|
| auto | count () const |
| | Get count of changes historically done by this Person.
|
| std::string | pretty (bool includeName=true) const |
| | Pretty format as "username <e-mail>".
|
| template<typename T> |
| std::string | pretty (const T &translate, bool includeName=true) const |
| | Pretty format as "username <e-mail>".
|
| void | setEmail (const std::string &email) |
| | Re-set e-mail to email.
|
|
| static std::optional< Person > | parsePerson (std::string_view src, Role role) |
| | Parse src into a Person.
|
| static std::optional< Person > | parse (std::string_view src) |
| | Try to parse a line.
|
Information about a person (such as username, e-mail, Role).
◆ Person()
| SlKernCVS::Person::Person |
( |
Role | r, |
|
|
std::string | name, |
|
|
std::string | email, |
|
|
unsigned | count = 0 ) |
|
inline |
Create a Person with Role r, name, email and count of changes.
- Parameters
-
◆ count()
| auto SlKernCVS::Person::count |
( |
| ) |
const |
|
inline |
Get count of changes historically done by this Person.
- Returns
- Count of changes.
◆ parse()
| std::optional< Person > SlKernCVS::Person::parse |
( |
std::string_view | src | ) |
|
|
inlinestatic |
Try to parse a line.
- Parameters
-
- Returns
- A Person if successful, std::nullopt otherwise.
◆ parsePerson()
| std::optional< Person > SlKernCVS::Person::parsePerson |
( |
std::string_view | src, |
|
|
Role | role ) |
|
static |
◆ pretty() [1/2]
| std::string SlKernCVS::Person::pretty |
( |
bool | includeName = true | ) |
const |
|
inline |
Pretty format as "username <e-mail>".
- Parameters
-
| includeName | If output the username part |
- Returns
- Either "username <e-mail>" when
includeName is true or "e-mail" otherwise.
◆ pretty() [2/2]
template<typename T>
| std::string SlKernCVS::Person::pretty |
( |
const T & | translate, |
|
|
bool | includeName = true ) const |
|
inline |
Pretty format as "username <e-mail>".
- Parameters
-
| translate | A translate callback for e-mail |
| includeName | If output the username part |
- Returns
- Either "username <e-mail>" when
includeName is true or "e-mail" otherwise.
The e-mail is passed to translate() before passing to the output.
◆ setEmail()
| void SlKernCVS::Person::setEmail |
( |
const std::string & | email | ) |
|
|
inline |
Re-set e-mail to email.
- Parameters
-
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/slhelpers-20260428.f233ce9-build/slhelpers-20260428.f233ce9/include/kerncvs/Person.h