mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 21:49:19 +02:00
Better Split implementation and remove of unused overloads
This commit is contained in:
@@ -415,7 +415,7 @@ bool NvTexture::CreateRhiTexture() {
|
|||||||
backend->GetDevice()->executeCommandList(command_list,
|
backend->GetDevice()->executeCommandList(command_list,
|
||||||
nvrhi::CommandQueue::Graphics);
|
nvrhi::CommandQueue::Graphics);
|
||||||
if (m_sz_texture->get_type() == "make:") {
|
if (m_sz_texture->get_type() == "make:") {
|
||||||
auto const components{Split(std::string(m_sz_texture->get_name()), '?')};
|
auto const components{Split(m_sz_texture->get_name(), '?')};
|
||||||
|
|
||||||
auto dictionary = std::make_shared<dictionary_source>(components.back());
|
auto dictionary = std::make_shared<dictionary_source>(components.back());
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <ranges>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -154,35 +155,12 @@ bool FuzzyLogicAI(double Test, double Threshold, double Probability)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> &Split(const std::string &s, char delim, std::vector<std::string> &elems)
|
std::vector<std::string> Split(std::string_view s, char delim)
|
||||||
{ // dzieli tekst na wektor tekstow
|
{ // dzieli tekst na wektor tekstow
|
||||||
|
std::vector<std::string> out;
|
||||||
std::stringstream ss(s);
|
for (const auto& part : s | std::ranges::views::split(delim))
|
||||||
std::string item;
|
out.emplace_back(part.begin(), part.end());
|
||||||
while (std::getline(ss, item, delim))
|
return out;
|
||||||
{
|
|
||||||
elems.push_back(item);
|
|
||||||
}
|
|
||||||
return elems;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> Split(const std::string &s, char delim)
|
|
||||||
{ // dzieli tekst na wektor tekstow
|
|
||||||
std::vector<std::string> elems;
|
|
||||||
Split(s, delim, elems);
|
|
||||||
return elems;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> Split(const std::string &s)
|
|
||||||
{ // dzieli tekst na wektor tekstow po białych znakach
|
|
||||||
std::vector<std::string> elems;
|
|
||||||
std::stringstream ss(s);
|
|
||||||
std::string item;
|
|
||||||
while (ss >> item)
|
|
||||||
{
|
|
||||||
elems.push_back(item);
|
|
||||||
}
|
|
||||||
return elems;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<std::string, int> split_string_and_number(std::string const &Key)
|
std::pair<std::string, int> split_string_and_number(std::string const &Key)
|
||||||
|
|||||||
@@ -122,9 +122,7 @@ bool FuzzyLogicAI(double Test, double Threshold, double Probability);
|
|||||||
/*to samo ale zawsze niezaleznie od DebugFlag*/
|
/*to samo ale zawsze niezaleznie od DebugFlag*/
|
||||||
|
|
||||||
/*operacje na stringach*/
|
/*operacje na stringach*/
|
||||||
std::vector<std::string> &Split(const std::string &s, char delim, std::vector<std::string> &elems);
|
std::vector<std::string> Split(std::string_view s, char delim);
|
||||||
std::vector<std::string> Split(const std::string &s, char delim);
|
|
||||||
// std::vector<std::string> Split(const std::string &s);
|
|
||||||
std::pair<std::string, int> split_string_and_number(std::string const &Key);
|
std::pair<std::string, int> split_string_and_number(std::string const &Key);
|
||||||
|
|
||||||
std::string to_string(int Value);
|
std::string to_string(int Value);
|
||||||
|
|||||||
Reference in New Issue
Block a user