16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 11:19:19 +02:00

maintenance: string search methods

This commit is contained in:
tmj-fstate
2021-05-27 14:23:00 +02:00
parent b3940d47cb
commit 7b816594ba
23 changed files with 120 additions and 106 deletions

View File

@@ -475,6 +475,19 @@ starts_with( std::string_view const String, std::string_view Prefix ) {
&& ( 0 == String.compare( 0, Prefix.size(), Prefix ) );
}
// returns true if provided string contains another provided string
bool
contains( std::string_view const String, std::string_view Substring ) {
return ( String.find( Substring ) != std::string::npos );
}
bool
contains( std::string_view const String, char Character ) {
return ( String.find( Character ) != std::string::npos );
}
// helper, restores content of a 3d vector from provided input stream
// TODO: review and clean up the helper routines, there's likely some redundant ones
glm::dvec3 LoadPoint( cParser &Input ) {