mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17:35 +00:00
AK+Kernel: Return KString from UUID::to_string() in the Kernel
This lets us safely handle allocation failure.
This commit is contained in:
parent
5a5766be2c
commit
7f44e54ad6
2 changed files with 27 additions and 0 deletions
10
AK/UUID.h
10
AK/UUID.h
|
@ -11,6 +11,12 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
#ifdef KERNEL
|
||||
# include <Kernel/KString.h>
|
||||
#else
|
||||
# include <AK/String.h>
|
||||
#endif
|
||||
|
||||
namespace AK {
|
||||
|
||||
class UUID {
|
||||
|
@ -32,7 +38,11 @@ public:
|
|||
bool operator<(const UUID&) const = delete;
|
||||
bool operator>(const UUID&) const = delete;
|
||||
|
||||
#ifdef KERNEL
|
||||
ErrorOr<NonnullOwnPtr<Kernel::KString>> to_string() const;
|
||||
#else
|
||||
String to_string() const;
|
||||
#endif
|
||||
bool is_zero() const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue