You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
|
|
//
|
|
// Purpose:
|
|
//
|
|
//=============================================================================
|
|
|
|
#ifndef BANNEDWORDS_H
|
|
#define BANNEDWORDS_H
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
//
|
|
// Implements censoring of bad words
|
|
//
|
|
class CBannedWordsDictionary;
|
|
class CBannedWords
|
|
{
|
|
public:
|
|
CBannedWords() { m_pDictionary = NULL; }
|
|
~CBannedWords();
|
|
|
|
// Initializes dictionary from a buffer
|
|
bool InitFromFile( char const *szFilename );
|
|
bool BInitialized() const { return m_pDictionary != NULL; }
|
|
|
|
// Censors banned words in the buffer, returns number of characters censored
|
|
int CensorBannedWordsInplace( wchar_t *wsz ) const;
|
|
int CensorBannedWordsInplace( char *sz ) const;
|
|
|
|
// Censors external string that cannot be stomped, stores the censored version
|
|
char const * CensorExternalString( uint64 ullKey, char const *szExternalString ) const;
|
|
|
|
private:
|
|
// Private implementation details
|
|
CBannedWordsDictionary *m_pDictionary;
|
|
};
|
|
|
|
extern CBannedWords g_BannedWords;
|
|
|
|
#endif // BANNEDWORDS_H
|