Python Vbox API enums

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
hoverflow
Posts: 4
Joined: 24. Feb 2015, 02:37

Python Vbox API enums

Post by hoverflow »

Why when I look at the API I see enums take incorrect values.
For example:

Code: Select all

enum ProcessWaitForFlag { 
  ProcessWaitForFlag_None = 0, ProcessWaitForFlag_Start = 1, ProcessWaitForFlag_Terminate = 2, ProcessWaitForFlag_StdIn = 4, 
  ProcessWaitForFlag_StdOut = 8, ProcessWaitForFlag_StdErr = 16 
}

What are these numbers ? It should be 0, 1, 2, ect..
And when I use Vbox constants they print a string not an integer value to be sent to the required functions.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Python Vbox API enums

Post by noteirak »

That would be because they are flag values which you can add together to specify more than one. They work the same way as linux permissions.
you can also use an array of them when calling IGuestProcess::waitForArray()
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply