updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
@ -86,12 +86,21 @@ auto create_uuid_wstring() -> std::wstring {
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
auto generate_random_string(std::size_t length) -> std::string {
|
||||
std::string ret;
|
||||
if (length == 0U) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret.resize(length);
|
||||
for (std::size_t i = 0U; i < length; i++) {
|
||||
do {
|
||||
ret[i] = static_cast<char>(generate_random<std::uint8_t>() % 74 + 48);
|
||||
} while (((ret.at(i) >= 91) && (ret.at(i) <= 96)) ||
|
||||
((ret.at(i) >= 58) && (ret.at(i) <= 64)));
|
||||
for (auto &ch : ret) {
|
||||
std::array<unsigned int, 3U> random_list{
|
||||
generate_random_between(0U, 57U),
|
||||
generate_random_between(65U, 90U),
|
||||
generate_random_between(97U, 255U),
|
||||
};
|
||||
ch = static_cast<char>(
|
||||
random_list.at(repertory::utils::generate_random_between(0U, 2U)) %
|
||||
74U +
|
||||
48U);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -118,6 +127,10 @@ auto get_environment_variable(std::wstring_view variable) -> std::wstring {
|
||||
#if defined(PROJECT_ENABLE_BOOST)
|
||||
auto get_next_available_port(std::uint16_t first_port,
|
||||
std::uint16_t &available_port) -> bool {
|
||||
if (first_port == 0U) {
|
||||
return false;
|
||||
}
|
||||
|
||||
using namespace boost::asio;
|
||||
using ip::tcp;
|
||||
|
||||
@ -141,13 +154,4 @@ auto get_next_available_port(std::uint16_t first_port,
|
||||
return not error_code;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_BOOST)
|
||||
|
||||
auto resolve_variables(std::string str) -> std::string {
|
||||
return utils::path::absolute(str);
|
||||
}
|
||||
|
||||
auto resolve_variables(std::wstring_view str) -> std::wstring {
|
||||
return utils::string::from_utf8(
|
||||
resolve_variables(utils::string::to_utf8(str)));
|
||||
}
|
||||
} // namespace repertory::utils
|
||||
|
Reference in New Issue
Block a user