1/*
2 * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include "AddressValue.h"
8
9#include <stdio.h>
10
11
12AddressValue::AddressValue(const BVariant& value)
13	:
14	IntegerValue(value)
15{
16}
17
18
19AddressValue::~AddressValue()
20{
21}
22
23
24bool
25AddressValue::ToString(BString& _string) const
26{
27	if (!fValue.IsInteger())
28		return false;
29
30	char buffer[32];
31	snprintf(buffer, sizeof(buffer), "%#" B_PRIx64, fValue.ToUInt64());
32
33	BString string(buffer);
34	if (string.Length() == 0)
35		return false;
36
37	_string = string;
38	return true;
39}
40