[+] AU_THROW_CONST_STRING
This commit is contained in:
parent
dfeeae4687
commit
86673fbfb6
@ -164,8 +164,35 @@ struct AuStringException : std::exception
|
||||
};
|
||||
#endif
|
||||
|
||||
struct AuStringOwnedException : AuStringException
|
||||
{
|
||||
inline AuStringOwnedException(const char *str) noexcept : AuStringException("")
|
||||
{
|
||||
buffer = str;
|
||||
this->pNullString = buffer.c_str();
|
||||
}
|
||||
|
||||
inline AuStringOwnedException(const std::string &str) noexcept : AuStringException("")
|
||||
{
|
||||
buffer = str;
|
||||
this->pNullString = buffer.c_str();
|
||||
}
|
||||
|
||||
inline AuStringOwnedException(std::string &&str) noexcept : AuStringException("")
|
||||
{
|
||||
buffer = std::move(str);
|
||||
this->pNullString = buffer.c_str();
|
||||
}
|
||||
|
||||
std::string buffer;
|
||||
};
|
||||
|
||||
#if !defined(AU_THROW_CONST_STRING)
|
||||
#define AU_THROW_CONST_STRING(var) throw AuStringException(var)
|
||||
#endif
|
||||
|
||||
#if !defined(AU_THROW_STRING)
|
||||
#define AU_THROW_STRING(var) throw AuStringException(var)
|
||||
#define AU_THROW_STRING(var) throw AuStringOwnedException(var)
|
||||
#endif
|
||||
|
||||
#define AU_ITERATE_ARRAY(index, arry) AuUInt index = 0; index < AuArraySize(arry); index++
|
||||
|
Loading…
Reference in New Issue
Block a user