Documentation for String
Former-commit-id: caf1b5889604d7c2248ec88bde99a6bce0d7680f
This commit is contained in:
@@ -7,17 +7,37 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \class Nz::StringStream
|
||||
* \brief Core class that represents a stream of strings
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Constructs a StringStream object by default
|
||||
*/
|
||||
|
||||
StringStream::StringStream() :
|
||||
m_bufferSize(0)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Constructs a StringStream object with a string
|
||||
*
|
||||
* \param str First value of the stream
|
||||
*/
|
||||
|
||||
StringStream::StringStream(const String& str) :
|
||||
m_bufferSize(str.GetSize())
|
||||
{
|
||||
m_strings.push_back(str);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gives a string representation
|
||||
* \return A string representation of the object where every objects of the stream has been converted with Nz::String
|
||||
*/
|
||||
|
||||
String StringStream::ToString() const
|
||||
{
|
||||
String string;
|
||||
@@ -29,6 +49,13 @@ namespace Nz
|
||||
return string;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the boolean
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param boolean Boolean value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(bool boolean)
|
||||
{
|
||||
m_strings.push_back(String::Boolean(boolean));
|
||||
@@ -37,6 +64,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the short
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Short value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(short number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -45,6 +79,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the unsigned short
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Short value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(unsigned short number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -53,6 +94,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the int
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Int value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(int number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -61,6 +109,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the unsigned int
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Int value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(unsigned int number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -69,6 +124,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the long
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Long value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(long number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -77,6 +139,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the unsigned long
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Long value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(unsigned long number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -85,6 +154,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the long long
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Long long value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(long long number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -93,6 +169,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the unsigned long long
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Long long value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(unsigned long long number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -101,6 +184,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the float
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Float value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(float number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -109,6 +199,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the double
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Double value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(double number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -117,6 +214,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the long double
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param number Long double value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(long double number)
|
||||
{
|
||||
m_strings.push_back(String::Number(number));
|
||||
@@ -125,6 +229,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the char
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param character Char value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(char character)
|
||||
{
|
||||
m_strings.push_back(String(character));
|
||||
@@ -133,6 +244,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the unsigned char
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param character Char value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(unsigned char character)
|
||||
{
|
||||
m_strings.push_back(String(static_cast<char>(character)));
|
||||
@@ -141,6 +259,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the const char*
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param string String value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(const char* string)
|
||||
{
|
||||
m_strings.push_back(string);
|
||||
@@ -149,6 +274,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the std::string
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param string String value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(const std::string& string)
|
||||
{
|
||||
m_strings.push_back(string);
|
||||
@@ -157,6 +289,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the Nz::String
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param string String value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(const String& string)
|
||||
{
|
||||
m_strings.push_back(string);
|
||||
@@ -165,6 +304,13 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds the representation of the pointer
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param ptr Pointer value
|
||||
*/
|
||||
|
||||
StringStream& StringStream::operator<<(const void* ptr)
|
||||
{
|
||||
m_strings.push_back(String::Pointer(ptr));
|
||||
@@ -173,6 +319,11 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Converts this to Nz::String
|
||||
* \return The string representation of the stream
|
||||
*/
|
||||
|
||||
StringStream::operator String() const
|
||||
{
|
||||
return ToString();
|
||||
|
||||
Reference in New Issue
Block a user