synfig-core  1.0.3
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
synfig::CanvasParser Class Reference

Class that handles xmlpp elements from a sif file and converts them into Synfig objects. More...

#include <loadcanvas.h>

Public Member Functions

 CanvasParser ()
CanvasParserset_allow_errors (bool x)
 Sets allow errors variable.
CanvasParserset_max_warnings (int i)
 Sets the maximum number of warnings before a fatal error is thrown.
int get_max_warnings ()
 Returns the maximum number of warnings before a fatal_error is thrown.
int error_count () const
 Returns the number of errors in the last parse.
int warning_count () const
 Returns the number of warnings in the last parse.
void set_path (const synfig::String &x)
 Sets the path of the file to parse.
const synfig::Stringget_path () const
 Gets the path of the file to parse.
const synfig::Stringget_errors_text () const
 Gets error text string.
const synfig::Stringget_warnings_text () const
 Gets warning text string.
Canvas::Handle parse_from_file_as (const FileSystem::Identifier &identifier, const String &as, String &errors)
 Parse a Cavnas form a file with absolute path.
Canvas::Handle parse_as (xmlpp::Element *node, String &errors)
 Parse a Canvas from a xmlpp root node.

Static Public Member Functions

static void register_canvas_in_map (Canvas::Handle canvas, String as)
 Register a canvas in the canvas map.

Static Public Attributes

static std::set
< FileSystem::Identifier
loading_
 Set of absolute file names of the canvases currently being parsed.

Detailed Description

Class that handles xmlpp elements from a sif file and converts them into Synfig objects.

Constructor & Destructor Documentation

synfig::CanvasParser::CanvasParser ( )
inline

Member Function Documentation

CanvasParser& synfig::CanvasParser::set_allow_errors ( bool  x)
inline

Sets allow errors variable.

Referenced by synfig::open_canvas(), and synfig::open_canvas_as().

CanvasParser& synfig::CanvasParser::set_max_warnings ( int  i)
inline

Sets the maximum number of warnings before a fatal error is thrown.

int synfig::CanvasParser::get_max_warnings ( )
inline

Returns the maximum number of warnings before a fatal_error is thrown.

int synfig::CanvasParser::error_count ( ) const
inline

Returns the number of errors in the last parse.

Referenced by synfig::open_canvas(), and synfig::open_canvas_as().

int synfig::CanvasParser::warning_count ( ) const
inline

Returns the number of warnings in the last parse.

void synfig::CanvasParser::set_path ( const synfig::String x)
inline

Sets the path of the file to parse.

const synfig::String& synfig::CanvasParser::get_path ( ) const
inline

Gets the path of the file to parse.

const synfig::String& synfig::CanvasParser::get_errors_text ( ) const
inline

Gets error text string.

Referenced by synfig::open_canvas(), and synfig::open_canvas_as().

const synfig::String& synfig::CanvasParser::get_warnings_text ( ) const
inline

Gets warning text string.

Referenced by synfig::open_canvas(), and synfig::open_canvas_as().

void CanvasParser::register_canvas_in_map ( Canvas::Handle  canvas,
String  as 
)
static

Register a canvas in the canvas map.

Parameters
canvasThe handle to the canvas to register
asThe absolute path to the file that represents the canvas Apart of store the pair canvas and

References _canvas_file_name_changed(), _remove_from_open_canvas_map(), and synfig::get_open_canvas_map().

Referenced by synfig::Canvas::set_file_name().

Canvas::Handle CanvasParser::parse_from_file_as ( const FileSystem::Identifier identifier,
const String as,
String errors 
)
Canvas::Handle CanvasParser::parse_as ( xmlpp::Element *  node,
String errors 
)

Parse a Canvas from a xmlpp root node.

References _, and synfig::error().

Referenced by synfig::open_canvas().

Member Data Documentation

std::set< FileSystem::Identifier > CanvasParser::loading_
static

Set of absolute file names of the canvases currently being parsed.


The documentation for this class was generated from the following files: