refactor ExtractorStructs.h for faster compiles. achieves approx. 10 secs

This commit is contained in:
Dennis Luxen
2014-01-09 16:13:35 +01:00
parent ce60af5029
commit 046fe93f1f
15 changed files with 418 additions and 176 deletions
+14
View File
@@ -184,4 +184,18 @@ inline bool StringStartsWith(
return boost::starts_with(input, prefix);
}
inline std::string GetRandomString() {
char s[128];
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < 127; ++i) {
s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
}
s[127] = 0;
return std::string(s);
}
#endif /* STRINGUTIL_H_ */