2 * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
6 #include "AttributeValue.h"
10 #include "AttributeClasses.h"
14 AttributeValue::ToString(char* buffer
, size_t size
)
16 switch (attributeClass
) {
17 case ATTRIBUTE_CLASS_ADDRESS
:
18 snprintf(buffer
, size
, "%#" B_PRIx64
, address
);
20 case ATTRIBUTE_CLASS_BLOCK
:
21 snprintf(buffer
, size
, "(%p, %#" B_PRIx64
")", block
.data
,
24 case ATTRIBUTE_CLASS_CONSTANT
:
25 snprintf(buffer
, size
, "%#" B_PRIx64
, constant
);
27 case ATTRIBUTE_CLASS_FLAG
:
28 snprintf(buffer
, size
, "%s", flag
? "true" : "false");
30 case ATTRIBUTE_CLASS_LINEPTR
:
31 case ATTRIBUTE_CLASS_LOCLISTPTR
:
32 case ATTRIBUTE_CLASS_MACPTR
:
33 case ATTRIBUTE_CLASS_RANGELISTPTR
:
34 snprintf(buffer
, size
, "%#" B_PRIx64
, pointer
);
36 case ATTRIBUTE_CLASS_REFERENCE
:
37 snprintf(buffer
, size
, "%p", reference
);
39 case ATTRIBUTE_CLASS_STRING
:
40 snprintf(buffer
, size
, "\"%s\"", string
);
44 case ATTRIBUTE_CLASS_UNKNOWN
: