diff options
Diffstat (limited to 'lldb/source/Core/UserID.cpp')
-rw-r--r-- | lldb/source/Core/UserID.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/lldb/source/Core/UserID.cpp b/lldb/source/Core/UserID.cpp new file mode 100644 index 00000000000..b1dd5a618c1 --- /dev/null +++ b/lldb/source/Core/UserID.cpp @@ -0,0 +1,73 @@ +//===-- UserID.cpp ----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Core/UserID.h" +#include "lldb/Core/Stream.h" + +using namespace lldb; +using namespace lldb_private; + +UserID::UserID (user_id_t uid) : + m_uid(uid) +{ +} + +UserID::~UserID () +{ +} + +void +UserID::Clear () +{ + m_uid = LLDB_INVALID_UID; +} + + +user_id_t +UserID::GetID () const +{ + return m_uid; +} + +void +UserID::SetID (user_id_t uid) +{ + m_uid = uid; +} + +UserID::IDMatches::IDMatches (user_id_t uid) : + m_uid(uid) +{ +} + +bool +UserID::IDMatches::operator() (const UserID& rhs) const +{ + return m_uid == rhs.GetID(); +} + +Stream& +lldb_private::operator << (Stream& strm, const UserID& uid) +{ + strm.Printf("{0x%8.8x}", uid.GetID()); + return strm; +} + +bool +lldb_private::operator== (const UserID& lhs, const UserID& rhs) +{ + return lhs.GetID() == rhs.GetID(); +} + +bool +lldb_private::operator!= (const UserID& lhs, const UserID& rhs) +{ + return lhs.GetID() != rhs.GetID(); +} + |