BATCH_GREP_INFO

Used by Editor_BatchFindInFiles and Editor_BatchReplaceInFiles inline functions ( EE_FIND_IN_FILESW and EE_REPLACE_IN_FILESW message s).

typedef struct _BATCH_GREP_INFO {
	UINT cbSize; // sizeof( BATCH_GREP_INFO )
	UINT nBatchCount;
	UINT64 nBatchFlags;
	UINT64 nTotalCount;
	LPCWSTR pszPath;
	LPCWSTR pszBackupPath;
	LPCWSTR pszFilesToIgnore;
	UINT nCP;
	UINT nLimit;
	HRESULT hr;
} BATCH_GREP_INFO;

Fields

cbSize

Specifies size_of(BATCH_GREP_INFO).

nBatchCount

Specifies the number of FIND_REPLACE_INFO structures specified in lParam.

nBatchFlags

Specifies a combination of the following values.

FLAG_FIND_COUNT_FREQUENCY

Creates a table of frequent strings from the results. Must combine with FLAG_FIND_OUTPUT_DISPLAY.

FLAG_FIND_IGNORE_FILES

Ignores the files or folders specified by pszFilesToIgnore.

FLAG_FIND_RECURSIVE

Searches in subfolders of the specified path.

FLAG_FIND_REGEX_BOOST

Uses Boost.Regex as the regular expression engine.

FLAG_FIND_REGEX_ONIGMO

Uses Onigmo as the regular expression engine.

FLAG_FIND_OPEN_DIRECT

Directly opens the document that includes the specified string. Cannot combine with FLAG_FIND_OPEN_FILTER or FLAG_FIND_OUTPUT.

FLAG_FIND_OPEN_FILTER

Directly opens the document that includes the specified string, and set the specified string as the filter. Cannot combine with FLAG_FIND_OPEN_DIRECT or FLAG_FIND_OUTPUT.

FLAG_FIND_OUTPUT

Displays the Find in Files results as a list in the Output Bar. Cannot combine with FLAG_FIND_OPEN_DIRECT or FLAG_FIND_OPEN_FILTER.

FLAG_FIND_OUTPUT_ENCODING

Appends encoding names to file names.

FLAG_FIND_SEPARATE_CRLF

Treats CR and LF separately.

FLAG_REPLACE_BACKUP

Saves the backups. Cannot be combined with FLAG_REPLACE_KEEP_OPEN.

FLAG_REPLACE_KEEP_OPEN

Keeps the modified files open. Cannot combine with eeReplaceBackup. Cannot be combined with FLAG_REPLACE_BACKUP.

Additionally, you may specify one of the following values.

FLAG_FIND_FILE_AND_MATCHED

File names and matched strings will be displayed.

FLAG_FIND_FILE_LINE_AND_MATCHED

File names, line numbers and matched strings will be displayed.

FLAG_FIND_FILENAMES_ONLY

Only file names will be displayed and the whole lines containing the searched string will not be displayed as results.

FLAG_FIND_LINE_ONLY

Only the whole lines containing the searched string will be displayed as results.

FLAG_FIND_MATCHED_ONLY

Only the matched strings will be displayed as results.

nTotalCount

On return, this field will contain the total number of the occurrences of the matched string in all the searched files. If this is not used for replacing in files, the return value is the total number of lines containing matched strings in all the searched files.

pszFind

Specifies a string to search for.

pszReplace

When replacing in files, specifies a string to replace with.

pszPath

Specifies a path to search from. It can include wild cards such as * and ?.

pszBackupPath

When replacing in files, specifies the backup folder, if nFlags includes FLAG_REPLACE_BACKUP.

pszFilesToIgnore

If nFlags includes FLAG_FIND_IGNORE_FILES, specifies the file or folder names to ignore. It can include wild cards such as * and ?. To specify multiple files, use semicolons (;) to separate them.

nCP

Specifies a code page by which a file is opened.

CODEPAGE_ANSI

Normal ANSI

CODEPAGE_UNICODE

Unicode little endian

CODEPAGE_UNICODE_BIGENDIAN

Unicode big endian

CODEPAGE_UTF8

UTF-8

CODEPAGE_UTF7

UTF-7

CODEPAGE_932

Japanese Shift JIS

CODEPAGE_JIS

Japanese JIS

CODEPAGE_EUC

Japanese EUC

CODEPAGE_AUTO_SJIS_JIS

Converts from Japanese Shift JIS and JIS.

CODEPAGE_AUTO_SJIS_JIS_EUC

Converts form Japanese Shift JIS、JIS、EUC.

Others

All code pages you can used by system.

CODEPAGE_DETECT_UNICODE

Detects Unicode. Can be combined with another value.

CODEPAGE_DETECT_UTF8

Detects UTF-8. Can be combined with another value.

CODEPAGE_DETECT_CHARSET

Detects HTML/XML Charset. Can be combined with another value.

CODEPAGE_DETECT_ALL

Detects all code pages. Can be combined with another value.

nLimit

EmEditor stops searching files when the number of matches reaches this number. If 0 is specified, EmEditor does not stop searching files.

hr

This field will be filled with the result value where the negative value indicates an error. Error values include the following values.

E_WRONG_NUM_FORMAT

An incorrect format of a number/IP address range was detected.

E_REGEX_UNKNOWN

An unknown error occurred in the regular expression engine.

Version

Supported on EmEditor Professional Version 20.0 or later.