Filter illegal character three

xiaoxiao2021-03-06  105

Implement file:

#include "stdafx.h"

#include #include #include #include

#include "Wordlib.h" #include "_string.h"

Namespace wordlib {

Typedef st :: basic_string __string; typedef std :: vector <__ string> __wordlist;

Static const char * __STRWORDLIB [] = {"***", "***", "**** you", "script"}

Static __wordlist __wordlist;

Static __string __nullstr = "";

Void __initwordlist () {if (__ wordlist.size ()! = 0) Return;

For (size_t i = 0; i

Std :: sort (__ WordList.begin (), __wordlist.end ());

BOOL _FLYINGMAGIC_2_CUT_WORD IsValid (const char * str) {__ initword (); if (str! = null) {__ string strsrc (STR);

__Wordlist :: item ity = __WordList.end ();

For (__ wordlist :: item.begin (); it! = ity; {i (strsrc.find (* it)! = -1) Return False;}}

Return True;}

BOOL _FLYINGMAGIC_2_CUT_WORD FILTRATE (CHAR * DST, SIZE_T LEN, Const Char * src) {__ initwordlist ();

BOOL BRET = FALSE;

IF (src! = null && dst! = null && strlen (src) <= len) {__ String STRSRC (SRC)

__Wordlist :: item ity = __WordList.end ();

For (__ wordlist :: item (); it! = ipnd; {__ string :: size_type beginning = strsrc.find (* it); if (begin! = -1) {for (__ string :: size_type t = 0; t size (); T) strsrc [begin t] = ''; // strsrc.assign (__ nullstr, begin, it-> size ());

Bret = True;}}

STRCPY (DST, strsrc.c_str ());

转载请注明原文地址:https://www.9cbs.com/read-104069.html

New Post(0)