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


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.

Constructors

Public Member Functions

Methods

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:
iter A 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:
iter A pointer to a GtkTextIter.
copy Whether 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.

Xfc::Gtk::SourceIter::SourceIter ( const SourceIter src  ) 

Copy constructor.

Parameters:
src The source iterator.


Member Function Documentation

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

Assignment operator.

Parameters:
src The source iterator.

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

Do a case-sensitive search forward for str.

Parameters:
str The search string.
limit The 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:
str The search string.
match_start The return location for start of match, or null.
match_end The return location for end of match, or null.
limit The 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:
str The search string.
flags The bitmask of flags specifying how the search is done.
match_start The return location for start of match, or null.
match_end The return location for end of match, or null.
limit The 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.

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

Do a case-sensitive search backward for str.

Parameters:
str The search string.
limit The 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:
str The search string.
match_start The return location for start of match, or null.
match_end The return location for end of match, or null.
limit The 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:
str The search string.
flags The bitmask of flags specifying how the search is done.
match_start The return location for start of match, or null.
match_end The return location for end of match, or null.
limit The location of last possible match_start, or null for start of buffer.
Returns:
Whether a match was found.

bool Xfc::Gtk::SourceIter::find_matching_bracket (  ) 

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.


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