---
scribo/ChangeLog | 4 ++++
scribo/scribo/core/document.hh | 31 +++++++++++++++++++++++++++++--
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 240e6a5..3db5ad3 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * scribo/core/document.hh: Add new methods.
+
+2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/io/xml/save.hh: Add conditions before saving elements and
text.
diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh
index 93d9348..daa0d7b 100644
--- a/scribo/scribo/core/document.hh
+++ b/scribo/scribo/core/document.hh
@@ -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_;
@@ -99,6 +102,14 @@ namespace scribo
template <typename L>
void
+ document<L>::set_filename(const char *filename)
+ {
+ filename_ = filename;
+ }
+
+
+ template <typename L>
+ void
document<L>::open()
{
mln::io::magick::load(image_, filename_);
@@ -122,6 +133,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)
{
@@ -138,6 +157,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)
{
--
1.5.6.5
Show replies by date