Refactors constants out of Genders.h.

This commit is contained in:
2023-04-25 13:40:12 -07:00
parent f35c0f21d0
commit dc4295bd86
3 changed files with 21 additions and 14 deletions

View File

@@ -7,6 +7,21 @@ namespace SBF {
using std::string;
using std::vector;
const int kGendersCount = 5;
const std::string kGenderMaleLabel = "Male";
const std::string kGenderFemaleLabel = "Female";
const std::string kGenderTransMaleLabel = "Trans-Male";
const std::string kGenderTransFemaleLabel = "Trans-Female";
const std::string kGenderNonBinaryLabel = "Non-Binary";
const std::string kGenderLabels[] = {
"",
kGenderMaleLabel,
kGenderFemaleLabel,
kGenderTransMaleLabel,
kGenderTransFemaleLabel,
kGenderNonBinaryLabel,
};
string GetGenderLabel(int genderId) {
if (genderId > 0 && genderId <= kGendersCount) {
return kGenderLabels[genderId];