In this article, I share with you a simple C++ class that wraps the string tokenization function strtok(). The QuickTokenizer class makes it easy to tokenize and enumerate the tokens in a thread-safe manner.
The class code
//////////////////////////////////////////////////////////////////////////
class QuickTokenizer
{
private:
char *buf;
char *token;
char *ctx;
void FreeBuffers()
{
if (this->token != NULL)
{
free(this->token);
this->token = NULL;
}
if (this->buf != NULL)
{
free(this->buf);
this->buf = NULL;
}
}
public:
QuickTokenizer() : buf(NULL), token(NULL)
{
}
const char *Tokenize(
const char *str,
const char *tok)
{
this->buf = _strdup(str);
this->token = _strdup(tok);
return strtok_s(buf, token, &ctx);
}
const char *NextToken()
{
return strtok_s(NULL, token, &ctx);
}
~QuickTokenizer()
{
FreeBuffers();
}
};
In this article, I am sharing with you a small Python script that lets you detect if a file is an executable file and what platform the executable is targeting.
Hello,



Some infamous sayings about women:

