Counter Strike : Global Offensive Source Code
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

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef BANNEDWORDS_H
  7. #define BANNEDWORDS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //
  12. // Implements censoring of bad words
  13. //
  14. class CBannedWordsDictionary;
  15. class CBannedWords
  16. {
  17. public:
  18. CBannedWords() { m_pDictionary = NULL; }
  19. ~CBannedWords();
  20. // Initializes dictionary from a buffer
  21. bool InitFromFile( char const *szFilename );
  22. bool BInitialized() const { return m_pDictionary != NULL; }
  23. // Censors banned words in the buffer, returns number of characters censored
  24. int CensorBannedWordsInplace( wchar_t *wsz ) const;
  25. int CensorBannedWordsInplace( char *sz ) const;
  26. // Censors external string that cannot be stomped, stores the censored version
  27. char const * CensorExternalString( uint64 ullKey, char const *szExternalString ) const;
  28. private:
  29. // Private implementation details
  30. CBannedWordsDictionary *m_pDictionary;
  31. };
  32. extern CBannedWords g_BannedWords;
  33. #endif // BANNEDWORDS_H