xref: /haiku/src/kits/debugger/debug_info/ImageDebugInfoLoadingState.cpp (revision 779ab335dd81d47f9aa7ef06822de37c8fec1c6e)
1 /*
2  * Copyright 2014, Rene Gollent, rene@gollent.com.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "ImageDebugInfoLoadingState.h"
8 
9 #include "SpecificImageDebugInfoLoadingState.h"
10 
11 
ImageDebugInfoLoadingState()12 ImageDebugInfoLoadingState::ImageDebugInfoLoadingState()
13 	:
14 	fSpecificInfoLoadingState(),
15 	fSpecificInfoIndex(0)
16 {
17 }
18 
19 
~ImageDebugInfoLoadingState()20 ImageDebugInfoLoadingState::~ImageDebugInfoLoadingState()
21 {
22 }
23 
24 
25 bool
HasSpecificDebugInfoLoadingState() const26 ImageDebugInfoLoadingState::HasSpecificDebugInfoLoadingState() const
27 {
28 	return fSpecificInfoLoadingState.IsSet();
29 }
30 
31 
32 void
SetSpecificDebugInfoLoadingState(SpecificImageDebugInfoLoadingState * state)33 ImageDebugInfoLoadingState::SetSpecificDebugInfoLoadingState(
34 	SpecificImageDebugInfoLoadingState* state)
35 {
36 	fSpecificInfoLoadingState.SetTo(state, true);
37 }
38 
39 
40 void
ClearSpecificDebugInfoLoadingState()41 ImageDebugInfoLoadingState::ClearSpecificDebugInfoLoadingState()
42 {
43 	fSpecificInfoLoadingState = NULL;
44 }
45 
46 
47 bool
UserInputRequired() const48 ImageDebugInfoLoadingState::UserInputRequired() const
49 {
50 	if (HasSpecificDebugInfoLoadingState())
51 		return fSpecificInfoLoadingState->UserInputRequired();
52 
53 	return false;
54 }
55 
56 
57 void
SetSpecificInfoIndex(int32 index)58 ImageDebugInfoLoadingState::SetSpecificInfoIndex(int32 index)
59 {
60 	fSpecificInfoIndex = index;
61 }
62