Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Gtk::SourceIter Class Reference

A GtkTextIter object that supports case-insensitive searching. More...

Inheritance diagram for Xfc::Gtk::SourceIter:
Xfc::Gtk::TextIter Xfc::G::Boxed Xfc::StackObject Xfc::Object Xfc::Trackable

List of all members.

Public Member Functions

Constructors

Detailed Description

A GtkTextIter object that supports case-insensitive searching.

SourceIter is a Gtk::TextIter extension that supports case-insensitive forward and backward searching.


Constructor & Destructor Documentation

Xfc::Gtk::SourceIter::SourceIter ( GtkTextIter *  iter) [explicit]

Construct a new source iterator from an existing GtkTextIter.

Parameters:
iterA pointer to a GtkTextIter.


The iter can be a newly created GtkTextIter or an existing GtkTextIter. The SourceIter object created is a temporary object. It doesn't take over the ownership of GtkTextIter and GtkTextIter is not freed by the destructor.

Xfc::Gtk::SourceIter::SourceIter ( GtkTextIter *  iter,
bool  copy 
)

Construct a new source iterator from an existing GtkTextIter.

Parameters:
iterA pointer to a GtkTextIter.
copyWhether the SourceIter object should make a copy of GtkTextIter or not.


The iter can be a newly created GtkTextIter or an existing GtkTextIter. If copy is true SourceIter will make a copy of GtkTextIter. If copy is false SourceIter wont make a copy but instead takes over the ownership of GtkTextIter. Either way, the destructor will free GtkTextIter when the SourceIter object is destroyed. This constructor is used by G::Boxed::wrap() to wrap GtkTextIter objects in a C++ wrapper.

Copy constructor.

Parameters:
srcThe source iterator.

Member Function Documentation

bool Xfc::Gtk::SourceIter::backward_search ( const String str,
const SourceIter limit = 0 
)

Do a case-sensitive search backward for str.

Parameters:
strThe search string.
limitThe location of last possible match_start, or null for start of buffer.
Returns:
Whether a match was found.


The Gtk::SOURCE_SEARCH_VISIBLE_ONLY flag is used so the match may have invisible text interspersed in str (i.e. str will be a possibly-noncontiguous subsequence of the matched range).

bool Xfc::Gtk::SourceIter::backward_search ( const String str,
SourceIter match_start,
SourceIter match_end,
const SourceIter limit = 0 
)

Do a case-sensitive search backward for str.

Parameters:
strThe search string.
match_startThe return location for start of match, or null.
match_endThe return location for end of match, or null.
limitThe location of last possible match_start, or null for start of buffer.
Returns:
Whether a match was found.


The Gtk::SOURCE_SEARCH_VISIBLE_ONLY flag is used so the match may have invisible text interspersed in str (i.e. str will be a possibly-noncontiguous subsequence of the matched range).

bool Xfc::Gtk::SourceIter::backward_search ( const String str,
SourceSearchFlagsField  flags,
SourceIter match_start,
SourceIter match_end,
const SourceIter limit = 0 
)

Searches backward for str.

Parameters:
strThe search string.
flagsThe bitmask of flags specifying how the search is done.
match_startThe return location for start of match, or null.
match_endThe return location for end of match, or null.
limitThe location of last possible match_start, or null for start of buffer.
Returns:
Whether a match was found.

Tries to match the bracket character currently at the iter with its opening/closing counterpart, and if found moves iter to the position where it was found.

Returns:
true if a matching bracket is found and the iter moved.


If the current bracket is an opening bracket the buffer is searched in a forward direction. If the current bracket is a closing bracket the buffer is searched in a backward direction.

bool Xfc::Gtk::SourceIter::forward_search ( const String str,
const SourceIter limit = 0 
)

Do a case-sensitive search forward for str.

Parameters:
strThe search string.
limitThe bound for the search, or null for the end of the buffer.
Returns:
Whether a match was found


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. The Gtk::SOURCE_SEARCH_VISIBLE_ONLY flag is used so the match may have invisible text interspersed in str (i.e. str will be a possibly-noncontiguous subsequence of the matched range).

bool Xfc::Gtk::SourceIter::forward_search ( const String str,
SourceIter match_start,
SourceIter match_end,
const SourceIter limit = 0 
)

Do a case-sensitive search forward for str.

Parameters:
strThe search string.
match_startThe return location for start of match, or null.
match_endThe return location for end of match, or null.
limitThe bound for the search, or null for the end of the buffer.
Returns:
Whether a match was found


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. The Gtk::SOURCE_SEARCH_VISIBLE_ONLY flag is used so the match may have invisible text interspersed in str (i.e. str will be a possibly-noncontiguous subsequence of the matched range).

bool Xfc::Gtk::SourceIter::forward_search ( const String str,
SourceSearchFlagsField  flags,
SourceIter match_start,
SourceIter match_end,
const SourceIter limit = 0 
)

Searches forward for str.

Parameters:
strThe search string.
flagsThe bitmask of flags specifying how the search is done.
match_startThe return location for start of match, or null.
match_endThe return location for end of match, or null.
limitThe bound for the search, or null for the end of the buffer.
Returns:
Whether a match was found


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 Gtk::SOURCE_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 Gtk::SOURCE_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 Gtk::SOURCE_SEARCH_CASE_INSENSITIVE flag, the text will be matched regardless of what case it is in.

SourceIter& Xfc::Gtk::SourceIter::operator= ( const SourceIter src)

Assignment operator.

Parameters:
srcThe source iterator.

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC