Commit 7044058a authored by Roland Levillain's avatar Roland Levillain
Browse files

Use package metadata macros instead of hard-coded strings in I/Os.

	* mln/io/fld/write_header.hh (mln::io::fld::write_header)
	* mln/io/off/save.hh
	(mln::io::off::internal::off_saver<I, E>::operator())
	* mln/io/pnm/save_header.hh (mln::io::pnm::save_header)
	* mln/io/vtk/save.hh
	(mln::io::vtk::internal::vtk_saver<I, E>::operator()):
	Here.
	* mln/version.hh.in (OLN_PACKAGE_URL, OLN_PACKAGE_AUTHORS):
	New macros.
parent c7b2885c
2011-07-11 Roland Levillain <roland@lrde.epita.fr>
Use package metadata macros instead of hard-coded strings in I/Os.
* mln/io/fld/write_header.hh (mln::io::fld::write_header)
* mln/io/off/save.hh
(mln::io::off::internal::off_saver<I, E>::operator())
* mln/io/pnm/save_header.hh (mln::io::pnm::save_header)
* mln/io/vtk/save.hh
(mln::io::vtk::internal::vtk_saver<I, E>::operator()):
Here.
* mln/version.hh.in (OLN_PACKAGE_URL, OLN_PACKAGE_AUTHORS):
New macros.
2011-07-11 Roland Levillain <roland@lrde.epita.fr>
 
No longer consider mln/version.hh.in as handled by autoheader.
// Copyright (C) 2008, 2009, 2010, 2012 EPITA Research and Development
// Copyright (C) 2008, 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -34,8 +34,10 @@
# include <iostream>
# include <mln/version.hh>
# include <mln/io/fld/header.hh>
namespace mln
{
......@@ -61,8 +63,9 @@ namespace mln
write_header(std::ostream& file, const fld_header& h)
{
file << "# AVS field file" << std::endl;
file << "# Generated by Milena 1.0 http://olena.lrde.epita.fr" << std::endl;
file << "# EPITA Research and Development Laboratory (LRDE)" << std::endl;
file << "# Generated by " OLN_PACKAGE_STRING " (" OLN_PACKAGE_URL ")"
<< std::endl
<< "# " OLN_PACKAGE_AUTHORS << std::endl;
file << "ndim=" << h.ndim << std::endl;
for (int i = 0; i < h.ndim; i++)
......
......@@ -41,6 +41,7 @@
# include <string>
# include <mln/version.hh>
# include <mln/core/alias/complex_image.hh>
# include <mln/core/image/complex_neighborhoods.hh>
# include <mln/core/image/complex_neighborhood_piter.hh>
......@@ -260,8 +261,9 @@ namespace mln
ostr << "OFF" << std::endl;
// A comment.
ostr << "# Generated by Milena 1.0 http://olena.lrde.epita.fr\n"
<< "# EPITA Research and Development Laboratory (LRDE)"
ostr << "# Generated by " OLN_PACKAGE_STRING " (" OLN_PACKAGE_URL ")"
<< std::endl
<< "# " OLN_PACKAGE_AUTHORS
<< std::endl;
/* ``The next line states the number of vertices, the number
......
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
// 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -33,6 +34,8 @@
# include <iostream>
# include <fstream>
# include <mln/version.hh>
# include <mln/io/pnm/max_component.hh>
# include <mln/value/rgb.hh>
......@@ -76,11 +79,12 @@ namespace mln
abort();
}
file << "P" << type << std::endl;
file << "# Generated by Milena 1.0 http://olena.lrde.epita.fr" << std::endl;
file << "# EPITA Research and Development Laboratory (LRDE)" << std::endl;
// We have a two-line comment because xv is buggy for some
// tiny binary images and their workaround is to have such a
// two-line comment...
file << "# Generated by " OLN_PACKAGE_STRING " (" OLN_PACKAGE_URL ")"
<< std::endl
<< "# " OLN_PACKAGE_AUTHORS << std::endl;
file << geom::ncols(ima) << ' ' << geom::nrows(ima) << std::endl;
mln_value(I) i;
......
......@@ -41,6 +41,7 @@
# include <string>
# include <mln/version.hh>
# include <mln/core/alias/complex_image.hh>
# include <mln/core/image/complex_neighborhoods.hh>
# include <mln/core/image/complex_neighborhood_piter.hh>
......@@ -283,7 +284,7 @@ namespace mln
character `\n'. The header is 256 characters
maximum. The header can be used to describe the data
and include any other pertinent information.'' */
ostr << "Generated by Milena 1.0 http://olena.lrde.epita.fr"
ostr << "Generated by " OLN_PACKAGE_STRING " (" OLN_PACKAGE_URL ")"
<< std::endl;
/* ``3. The next part is the file format. The file format
......
......@@ -32,4 +32,10 @@
/// The version of this package.
#define OLN_PACKAGE_VERSION "@PACKAGE_VERSION@"
/// Home page for this package.
#define OLN_PACKAGE_URL "@PACKAGE_URL@"
/// Authors of the package.
#define OLN_PACKAGE_AUTHORS "EPITA Research and Development Laboratory (LRDE)"
#endif // ! MLN_VERSION_HH
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