<commit_before>/***************************************************************
 *
 * Copyright (C) 1990-2009, Condor Team, Computer Sciences Department,
 * University of Wisconsin-Madison, WI.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ***************************************************************/


#ifndef __CONDOR_STRING_LIST_H
#define __CONDOR_STRING_LIST_H

#include "condor_common.h"
#include "condor_constants.h"
#include "list.h"


/*
  This primitive class is used to contain and search arrays of strings.
*/
class StringList {
public:
	StringList(const char *s = NULL, const char *delim = " ," );
	StringList(const char *s, char delim_char, bool keep_empty_fields );
	StringList( const StringList &other );
	virtual ~StringList();
	void initializeFromString (const char *);
	void initializeFromString (const char *, char delim_char);

	/** Note: the contains* methods have side affects -- they
		change "current" to point at the location of the match
		(so do the prefix* methods) */
	bool prefix( const char * );
	bool prefix_anycase( const char * );
	bool contains( const char * );
	bool contains_anycase( const char * );
	bool contains_withwildcard( const char *str );
	bool contains_anycase_withwildcard( const char * );
		// str: string to find
		// matches: if not NULL, list to insert matches into
		// returns true if any matching entries found
    bool find_matches_anycase_withwildcard( const char *str,<commit_msg>Add comment clarifying how StringList::prefix() works. #6958<commit_after>/***************************************************************
 *
 * Copyright (C) 1990-2009, Condor Team, Computer Sciences Department,
 * University of Wisconsin-Madison, WI.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ***************************************************************/


#ifndef __CONDOR_STRING_LIST_H
#define __CONDOR_STRING_LIST_H

#include "condor_common.h"
#include "condor_constants.h"
#include "list.h"


/*
  This primitive class is used to contain and search arrays of strings.
*/
class StringList {
public:
	StringList(const char *s = NULL, const char *delim = " ," );
	StringList(const char *s, char delim_char, bool keep_empty_fields );
	StringList( const StringList &other );
	virtual ~StringList();
	void initializeFromString (const char *);
	void initializeFromString (const char *, char delim_char);

	/** Note: the contains* methods have side affects -- they
		change "current" to point at the location of the match
		(so do the prefix* methods) */
	// prefix() works like contains_withwildcard() would if all of the
	// items in the list ended with a '*'. That is, it returns true if
	// any item in the list is a prefix of the given string.
	bool prefix( const char * );
	bool prefix_anycase( const char * );
	bool contains( const char * );
	bool contains_anycase( const char * );
	bool contains_withwildcard( const char *str );
	bool contains_anycase_withwildcard( const char * );
		// str: string to find
		// matches: if not NULL, list to insert matches into
		// returns true if any matching entries found
    bool find_matches_anycase_withwildcard( const char *str,
{'fraction_non_alphanumeric': 0.1424103921096945, 'fraction_numerical': 0.006735626653836902, 'mean_word_length': 4.4495412844036695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2205937', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1097, 'n_words': 477}