iOS: fix app id in path, pen pressure filtering on Line
This commit is contained in:
18
src/util.cpp
18
src/util.cpp
@@ -508,6 +508,22 @@ bool str_iequals(const std::string& a, const std::string& b)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string str_replace(const std::string& string, const std::string& search, const std::string& replace)
|
||||
{
|
||||
std::string ret = string;
|
||||
// Get the first occurrence
|
||||
size_t pos = ret.find(search);
|
||||
// Repeat till end is reached
|
||||
while(pos != std::string::npos)
|
||||
{
|
||||
// Replace this occurrence of Sub String
|
||||
ret.replace(pos, search.size(), replace);
|
||||
// Get the next occurrence from the current position
|
||||
pos = ret.find(search, pos + replace.size());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const char* gl2str(GLenum err)
|
||||
{
|
||||
switch (err)
|
||||
@@ -611,4 +627,4 @@ void parallel_for(unsigned nb_elements, std::function<void(int i)> functor, bool
|
||||
// Wait for the other thread to finish their task
|
||||
if (use_threads)
|
||||
std::for_each(my_threads.begin(), my_threads.end(), std::mem_fn(&std::thread::join));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user