Name Generator 4.5.2
Culture-aware name generation for C++23
Loading...
Searching...
No Matches
namegen.hpp File Reference

Name generator library — culture-aware name generation for C++23. More...

#include "core.hpp"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <functional>
#include <iterator>
#include <limits>
#include <map>
#include <optional>
#include <ostream>
#include <span>
#include <stdexcept>
#include <string>
#include <string_view>
#include <system_error>
#include <tuple>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  dasmig::name_request
 The per-call choices of a generation: gender and culture. More...
 
struct  dasmig::naming_convention
 How a culture composes a full name; see ng::convention(). More...
 
struct  dasmig::name_parts
 The words of a name the caller already has; see ng::compose_name(). More...
 
struct  dasmig::child_name_request
 The per-call choices of ng::get_child_name(). More...
 
class  dasmig::name
 Return type for name generation, holding both individual parts and the full composed string. More...
 
class  dasmig::ng
 Name generator that produces culture-aware names and surnames. More...
 

Enumerations

enum class  dasmig::culture : std::uint8_t {
  afghan , albanian , algerian , american ,
  angolan , argentinian , austrian , azerbaijani ,
  bahraini , bangladeshi , belgian , bolivian ,
  botswanan , brazilian , british , bruneian ,
  bulgarian , burkinabe , burundian , cambodian ,
  cameroonian , canadian , chilean , chinese ,
  colombian , costarican , croatian , cypriot ,
  czech , danish , djiboutian , dutch ,
  ecuadorian , egyptian , emirati , estonian ,
  ethiopian , fijian , filipino , finnish ,
  french , georgian , german , ghanaian ,
  greek , guatemalan , haitian , honduran ,
  hongkonger , hungarian , icelandic , indian ,
  indonesian , iranian , iraqi , irish ,
  israeli , italian , jamaican , japanese ,
  jordanian , kazakh , korean , kuwaiti ,
  lebanese , libyan , lithuanian , luxembourgish ,
  macanese , malaysian , maldivian , maltese ,
  mauritian , mexican , moldovan , moroccan ,
  namibian , nigerian , norwegian , omani ,
  palestinian , panamanian , peruvian , polish ,
  portuguese , puertorican , qatari , russian ,
  salvadoran , saudi , serbian , singaporean ,
  slovenian , southafrican , spanish , sudanese ,
  swedish , swiss , syrian , taiwanese ,
  tunisian , turkish , turkmen , uruguayan ,
  yemeni , any
}
 Culture representing a country or a broader group. More...
 
enum class  dasmig::gender : std::uint8_t { m , f , any }
 Simple gender enum to distinguish between male and female names. More...
 
enum class  dasmig::name_order : std::uint8_t { given_family , family_given }
 The order a culture writes the given and the family name in. More...
 
enum class  dasmig::patronymic_style : std::uint8_t { none , east_slavic , icelandic }
 How a culture forms a patronymic from the father's given name. More...
 
enum class  dasmig::surname_order : std::uint8_t { paternal_first , maternal_first }
 Which parents' surnames a child of a two-surname culture takes, and in what order. More...
 
enum class  dasmig::name_role : std::uint8_t { given , patronymic , family , family2 }
 The part of a full name a word is. More...
 

Detailed Description

Name generator library — culture-aware name generation for C++23.

Author
Diego Dasso Migotto (diegomigotto at hotmail dot com)
See also
See doc/usage.md for the narrative tutorial.

Definition in file namegen.hpp.

Enumeration Type Documentation

◆ culture

enum class dasmig::culture : std::uint8_t
strong

Culture representing a country or a broader group.

Definition at line 47 of file namegen.hpp.

◆ gender

enum class dasmig::gender : std::uint8_t
strong

Simple gender enum to distinguish between male and female names.

Definition at line 158 of file namegen.hpp.

◆ name_order

enum class dasmig::name_order : std::uint8_t
strong

The order a culture writes the given and the family name in.

Enumerator
given_family 

John Smith.

family_given 

Kim Minjun.

Definition at line 181 of file namegen.hpp.

◆ name_role

enum class dasmig::name_role : std::uint8_t
strong

The part of a full name a word is.

Enumerator
family2 

The second surname of a double surname.

Definition at line 218 of file namegen.hpp.

◆ patronymic_style

enum class dasmig::patronymic_style : std::uint8_t
strong

How a culture forms a patronymic from the father's given name.

Enumerator
east_slavic 

Ivan gives Ivanovich or Ivanovna.

icelandic 

Jón gives Jónsson or Jónsdóttir.

Definition at line 188 of file namegen.hpp.

◆ surname_order

enum class dasmig::surname_order : std::uint8_t
strong

Which parents' surnames a child of a two-surname culture takes, and in what order.

Enumerator
paternal_first 

The father's first surname, then the mother's first (Spain).

maternal_first 

The mother's last surname, then the father's last (Portugal).

Definition at line 197 of file namegen.hpp.