diff --git a/CHANGELOG b/CHANGELOG index a118850..9d084de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -36,10 +36,16 @@ Version 0.9.0 prerelease (2009.11.24): * added: Parser::SetGroup(int g) Parser::SetComma(int c, int c2 = 0) Parser::SetParamSep(int s) - * added: uint Big::ToString(std::string & result, const Conv & conv) - uint Big::ToString(std::wstring & result, const Conv & conv) - std::string Big::ToString(const Conv & conv) const - std::string Big::ToString() + * added: std::string UInt::ToString(uint b = 10) + std::wstring UInt::ToWString(uint b = 10) + std::string Int::ToString(uint b = 10) + std::wstring Int::ToWString(uint b = 10) + uint Big::ToString(std::string & result, const Conv & conv) + uint Big::ToString(std::wstring & result, const Conv & conv) + std::string Big::ToString(const Conv & conv) + std::string Big::ToString() + std::wstring Big::ToWString(const Conv & conv) + std::wstring Big::ToWString() * added: uint FromString(const char * source, const Conv & conv, const char **, bool *) uint FromString(const wchar_t * source, const Conv & conv, const wchar_t **, bool *) uint FromString(const std::string & string, const Conv & conv, const wchar_t **, bool *) diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index b35fbd5..8a879c3 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -2984,6 +2984,31 @@ public: } + /*! + a method for converting into a string + struct Conv is defined in ttmathtypes.h, look there for more information about parameters + */ + std::wstring ToWString(const Conv & conv) const + { + std::wstring result; + ToStringBase(result, conv); + + return result; + } + + + /*! + a method for converting into a string + struct Conv is defined in ttmathtypes.h, look there for more information about parameters + */ + std::wstring ToWString() const + { + Conv conv; + + return ToWString(conv); + } + + private: diff --git a/ttmath/ttmathint.h b/ttmath/ttmathint.h index 78b86e9..bf2c55a 100644 --- a/ttmath/ttmathint.h +++ b/ttmath/ttmathint.h @@ -985,6 +985,30 @@ public: } + /*! + this method converts the value to a string with a base equal 'b' + */ + std::string ToString(uint b = 10) const + { + std::string result; + ToStringBase(result, b); + + return result; + } + + + /*! + this method converts the value to a string with a base equal 'b' + */ + std::wstring ToWString(uint b = 10) const + { + std::wstring result; + ToStringBase(result, b); + + return result; + } + + private: /*! diff --git a/ttmath/ttmathuint.h b/ttmath/ttmathuint.h index da92ff3..88c725e 100644 --- a/ttmath/ttmathuint.h +++ b/ttmath/ttmathuint.h @@ -2744,6 +2744,21 @@ public: return ToStringBase(result, b); } + std::string ToString(uint b = 10) const + { + std::string result; + ToStringBase(result, b); + + return result; + } + + std::wstring ToWString(uint b = 10) const + { + std::wstring result; + ToStringBase(result, b); + + return result; + } private: