Foundry.FileSearchOptions¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
|||
[ |
r/w/en |
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
[ |
r/w/en |
||
r/w/en |
|||
r |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Foundry.FileSearchOptions(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Configuration options for file search operations.
This class provides configuration options for searching text within files. It supports various search modes including case sensitivity, whole word matching, regular expressions, and pattern-based file filtering. You can specify search targets, set maximum match limits, and configure context lines around matches.
Added in version 1.1.
- classmethod new()¶
- Returns:
a new [class`Foundry`.FileSearchOptions]
- Return type:
Creates a new [class`Foundry`.FileSearchOptions] instance.
Added in version 1.1.
- add_target(file)¶
- Parameters:
file (
Gio.File) – a [iface`Gio`.File] to add as a search target
Adds a file as a target for searching.
Added in version 1.1.
- copy()¶
- Returns:
a new [class`Foundry`.FileSearchOptions]
- Return type:
Creates a new [class`Foundry`.FileSearchOptions] with a copy of all the values from the original.
- dup_excluded_patterns()¶
- Returns:
a newly allocated array of excluded file patterns, or
Noneif not set. Free withGLib.strfreev() when no longer needed.- Return type:
Gets a copy of the excluded file patterns.
These patterns define which files should be excluded from the search. Files that match any of these patterns will be skipped during the search. The patterns use shell-style globbing (e.g. “*.o”).
Added in version 1.1.
- dup_required_patterns()¶
- Returns:
a newly allocated array of required file patterns, or
Noneif not set. Free withGLib.strfreev() when no longer needed.- Return type:
Gets a copy of the required file patterns.
These patterns define which files must match to be included in the search. Files that do not match any of these patterns will be excluded from the search. The patterns use shell-style globbing (e.g. “*.c”, “*.h”).
Added in version 1.1.
- dup_search_text()¶
-
Gets a copy of the search text.
Added in version 1.1.
- get_case_sensitive()¶
-
Gets whether the search should be case sensitive.
Added in version 1.1.
- get_context_lines()¶
- Returns:
the number of context lines
- Return type:
Gets the number of context lines to include with each match. A value of 1 means 1 line before and 1 line after the match.
Added in version 1.1.
- get_match_whole_words()¶
-
Gets whether the search should match whole words only.
Added in version 1.1.
- get_max_matches()¶
- Returns:
the maximum number of matches
- Return type:
Gets the maximum number of matches to return.
Added in version 1.1.
- get_recursive()¶
-
Gets whether the search should be recursive.
Added in version 1.1.
- get_use_regex()¶
-
Gets whether the search should use regular expressions.
Added in version 1.1.
- list_targets()¶
- Returns:
a [iface`Gio`.ListModel] of [iface`Gio`.File] that are targets for searching.
- Return type:
Gets the list of files that are targets for searching.
Added in version 1.1.
- remove_target(file)¶
- Parameters:
file (
Gio.File) – a [iface`Gio`.File] to remove from search targets
Removes a file from the search targets.
Added in version 1.1.
- set_case_sensitive(case_sensitive)¶
- Parameters:
case_sensitive (
bool) – whether the search should be case sensitive
Sets whether the search should be case sensitive.
Added in version 1.1.
- set_context_lines(context_lines)¶
- Parameters:
context_lines (
int) – the number of context lines to include with each match
Sets the number of context lines to include with each match. A value of 1 means 1 line before and 1 line after the match.
Added in version 1.1.
- set_excluded_patterns(excluded_patterns)¶
-
Sets the excluded file patterns.
These patterns define which files should be excluded from the search. Files that match any of these patterns will be skipped during the search. The patterns use shell-style globbing (e.g. “*.o”).
Added in version 1.1.
- set_match_whole_words(match_whole_words)¶
- Parameters:
match_whole_words (
bool) – whether the search should match whole words only
Sets whether the search should match whole words only.
Added in version 1.1.
- set_max_matches(max_matches)¶
- Parameters:
max_matches (
int) – the maximum number of matches to return
Sets the maximum number of matches to return.
Added in version 1.1.
- set_recursive(recursive)¶
- Parameters:
recursive (
bool) – whether the search should be recursive
Sets whether the search should be recursive.
Added in version 1.1.
- set_required_patterns(required_patterns)¶
-
Sets the required file patterns.
These patterns define which files must match to be included in the search. Files that do not match any of these patterns will be excluded from the search. The patterns use shell-style globbing (e.g. “*.c”, “*.h”).
Added in version 1.1.
- set_search_text(search_text)¶
-
Sets the search text.
Added in version 1.1.
Property Details¶
- Foundry.FileSearchOptions.props.case_sensitive¶
- Name:
case-sensitive- Type:
- Default Value:
- Flags:
- Foundry.FileSearchOptions.props.context_lines¶
- Name:
context-lines- Type:
- Default Value:
1- Flags:
- Foundry.FileSearchOptions.props.excluded_patterns¶
- Name:
excluded-patterns- Type:
[
str]- Default Value:
[]- Flags:
- Foundry.FileSearchOptions.props.match_whole_words¶
- Name:
match-whole-words- Type:
- Default Value:
- Flags:
- Foundry.FileSearchOptions.props.max_matches¶
- Name:
max-matches- Type:
- Default Value:
10000- Flags:
- Foundry.FileSearchOptions.props.recursive¶
- Name:
recursive- Type:
- Default Value:
- Flags:
- Foundry.FileSearchOptions.props.required_patterns¶
- Name:
required-patterns- Type:
[
str]- Default Value:
[]- Flags:
- Foundry.FileSearchOptions.props.search_text¶
- Name:
search-text- Type:
- Default Value:
- Flags:
- Foundry.FileSearchOptions.props.targets¶
- Name:
targets- Type:
- Default Value:
- Flags: