gtksourceviewmm: gtksourceview::SourceIter Class Reference

gtksourceviewmm 2.10.3

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
gtksourceview::SourceIter Class Reference

An iterator type for SourceBuffer. More...

`#include <gtksourceviewmm/sourceiter.h>`

Inheritance diagram for gtksourceview::SourceIter:
[legend]

List of all members.

## Public Member Functions
| SourceIter ()
| Default constructor.
bool | forward_search (const Glib::ustring& a_str, SearchFlags a_flags, Gtk::TextIter& a_match_start, Gtk::TextIter& a_match_end, const Gtk::TextIter& a_limit) const
| Searches forward for a_str.
bool | backward_search (const Glib::ustring& a_str, SearchFlags a_flags, Gtk::TextIter& a_match_start, Gtk::TextIter& a_match_end, const Gtk::TextIter& a_limit) const
| Searches backward for a_str.
bool | forward_search (const Glib::ustring& str, SourceSearchFlags flags, Gtk::TextIter& match_start, Gtk::TextIter& match_end, const Gtk::TextIter& limit) const
| Searches forward for str.
bool | forward_search (const Glib::ustring& str, SourceSearchFlags flags, Gtk::TextIter& match_start, Gtk::TextIter& match_end) const
| Searches forward for str.
bool | backward_search (const Glib::ustring& str, SourceSearchFlags flags, Gtk::TextIter& match_start, Gtk::TextIter& match_end, const Gtk::TextIter& limit) const
| Searches backward for str.
bool | backward_search (const Glib::ustring& str, SourceSearchFlags flags, Gtk::TextIter& match_start, Gtk::TextIter& match_end) const
| Searches backward for str.

## Detailed Description

An iterator type for SourceBuffer.

Provides search features.

## Constructor & Destructor Documentation

gtksourceview::SourceIter::SourceIter | ( |  | ) |

Default constructor.

Returns:
  New SourceIter.

## Member Function Documentation

bool gtksourceview::SourceIter::backward_search | ( | const Glib::ustring & | a_str,
|  | SearchFlags | a_flags,
|  | Gtk::TextIter & | a_match_start,
|  | Gtk::TextIter & | a_match_end,
|  | const Gtk::TextIter & | a_limit
| ) |  | const

Searches backward for a_str.

Same as forward_search(), but backwards.

Parameters:

  a_str | A search string.
  a_flags | Flags affecting how the search is done.
  a_match_start | Return location for start of match.
  a_match_end | Return location for end of match.
  a_limit | Bound for the search.

Returns:
  Whether a match was found.

Deprecated:
  Use method using SourceSearchFlags.

bool gtksourceview::SourceIter::backward_search | ( | const Glib::ustring & | str,
|  | SourceSearchFlags | flags,
|  | Gtk::TextIter & | match_start,
|  | Gtk::TextIter & | match_end,
|  | const Gtk::TextIter & | limit
| ) |  | const

Searches backward for str.

Same as Same as forward_search(), but backwards.

Parameters:

  str | A search string.
  flags | Flags affecting how the search is done.
  match_start | Return location for start of match.
  match_end | Return location for end of match.
  limit | Bound for the search.

Returns:
  Whether a match was found.

Since gtksourceviewmm 2.10:

bool gtksourceview::SourceIter::backward_search | ( | const Glib::ustring & | str,
|  | SourceSearchFlags | flags,
|  | Gtk::TextIter & | match_start,
|  | Gtk::TextIter & | match_end
| ) |  | const

Searches backward for str.

Same as backward_search(), but searches to the start.

Parameters:

  str | A search string.
  flags | Flags affecting how the search is done.
  match_start | Return location for start of match.
  match_end | Return location for end of match.

Returns:
  Whether a match was found.

Since gtksourceviewmm 2.10:

bool gtksourceview::SourceIter::forward_search | ( | const Glib::ustring & | a_str,
|  | SearchFlags | a_flags,
|  | Gtk::TextIter & | a_match_start,
|  | Gtk::TextIter & | a_match_end,
|  | const Gtk::TextIter & | a_limit
| ) |  | const

Searches forward for a_str.

Any match is returned by setting a_match_start to the first character of the match and a_match_end to the first character after the match. The search will not continue past a_limit. Note that a search is a linear or O(n) operation, so you may wish to use a_limit to avoid locking up your UI on large buffers.

If the SEARCH_VISIBLE_ONLY flag is present, the match may have invisible text interspersed in a_str. i.e. a_str will be a possibly-noncontiguous subsequence of the matched range. Similarly, if you specify SEARCH_TEXT_ONLY, the match may have pixbufs or child widgets mixed inside the matched range. If these flags are not given, the match must be exact; the special `0xFFFC` character in a_str will match embedded pixbufs or child widgets. If you specify the SEARCH_CASE_INSENSITIVE flag, the text will be matched regardless of what case it is in.

Same as Gtk::TextIter::forward_search(), but supports case insensitive searching.

Parameters:

  a_str | A search string.
  a_flags | Flags affecting how the search is done.
  a_match_start | Return location for start of match.
  a_match_end | Return location for end of match.
  a_limit | Bound for the search.

Returns:
  Whether a match was found

Deprecated:
  Use method using SourceSearchFlags.

bool gtksourceview::SourceIter::forward_search | ( | const Glib::ustring & | str,
|  | SourceSearchFlags | flags,
|  | Gtk::TextIter & | match_start,
|  | Gtk::TextIter & | match_end,
|  | const Gtk::TextIter & | limit
| ) |  | const

Searches forward for str.

Any match is returned by setting match_start to the first character of the match and match_end to the first character after the match. The search will not continue past limit. Note that a search is a linear or O(n) operation, so you may wish to use limit to avoid locking up your UI on large buffers.

If the SEARCH_VISIBLE_ONLY flag is present, the match may have invisible text interspersed in str. i.e. str will be a possibly-noncontiguous subsequence of the matched range. Similarly, if you specify SEARCH_TEXT_ONLY, the match may have pixbufs or child widgets mixed inside the matched range. If these flags are not given, the match must be exact; the special `0xFFFC` character in str will match embedded pixbufs or child widgets. If you specify the SEARCH_CASE_INSENSITIVE flag, the text will be matched regardless of what case it is in.

Same as Gtk::TextIter::forward_search(), but supports case insensitive searching.

Parameters:

  str | A search string.
  flags | Flags affecting how the search is done.
  match_start | Return location for start of match.
  match_end | Return location for end of match.
  limit | Bound for the search.

Returns:
  Whether a match was found

Since gtksourceviewmm 2.10:

bool gtksourceview::SourceIter::forward_search | ( | const Glib::ustring & | str,
|  | SourceSearchFlags | flags,
|  | Gtk::TextIter & | match_start,
|  | Gtk::TextIter & | match_end
| ) |  | const

Searches forward for str.

Same as forward_search(), but searches to the end.

Parameters:

  str | A search string.
  flags | Flags affecting how the search is done.
  match_start | Return location for start of match.
  match_end | Return location for end of match.

Returns:
  Whether a match was found.

Since gtksourceviewmm 2.10: