MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / strcont

Function strcont

Source/Utility/strings.cpp:62–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62bool strcont(const char* string, const char* substring) {
63 size_t sub_len = strlen(substring);
64 size_t str_len = strlen(string);
65 for (size_t i = 0; i < str_len; i++) {
66 bool match = true;
67 if ((str_len - i) >= sub_len) {
68 for (size_t k = 0; k < sub_len; k++) {
69 if (string[i] != substring[k]) {
70 match = false;
71 break;
72 }
73 }
74 if (match) {
75 return true;
76 }
77 }
78 }
79 return false;
80}
81
82#ifdef WIN32
83wstring fromUTF8(const string& path_utf8) {

Callers 1

ReloadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected