Fix documentation for module: Core

Former-commit-id: 5f47321109e66e3961a09c4a2394335c4868453f
This commit is contained in:
Gawaboumga
2016-05-30 14:09:51 +02:00
parent 406bebe717
commit 7721fd2284
11 changed files with 421 additions and 25 deletions

View File

@@ -28,7 +28,7 @@ namespace Nz
bool Core::Initialize()
{
if (s_moduleReferenceCounter > 0)
if (IsInitialized())
{
s_moduleReferenceCounter++;
return true; // Already initialized

View File

@@ -385,7 +385,7 @@ namespace Nz
}
/*!
* \brief Sets the position of the cursor
* \brief Sets the position of the cursor
* \return true if cursor is successfully positioned
*
* \param pos Position of the cursor
@@ -404,7 +404,7 @@ namespace Nz
}
/*!
* \brief Sets the position of the cursor
* \brief Sets the position of the cursor
* \return true if cursor is successfully positioned
*
* \param offset Offset according to the cursor begin position
@@ -906,5 +906,5 @@ namespace Nz
}
return true;
}
};
}

View File

@@ -607,6 +607,54 @@ namespace Nz
parameter.value.ptrVal = value;
}
/*!
* \brief Gives a string representation
* \return A string representation of the object: "ParameterList(Name: Type(value), ...)"
*/
String ParameterList::ToString() const
{
StringStream ss;
ss << "ParameterList(";
for (auto it = m_parameters.cbegin(); it != m_parameters.cend();)
{
ss << it->first << ": ";
switch (it->second.type)
{
case ParameterType_Boolean:
ss << "Boolean(" << String::Boolean(it->second.value.boolVal) << ")";
break;
case ParameterType_Color:
ss << "Color(" << it->second.value.colorVal.ToString() << ")";
break;
case ParameterType_Float:
ss << "Float(" << it->second.value.floatVal << ")";
break;
case ParameterType_Integer:
ss << "Integer(" << it->second.value.intVal << ")";
break;
case ParameterType_String:
ss << "String(" << it->second.value.stringVal << ")";
break;
case ParameterType_Pointer:
ss << "Pointer(" << String::Pointer(it->second.value.ptrVal) << ")";
break;
case ParameterType_Userdata:
ss << "Userdata(" << String::Pointer(it->second.value.userdataVal->ptr) << ")";
break;
case ParameterType_None:
ss << "None";
break;
}
if (++it != m_parameters.cend())
ss << ", ";
}
ss << ")";
return ss;
}
/*!
* \brief Sets a userdata parameter named `name`
*
@@ -724,3 +772,17 @@ namespace Nz
}
}
}
/*!
* \brief Output operator
* \return The stream
*
* \param out The stream
* \param parameterList The ParameterList to output
*/
std::ostream& operator<<(std::ostream& out, const Nz::ParameterList& parameterList)
{
out << parameterList.ToString();
return out;
}