vfs: check userland buffers before reading them.
[haiku.git] / src / kits / debugger / model / TypeLookupConstraints.cpp
blob787ee3486b76456c411d0a0435389660c1a582cc
1 /*
2 * Copyright 2011, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "TypeLookupConstraints.h"
10 TypeLookupConstraints::TypeLookupConstraints()
12 fTypeKindGiven(false),
13 fSubtypeKindGiven(false)
18 TypeLookupConstraints::TypeLookupConstraints(type_kind typeKind)
20 fTypeKind(typeKind),
21 fTypeKindGiven(true),
22 fSubtypeKindGiven(false)
27 TypeLookupConstraints::TypeLookupConstraints(type_kind typeKind,
28 int32 subTypeKind)
30 fTypeKind(typeKind),
31 fSubtypeKind(subTypeKind),
32 fTypeKindGiven(true),
33 fSubtypeKindGiven(true),
34 fBaseTypeName()
39 bool
40 TypeLookupConstraints::HasTypeKind() const
42 return fTypeKindGiven;
46 bool
47 TypeLookupConstraints::HasSubtypeKind() const
49 return fSubtypeKindGiven;
53 bool
54 TypeLookupConstraints::HasBaseTypeName() const
56 return fBaseTypeName.Length() > 0;
60 type_kind
61 TypeLookupConstraints::TypeKind() const
63 return fTypeKind;
67 int32
68 TypeLookupConstraints::SubtypeKind() const
70 return fSubtypeKind;
74 const BString&
75 TypeLookupConstraints::BaseTypeName() const
77 return fBaseTypeName;
81 void
82 TypeLookupConstraints::SetTypeKind(type_kind typeKind)
84 fTypeKind = typeKind;
85 fTypeKindGiven = true;
89 void
90 TypeLookupConstraints::SetSubtypeKind(int32 subtypeKind)
92 fSubtypeKind = subtypeKind;
93 fSubtypeKindGiven = true;
97 void
98 TypeLookupConstraints::SetBaseTypeName(const BString& name)
100 fBaseTypeName = name;