summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/UserID.cpp
blob: b1dd5a618c1240cc20ce4f50f9153b1ba0a29af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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();
}

OpenPOWER on IntegriCloud