]> git.lyx.org Git - lyx.git/blob - src/support/convert.h
cosmetics
[lyx.git] / src / support / convert.h
1 // -*- C++ -*-
2 /**
3  * \file convert.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  *
12  * A collection of string helper functions that works with string.
13  * Some of these would certainly benefit from a rewrite/optimization.
14  */
15
16 #ifndef CONVERT_H
17 #define CONVERT_H
18
19 #include "support/strfwd.h"
20
21 namespace lyx {
22
23 template <class Target, class Source>
24 Target convert(Source arg);
25
26
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 template<> std::string convert<std::string>(long l);
37 template<> docstring convert<docstring>(long l);
38 template<> std::string convert<std::string>(float f);
39 template<> std::string convert<std::string>(double d);
40 template<> int convert<int>(std::string const s);
41 template<> int convert<int>(docstring const s);
42 template<> unsigned int convert<unsigned int>(std::string const s);
43 template<> unsigned long convert<unsigned long>(std::string const s);
44 template<> double convert<double>(std::string const s);
45 template<> int convert<int>(char const * cptr);
46 template<> double convert<double>(char const * cptr);
47
48 } // namespace lyx
49
50 #endif