xref: /haiku/src/kits/debugger/value/ValueLoader.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2015, Rene Gollent, rene@gollent.com.
3  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef VALUE_LOADER_H
7 #define VALUE_LOADER_H
8 
9 
10 #include <String.h>
11 
12 #include <Variant.h>
13 
14 
15 class Architecture;
16 class CpuState;
17 class TeamMemory;
18 class ValueLocation;
19 
20 
21 class ValueLoader {
22 public:
23 								ValueLoader(Architecture* architecture,
24 									TeamMemory* teamMemory,
25 									CpuState* cpuState);
26 									// cpuState can be NULL
27 								~ValueLoader();
28 
29 			Architecture*		GetArchitecture() const
30 									{ return fArchitecture; }
31 
32 			status_t			LoadValue(ValueLocation* location,
33 									type_code valueType, bool shortValueIsFine,
34 									BVariant& _value);
35 
36 			status_t			LoadRawValue(BVariant& location,
37 									size_t maxSize, void* _value);
38 
39 			status_t			LoadStringValue(BVariant& location,
40 									size_t maxSize, BString& _value);
41 
42 private:
43 			Architecture*		fArchitecture;
44 			TeamMemory*			fTeamMemory;
45 			CpuState*			fCpuState;
46 };
47 
48 
49 #endif	// VALUE_LOADER_H
50