Name Generator 1.0.0
Culture-aware name generation for C++23
Loading...
Searching...
No Matches
dasmig::name Class Reference

Return type for name generation, holding both individual parts and the full composed string. More...

#include <namegen.hpp>

Public Member Functions

std::uint64_t seed () const
 Retrieve the random seed used to generate this name.
 
const std::vector< std::wstring > & parts () const
 Return the individual parts (names/surnames) as a vector.
 
nameappend_name ()
 Append a forename to this name, preserving gender and culture.
 
nameappend_name (culture c)
 Append a forename of a specific culture.
 
nameappend_surname ()
 Append a surname to this name, preserving culture.
 
nameappend_surname (culture c)
 Append a surname of a specific culture.
 
 operator std::wstring () const
 Implicit conversion to std::wstring.
 
 operator std::vector< std::wstring > () const
 Implicit conversion to a vector of name parts.
 

Friends

class ng
 
std::wostream & operator<< (std::wostream &wos, const name &n)
 Stream the name to a wide output stream.
 

Detailed Description

Return type for name generation, holding both individual parts and the full composed string.

Supports implicit conversion to std::wstring, streaming via operator<<, and chained appending of names and surnames.

Definition at line 70 of file namegen.hpp.

Member Function Documentation

◆ append_name() [1/2]

name & dasmig::name::append_name ( )
inline

Append a forename to this name, preserving gender and culture.

Returns
*this for chaining.

Definition at line 709 of file namegen.hpp.

◆ append_name() [2/2]

name & dasmig::name::append_name ( culture  c)
inline

Append a forename of a specific culture.

Parameters
cCulture for the appended name.
Returns
*this for chaining.

Definition at line 715 of file namegen.hpp.

◆ append_surname() [1/2]

name & dasmig::name::append_surname ( )
inline

Append a surname to this name, preserving culture.

Returns
*this for chaining.

Definition at line 721 of file namegen.hpp.

◆ append_surname() [2/2]

name & dasmig::name::append_surname ( culture  c)
inline

Append a surname of a specific culture.

Parameters
cCulture for the appended surname.
Returns
*this for chaining.

Definition at line 727 of file namegen.hpp.

◆ operator std::vector< std::wstring >()

dasmig::name::operator std::vector< std::wstring > ( ) const
inline

Implicit conversion to a vector of name parts.

Definition at line 114 of file namegen.hpp.

◆ operator std::wstring()

dasmig::name::operator std::wstring ( ) const
inline

Implicit conversion to std::wstring.

Returns
The full composed name string.

Definition at line 108 of file namegen.hpp.

◆ parts()

const std::vector< std::wstring > & dasmig::name::parts ( ) const
inline

Return the individual parts (names/surnames) as a vector.

Returns
Vector of name parts.

Definition at line 83 of file namegen.hpp.

◆ seed()

std::uint64_t dasmig::name::seed ( ) const
inline

Retrieve the random seed used to generate this name.

Returns
The per-call seed for replay.
See also
ng::get_name(gender, culture, std::uint64_t)

Definition at line 76 of file namegen.hpp.

Friends And Related Symbol Documentation

◆ ng

friend class ng
friend

Definition at line 146 of file namegen.hpp.

◆ operator<<

std::wostream & operator<< ( std::wostream &  wos,
const name n 
)
friend

Stream the name to a wide output stream.

Parameters
wosOutput stream.
nName to stream.
Returns
Reference to the output stream.

Definition at line 123 of file namegen.hpp.


The documentation for this class was generated from the following file: