gtkmm: Gtk::CssLocation Class Reference

Presents a location in a file - or other source of data parsed by the CSS engine. More...

#include <gtkmm/csslocation.h>

Public Member Functions

 CssLocation ()
 
 CssLocation (const GtkCssLocation* location)
 
 CssLocation (std::size_t bytes, std::size_t chars, std::size_t lines, std::size_t line_bytes, std::size_t line_chars)
 
std::size_t get_bytes () const
 
void set_bytes (const std::size_t& value)
 
std::size_t get_chars () const
 
void set_chars (const std::size_t& value)
 
std::size_t get_lines () const
 
void set_lines (const std::size_t& value)
 
std::size_t get_line_bytes () const
 
void set_line_bytes (const std::size_t& value)
 
std::size_t get_line_chars () const
 
void set_line_chars (const std::size_t& value)
 
GtkCssLocation* gobj ()
 
const GtkCssLocation* gobj () const
 

Protected Attributes

GtkCssLocation gobject_
 

Related Functions

(Note that these are not member functions.)

Gtk::CssLocation wrap (const GtkCssLocation* object)
 A Glib::wrap() method for this object. More...

 

Detailed Description

Presents a location in a file - or other source of data parsed by the CSS engine.

The bytes and line_bytes offsets are meant to be used to programmatically match data. The lines and line_chars offsets can be used for printing the location in a file.

Note that the lines parameter starts from 0 and is increased whenever a CSS line break is encountered. (CSS defines the C character sequences "\r\n", "\r", "\n" and "\f" as newlines.) If your document uses different rules for line breaking, you might run into problems here.

Since gtkmm 3.96:

Constructor & Destructor Documentation

Gtk::CssLocation::CssLocation ( )
Gtk::CssLocation::CssLocation ( const GtkCssLocation *  location)
Gtk::CssLocation::CssLocation ( std::size_t  bytes,
std::size_t  chars,
std::size_t  lines,
std::size_t  line_bytes,
std::size_t  line_chars 
)

Member Function Documentation

std::size_t Gtk::CssLocation::get_bytes ( ) const
Returns
Number of bytes parsed since the beginning.
std::size_t Gtk::CssLocation::get_chars ( ) const
Returns
Number of characters parsed since the beginning.
std::size_t Gtk::CssLocation::get_line_bytes ( ) const
Returns
Number of bytes parsed since the last line break.
std::size_t Gtk::CssLocation::get_line_chars ( ) const
Returns
Number of characters parsed since the last line break.
std::size_t Gtk::CssLocation::get_lines ( ) const
Returns
Number of full lines that have been parsed. If you want to display this as a line number, you need to add 1 to this.
GtkCssLocation* Gtk::CssLocation::gobj ( )
inline
const GtkCssLocation* Gtk::CssLocation::gobj ( ) const
inline
void Gtk::CssLocation::set_bytes ( const std::size_t &  value)
void Gtk::CssLocation::set_chars ( const std::size_t &  value)
void Gtk::CssLocation::set_line_bytes ( const std::size_t &  value)
void Gtk::CssLocation::set_line_chars ( const std::size_t &  value)
void Gtk::CssLocation::set_lines ( const std::size_t &  value)

Friends And Related Function Documentation

Gtk::CssLocation wrap ( const GtkCssLocation *  object)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
Returns
A C++ instance that wraps a copy of this C instance.

Member Data Documentation

GtkCssLocation Gtk::CssLocation::gobject_
protected