2 * Copyright 2008-2009 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
16 #include <StringItem.h>
19 #include "dm_wrapper.h"
33 Attribute(BString name
, BString value
)
34 { fName
= name
; fValue
= value
; }
40 typedef std::map
<BString
, BString
>::const_iterator AttributeMapIterator
;
41 typedef std::map
<BString
, BString
> AttributeMap
;
42 typedef std::pair
<BString
, BString
> AttributePair
;
43 typedef std::vector
<Attribute
> Attributes
;
51 CAT_MULTIMEDIA
, // 0x04
62 CAT_SATELLITE
, // 0x0F
70 extern const char* kCategoryString
[];
71 extern const int kCategoryStringLength
;
74 class Device
: public BStringItem
{
76 Device(Device
* physicalParent
,
77 BusType busType
= BUS_NONE
,
78 Category category
= CAT_NONE
,
79 const BString
& name
= "unknown",
80 const BString
& manufacturer
= "unknown",
81 const BString
& driverUsed
= "unknown",
82 const BString
& devPathsPublished
= "unknown");
85 virtual BString
GetName();
86 virtual BString
GetManufacturer();
87 virtual BString
GetDriverUsed();
88 virtual BString
GetDevPathsPublished();
89 virtual Category
GetCategory() const
91 virtual Device
* GetPhysicalParent() const
92 { return fPhysicalParent
; }
93 virtual BusType
GetBusType() const
96 virtual Attributes
GetBasicAttributes();
97 virtual Attributes
GetBusAttributes();
98 virtual Attributes
GetAllAttributes();
100 virtual BString
GetBasicStrings();
101 virtual BString
GetBusStrings();
102 virtual BString
GetAllStrings();
104 virtual BString
GetBusTabName();
106 virtual Attribute
GetAttribute(const BString
& name
)
107 { return Attribute(name
.String(),
108 fAttributeMap
[name
]); }
110 virtual void SetAttribute(const BString
& name
,
111 const BString
& value
);
113 virtual void InitFromAttributes() { return; }
116 AttributeMap fAttributeMap
;
119 Device
* fPhysicalParent
;
122 #endif /* DEVICE_H */