mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-15 01:07:58 -05:00
parse struct and union sequences
This commit is contained in:
17
src/ZoneCodeGeneratorLib/Utils/NameUtils.cpp
Normal file
17
src/ZoneCodeGeneratorLib/Utils/NameUtils.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "NameUtils.h"
|
||||
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
|
||||
std::string NameUtils::GenerateRandomName()
|
||||
{
|
||||
static constexpr auto ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
std::ostringstream str;
|
||||
|
||||
std::random_device random;
|
||||
|
||||
for (auto i = 0u; i < 32u; i++)
|
||||
str << ALPHABET[random() % std::char_traits<char>::length(ALPHABET)];
|
||||
|
||||
return str.str();
|
||||
}
|
Reference in New Issue
Block a user