2003-06-18 09:56:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file tostr.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
2003-07-28 22:37:28 +00:00
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
2003-06-18 09:56:10 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-06-18 09:56:10 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-05-13 14:36:24 +00:00
|
|
|
|
#include <config.h>
|
2003-09-09 18:27:24 +00:00
|
|
|
|
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_sstream.h"
|
2003-05-13 14:36:24 +00:00
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
using std::string;
|
2003-09-05 18:02:24 +00:00
|
|
|
|
using std::ostringstream;
|
|
|
|
|
|
2003-05-13 14:36:24 +00:00
|
|
|
|
|
|
|
|
|
string const tostr(bool b)
|
|
|
|
|
{
|
|
|
|
|
return (b ? "true" : "false");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const tostr(unsigned int i)
|
|
|
|
|
{
|
|
|
|
|
ostringstream os;
|
|
|
|
|
os << i;
|
2003-09-15 11:00:00 +00:00
|
|
|
|
return os.str();
|
2003-05-13 14:36:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-14 07:54:12 +00:00
|
|
|
|
string const tostr(long int i)
|
|
|
|
|
{
|
|
|
|
|
ostringstream os;
|
|
|
|
|
os << i;
|
2003-09-15 11:00:00 +00:00
|
|
|
|
return os.str();
|
2003-05-14 07:54:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-13 14:36:24 +00:00
|
|
|
|
string const tostr(double d)
|
|
|
|
|
{
|
|
|
|
|
ostringstream os;
|
|
|
|
|
os << d;
|
2003-09-15 11:00:00 +00:00
|
|
|
|
return os.str();
|
2003-05-13 14:36:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const tostr(int i)
|
|
|
|
|
{
|
|
|
|
|
ostringstream os;
|
|
|
|
|
os << i;
|
2003-09-15 11:00:00 +00:00
|
|
|
|
return os.str();
|
2003-05-13 14:36:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const tostr(string const & s)
|
|
|
|
|
{
|
|
|
|
|
return s;
|
|
|
|
|
}
|
2004-01-07 16:40:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const tostr(long unsigned int i)
|
|
|
|
|
{
|
|
|
|
|
ostringstream os;
|
|
|
|
|
os << i;
|
|
|
|
|
return os.str();
|
|
|
|
|
}
|