4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
12 * A collection of string helper functions that works with string.
13 * Some of these would certainly benefit from a rewrite/optimization.
19 #include "support/strfwd.h"
23 template <class Target, class Source>
24 Target convert(Source arg);
27 template<> std::string convert<std::string>(bool b);
28 template<> std::string convert<std::string>(char c);
29 template<> std::string convert<std::string>(short unsigned int sui);
30 template<> std::string convert<std::string>(int i);
31 template<> docstring convert<docstring>(int i);
32 template<> std::string convert<std::string>(unsigned int ui);
33 template<> docstring convert<docstring>(unsigned int ui);
34 template<> std::string convert<std::string>(unsigned long ul);
35 template<> docstring convert<docstring>(unsigned long ul);
36 #ifdef HAVE_LONG_LONG_INT
37 template<> std::string convert<std::string>(unsigned long long ull);
38 template<> docstring convert<docstring>(unsigned long long ull);
40 template<> std::string convert<std::string>(long l);
41 template<> docstring convert<docstring>(long l);
42 #ifdef HAVE_LONG_LONG_INT
43 template<> std::string convert<std::string>(long long ll);
44 template<> docstring convert<docstring>(long long ll);
46 template<> std::string convert<std::string>(float f);
47 template<> std::string convert<std::string>(double d);
48 template<> int convert<int>(std::string const & s);
49 template<> int convert<int>(docstring const & s);
50 template<> unsigned int convert<unsigned int>(std::string const & s);
51 template<> unsigned long convert<unsigned long>(std::string const & s);
52 template<> double convert<double>(std::string const & s);
53 template<> int convert<int>(char const * cptr);
54 template<> double convert<double>(char const * cptr);