Commit 92e2d041 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

scribo/core/document.hh: Add new methods.

parent 4c97de45
2010-11-16 Guillaume Lazzara <z@lrde.epita.fr>
* scribo/core/document.hh: Add new methods.
2010-11-16 Guillaume Lazzara <z@lrde.epita.fr>
* scribo/io/xml/save.hh: Add conditions before saving elements and
......
......@@ -48,21 +48,24 @@ namespace scribo
document();
document(const char *filename);
void open();
const char * filename() const;
void set_filename(const char*name);
bool is_valid() const;
const line_set<L>& text() const;
bool has_text() const;
void set_text(const line_set<L>& line);
const component_set<L>& elements() const;
bool has_elements() const;
void set_elements(const component_set<L>& elements);
const mln::image2d<value::rgb8>& image() const;
private:
void open();
const char *filename_;
mln::image2d<mln::value::rgb8> image_;
......@@ -97,6 +100,14 @@ namespace scribo
}
template <typename L>
void
document<L>::set_filename(const char *filename)
{
filename_ = filename;
}
template <typename L>
void
document<L>::open()
......@@ -121,6 +132,14 @@ namespace scribo
}
template <typename L>
bool
document<L>::has_text() const
{
return lines_.is_valid();
}
template <typename L>
void
document<L>::set_text(const line_set<L>& line)
......@@ -137,6 +156,14 @@ namespace scribo
}
template <typename L>
bool
document<L>::has_elements() const
{
return elements_.is_valid();
}
template <typename L>
void
document<L>::set_elements(const component_set<L>& elements)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment