2003-05-13 14:36:24 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2005-01-06 16:44:04 +00:00
|
|
|
* \file convert.h
|
2003-05-13 14:36:24 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
|
|
|
* \author Lars Gullik Bjønnes
|
2003-05-13 14:36:24 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-05-13 14:36:24 +00:00
|
|
|
*
|
|
|
|
* A collection of string helper functions that works with string.
|
|
|
|
* Some of these would certainly benefit from a rewrite/optimization.
|
|
|
|
*/
|
|
|
|
|
2005-01-06 16:44:04 +00:00
|
|
|
#ifndef CONVERT_H
|
|
|
|
#define CONVERT_H
|
2003-05-13 14:36:24 +00:00
|
|
|
|
2007-11-10 13:44:50 +00:00
|
|
|
#include "support/strfwd.h"
|
2007-09-04 18:39:13 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2005-01-06 16:07:02 +00:00
|
|
|
template <class Target, class Source>
|
|
|
|
Target convert(Source arg);
|
|
|
|
|
2007-09-04 18:39:13 +00:00
|
|
|
|
|
|
|
template<> std::string convert<std::string>(bool b);
|
|
|
|
template<> std::string convert<std::string>(char c);
|
|
|
|
template<> std::string convert<std::string>(short unsigned int sui);
|
|
|
|
template<> std::string convert<std::string>(int i);
|
|
|
|
template<> docstring convert<docstring>(int i);
|
|
|
|
template<> std::string convert<std::string>(unsigned int ui);
|
2007-11-10 13:44:50 +00:00
|
|
|
template<> docstring convert<docstring>(unsigned int ui);
|
2007-09-04 18:39:13 +00:00
|
|
|
template<> std::string convert<std::string>(unsigned long ul);
|
2007-11-10 13:44:50 +00:00
|
|
|
template<> docstring convert<docstring>(unsigned long ul);
|
2007-09-04 18:39:13 +00:00
|
|
|
template<> std::string convert<std::string>(long l);
|
2007-11-10 13:44:50 +00:00
|
|
|
template<> docstring convert<docstring>(long l);
|
2007-09-04 18:39:13 +00:00
|
|
|
template<> std::string convert<std::string>(float f);
|
|
|
|
template<> std::string convert<std::string>(double d);
|
|
|
|
template<> int convert<int>(std::string const s);
|
2007-11-10 13:44:50 +00:00
|
|
|
template<> int convert<int>(docstring const s);
|
2007-09-04 18:39:13 +00:00
|
|
|
template<> unsigned int convert<unsigned int>(std::string const s);
|
|
|
|
template<> unsigned long convert<unsigned long>(std::string const s);
|
|
|
|
template<> double convert<double>(std::string const s);
|
|
|
|
template<> int convert<int>(char const * cptr);
|
|
|
|
template<> double convert<double>(char const * cptr);
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2003-05-13 14:36:24 +00:00
|
|
|
#endif
|