blob: b1dd5a618c1240cc20ce4f50f9153b1ba0a29af9 [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- UserID.cpp ----------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "lldb/Core/UserID.h"
11#include "lldb/Core/Stream.h"
12
13using namespace lldb;
14using namespace lldb_private;
15
16UserID::UserID (user_id_t uid) :
17 m_uid(uid)
18{
19}
20
21UserID::~UserID ()
22{
23}
24
25void
26UserID::Clear ()
27{
28 m_uid = LLDB_INVALID_UID;
29}
30
31
32user_id_t
33UserID::GetID () const
34{
35 return m_uid;
36}
37
38void
39UserID::SetID (user_id_t uid)
40{
41 m_uid = uid;
42}
43
44UserID::IDMatches::IDMatches (user_id_t uid) :
45 m_uid(uid)
46{
47}
48
49bool
50UserID::IDMatches::operator() (const UserID& rhs) const
51{
52 return m_uid == rhs.GetID();
53}
54
55Stream&
56lldb_private::operator << (Stream& strm, const UserID& uid)
57{
58 strm.Printf("{0x%8.8x}", uid.GetID());
59 return strm;
60}
61
62bool
63lldb_private::operator== (const UserID& lhs, const UserID& rhs)
64{
65 return lhs.GetID() == rhs.GetID();
66}
67
68bool
69lldb_private::operator!= (const UserID& lhs, const UserID& rhs)
70{
71 return lhs.GetID() != rhs.GetID();
72}
73