Ejemplo n.º 1
0
 def __iter__(self):
     startup._init_plugins()
     count = ctypes.c_ulonglong()
     platforms = core.BNGetPlatformList(count)
     try:
         for i in xrange(0, count.value):
             yield Platform(None, core.BNNewPlatformReference(platforms[i]))
     finally:
         core.BNFreePlatformList(platforms, count.value)
Ejemplo n.º 2
0
	def list(self):
		startup._init_plugins()
		count = ctypes.c_ulonglong()
		platforms = core.BNGetPlatformList(count)
		result = []
		for i in xrange(0, count.value):
			result.append(Platform(None, core.BNNewPlatformReference(platforms[i])))
		core.BNFreePlatformList(platforms, count.value)
		return result
Ejemplo n.º 3
0
	def get_list(cls, os = None, arch = None):
		startup._init_plugins()
		count = ctypes.c_ulonglong()
		if os is None:
			platforms = core.BNGetPlatformList(count)
		elif arch is None:
			platforms = core.BNGetPlatformListByOS(os)
		else:
			platforms = core.BNGetPlatformListByArchitecture(os, arch.handle)
		result = []
		for i in xrange(0, count.value):
			result.append(Platform(None, core.BNNewPlatformReference(platforms[i])))
		core.BNFreePlatformList(platforms, count.value)
		return result