Documentation for String

Former-commit-id: caf1b5889604d7c2248ec88bde99a6bce0d7680f
This commit is contained in:
Gawaboumga
2016-02-21 14:32:17 +01:00
parent c163d65da7
commit f540029825
6 changed files with 1974 additions and 60 deletions

View File

@@ -7,22 +7,42 @@
namespace Nz
{
/*!
* \brief Constructs a String object with a shared string by move semantic
*
* \param sharedString Shared string to move into this
*/
inline String::String(std::shared_ptr<SharedString>&& sharedString) :
m_sharedString(std::move(sharedString))
{
}
/*!
* \brief Releases the content to the string
*/
inline void String::ReleaseString()
{
m_sharedString = std::move(GetEmptyString());
}
/*!
* \brief Constructs a SharedString object by default
*/
inline String::SharedString::SharedString() : // Special case: empty string
capacity(0),
size(0)
{
}
/*!
* \brief Constructs a SharedString object with a size
*
* \param strSize Number of characters in the string
*/
inline String::SharedString::SharedString(std::size_t strSize) :
capacity(strSize),
size(strSize),
@@ -31,6 +51,13 @@ namespace Nz
string[strSize] = '\0';
}
/*!
* \brief Constructs a SharedString object with a size and a capacity
*
* \param strSize Number of characters in the string
* \param strCapacity Capacity in characters in the string
*/
inline String::SharedString::SharedString(std::size_t strSize, std::size_t strCapacity) :
capacity(strCapacity),
size(strSize),
@@ -39,6 +66,14 @@ namespace Nz
string[strSize] = '\0';
}
/*!
* \brief Appends the string to the hash
* \return true if hash is successful
*
* \param hash Hash to append data of the file
* \param string String to hash
*/
inline bool HashAppend(AbstractHash* hash, const String& string)
{
hash->Append(reinterpret_cast<const UInt8*>(string.GetConstBuffer()), string.GetSize());
@@ -48,6 +83,13 @@ namespace Nz
namespace std
{
/*!
* \brief Specialisation of std to hash
* \return Result of the hash
*
* \param str String to hash
*/
template<>
struct hash<Nz::String>
{