Merge branch 'master' into physics3d-material
This commit is contained in:
commit
d1060047f8
|
|
@ -168,6 +168,7 @@ namespace Nz
|
|||
bool ToDouble(double* value) const;
|
||||
bool ToInteger(long long* value, UInt8 radix = 10) const;
|
||||
String ToLower(UInt32 flags = None) const;
|
||||
std::string ToStdString() const;
|
||||
String ToUpper(UInt32 flags = None) const;
|
||||
|
||||
String& Trim(UInt32 flags = None);
|
||||
|
|
@ -193,8 +194,6 @@ namespace Nz
|
|||
typedef char value_type;
|
||||
// Méthodes STD
|
||||
|
||||
operator std::string() const;
|
||||
|
||||
char& operator[](std::size_t pos);
|
||||
char operator[](std::size_t pos) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ namespace Nz
|
|||
String error("Column out of range: (" + String::Number(column) + ") > 3");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::out_of_range(error);
|
||||
throw std::out_of_range(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -632,7 +632,7 @@ namespace Nz
|
|||
String error("Row out of range: (" + String::Number(row) + ") > 3");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::out_of_range(error);
|
||||
throw std::out_of_range(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1347,7 +1347,7 @@ namespace Nz
|
|||
String error("Index out of range: (" + String::Number(x) + ", " + String::Number(y) +") > (3, 3)");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::out_of_range(error);
|
||||
throw std::out_of_range(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1371,7 +1371,7 @@ namespace Nz
|
|||
String error("Index out of range: (" + String::Number(x) + ", " + String::Number(y) +") > (3, 3)");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::out_of_range(error);
|
||||
throw std::out_of_range(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ namespace Nz
|
|||
ss << "Index out of range: (" << i << " >= " << BoxCorner_Max << ")";
|
||||
|
||||
NazaraError(ss);
|
||||
throw std::out_of_range(ss.ToString());
|
||||
throw std::out_of_range(ss.ToString().ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -579,7 +579,7 @@ namespace Nz
|
|||
String error("Planes are parallel");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -607,7 +607,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -633,7 +633,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -723,7 +723,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -752,7 +752,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1050,7 +1050,7 @@ Nz::Vector2<T> operator/(T scale, const Nz::Vector2<T>& vec)
|
|||
Nz::String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -726,7 +726,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -751,7 +751,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -839,7 +839,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
|
||||
x /= vec.x;
|
||||
|
|
@ -866,7 +866,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
|
||||
x /= scale;
|
||||
|
|
@ -1340,7 +1340,7 @@ Nz::Vector3<T> operator/(T scale, const Nz::Vector3<T>& vec)
|
|||
Nz::String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -637,7 +637,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -663,7 +663,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -761,7 +761,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -792,7 +792,7 @@ namespace Nz
|
|||
String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1113,7 +1113,7 @@ Nz::Vector4<T> operator/(T scale, const Nz::Vector4<T>& vec)
|
|||
Nz::String error("Division by zero");
|
||||
|
||||
NazaraError(error);
|
||||
throw std::domain_error(error);
|
||||
throw std::domain_error(error.ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace Nz
|
|||
namespace
|
||||
{
|
||||
//FIXME: MinGW seems to dislike thread_local shared_ptr.. (using a std::string is a working hackfix)
|
||||
thread_local std::string currentPath(DirectoryImpl::GetCurrent());
|
||||
thread_local std::string currentPath(DirectoryImpl::GetCurrent().ToStdString());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -526,7 +526,7 @@ namespace Nz
|
|||
String path = File::AbsolutePath(dirPath);
|
||||
if (DirectoryImpl::Exists(path))
|
||||
{
|
||||
currentPath = path;
|
||||
currentPath = path.ToStdString();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ namespace Nz
|
|||
|
||||
if (type == ErrorType_AssertFailed || (type != ErrorType_Warning &&
|
||||
(s_flags & ErrorFlag_ThrowException) != 0 && (s_flags & ErrorFlag_ThrowExceptionDisabled) == 0))
|
||||
throw std::runtime_error(error);
|
||||
throw std::runtime_error(error.ToStdString());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -183,7 +183,7 @@ namespace Nz
|
|||
|
||||
if (type == ErrorType_AssertFailed || (type != ErrorType_Warning &&
|
||||
(s_flags & ErrorFlag_ThrowException) != 0 && (s_flags & ErrorFlag_ThrowExceptionDisabled) == 0))
|
||||
throw std::runtime_error(error);
|
||||
throw std::runtime_error(error.ToStdString());
|
||||
}
|
||||
|
||||
UInt32 Error::s_flags = ErrorFlag_None;
|
||||
|
|
|
|||
|
|
@ -4197,13 +4197,21 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Converts the string to std::string
|
||||
* \return std::string representation
|
||||
*/
|
||||
std::string String::ToStdString() const
|
||||
{
|
||||
return std::string(m_sharedString->string.get(), m_sharedString->size);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Converts the string to upper
|
||||
* \return Upper string
|
||||
*
|
||||
* \param flags Flag for the look up
|
||||
*/
|
||||
|
||||
String String::ToUpper(UInt32 flags) const
|
||||
{
|
||||
if (m_sharedString->size == 0)
|
||||
|
|
@ -4481,16 +4489,6 @@ namespace Nz
|
|||
}
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Converts the string to std::string
|
||||
* \return std::string representation
|
||||
*/
|
||||
|
||||
String::operator std::string() const
|
||||
{
|
||||
return std::string(m_sharedString->string.get(), m_sharedString->size);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the ith character in the string
|
||||
* \return A reference to the character
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Nz
|
|||
{
|
||||
String lastError(lua_tostring(internalState, -1));
|
||||
|
||||
throw std::runtime_error("Lua panic: " + lastError);
|
||||
throw std::runtime_error("Lua panic: " + lastError.ToStdString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Nz
|
|||
if (varPtr->type != type)
|
||||
{
|
||||
//TODO: AstParseError
|
||||
throw std::runtime_error("Function uses parameter \"" + name + "\" with a different type than specified in the function arguments");
|
||||
throw std::runtime_error("Function uses parameter \"" + name.ToStdString() + "\" with a different type than specified in the function arguments");
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -98,7 +98,7 @@ namespace Nz
|
|||
|
||||
if (!found)
|
||||
//TODO: AstParseError
|
||||
throw std::runtime_error("Function has no parameter \"" + name + "\"");
|
||||
throw std::runtime_error("Function has no parameter \"" + name.ToStdString() + "\"");
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue