* scribo/io/xml/internal/print_image_coords.hh,
* scribo/io/xml/internal/print_page_preambule.hh: Fix typos.
* scribo/io/xml/internal/time_info.hh: New.
---
scribo/ChangeLog | 9 +++
.../scribo/io/xml/internal/print_image_coords.hh | 6 +-
.../scribo/io/xml/internal/print_page_preambule.hh | 13 +----
.../highlight.hh => io/xml/internal/time_info.hh} | 54 +++++++++----------
4 files changed, 41 insertions(+), 41 deletions(-)
copy scribo/scribo/{fun/v2v/highlight.hh => io/xml/internal/time_info.hh} (66%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index b10058f..3d28a54 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,14 @@
2011-06-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix Page XML output.
+
+ * scribo/io/xml/internal/print_image_coords.hh,
+ * scribo/io/xml/internal/print_page_preambule.hh: Fix typos.
+
+ * scribo/io/xml/internal/time_info.hh: New.
+
+2011-06-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Handle drop capital components.
* scribo/core/tag/component.hh: New tag.
diff --git a/scribo/scribo/io/xml/internal/print_image_coords.hh
b/scribo/scribo/io/xml/internal/print_image_coords.hh
index ebfe402..41c4e30 100644
--- a/scribo/scribo/io/xml/internal/print_image_coords.hh
+++ b/scribo/scribo/io/xml/internal/print_image_coords.hh
@@ -69,15 +69,15 @@ namespace scribo
const S& b = exact(b_);
mln_precondition(b.is_valid());
- ostr << sc << "<coords>" << std::endl;
+ ostr << sc << "<Coords>" << std::endl;
mln_piter(S) p(b);
for_all(p)
- ostr << sp << "<point x=\"" << p.col()
+ ostr << sp << "<Point x=\"" << p.col()
<< "\" y=\"" << p.row() <<
"\"/>"
<< std::endl;
- ostr << sc << "</coords>" << std::endl;
+ ostr << sc << "</Coords>" << std::endl;
}
diff --git a/scribo/scribo/io/xml/internal/print_page_preambule.hh
b/scribo/scribo/io/xml/internal/print_page_preambule.hh
index bcb6b33..9f00c60 100644
--- a/scribo/scribo/io/xml/internal/print_page_preambule.hh
+++ b/scribo/scribo/io/xml/internal/print_page_preambule.hh
@@ -30,10 +30,10 @@
///
/// \brief Print PAGE XML format preambule.
-# include <ctime>
# include <fstream>
# include <mln/core/alias/box2d.hh>
# include <scribo/core/document.hh>
+# include <scribo/io/xml/internal/time_info.hh>
namespace scribo
{
@@ -75,17 +75,10 @@ namespace scribo
else
output << "<PcGts>" << std::endl;
-
- time_t cur_time = time(NULL);
- tm * time_struct;
- time_struct = localtime(&cur_time);
- char time_info[55];
- strftime(time_info, 55, "%Y-%m-%dT%H:%M:%S", time_struct);
-
output << " <Metadata>" << std::endl;
output << " <Creator>LRDE</Creator>" <<
std::endl;
- output << " <Created>" << time_info <<
"</Created>" << std::endl;
- output << " <LastChange>" << time_info <<
"</LastChange>" << std::endl;
+ output << " <Created>" << time_info() <<
"</Created>" << std::endl;
+ output << " <LastChange>" << time_info() <<
"</LastChange>" << std::endl;
output << " <Comments>Generated by Scribo from
Olena.</Comments>" << std::endl;
output << " </Metadata>" << std::endl;
diff --git a/scribo/scribo/fun/v2v/highlight.hh
b/scribo/scribo/io/xml/internal/time_info.hh
similarity index 66%
copy from scribo/scribo/fun/v2v/highlight.hh
copy to scribo/scribo/io/xml/internal/time_info.hh
index 835be59..6adc49a 100644
--- a/scribo/scribo/fun/v2v/highlight.hh
+++ b/scribo/scribo/io/xml/internal/time_info.hh
@@ -23,55 +23,53 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FUN_V2V_HIGHLIGHT_HH
-# define SCRIBO_FUN_V2V_HIGHLIGHT_HH
+#ifndef SCRIBO_IO_XML_INTERNAL_TIME_INFO_HH
+# define SCRIBO_IO_XML_INTERNAL_TIME_INFO_HH
-/// \brief Function increasing values to highlight areas.
+/// \file
+///
+/// Get formated time info for PAGE XML format.
-# include <mln/core/concept/function.hh>
+# include <ctime>
namespace scribo
{
- namespace fun
+ namespace io
{
- namespace v2v
+ namespace xml
{
- template <typename R>
- struct highlight
- : mln::Function_v2v<highlight<R> >
- {
- typedef R result;
-
- highlight();
- result operator()(const result& v) const;
- };
+ namespace internal
+ {
+ using namespace mln;
# ifndef MLN_INCLUDE_ONLY
-
- template <typename R>
- highlight<R>::highlight()
+ std::string time_info()
{
+ time_t cur_time = time(NULL);
+ tm * time_struct;
+ time_struct = localtime(&cur_time);
+ char time_info_[55];
+ strftime(time_info_, 55, "%Y-%m-%dT%H:%M:%S", time_struct);
+ std::string output(time_info_);
+
+ return output;
}
- template <typename R>
- typename highlight<R>::result
- highlight<R>::operator()(const result& v) const
- {
- return v + v / 2;
- }
-
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::fun::v2v
+ } // end of namespace scribo::io::xml::internal
- } // end of namespace scribo::fun
+ } // end of namespace scribo::io::xml
+
+ } // end of namespace scribo::io
} // end of namespace scribo
-#endif // ! SCRIBO_FUN_V2V_HIGHLIGHT_HH
+
+#endif // ! SCRIBO_IO_XML_INTERNAL_TIME_INFO_HH
--
1.5.6.5
Show replies by date