library.py
Others:
Bases: foundations.dataStructures.Structure
This class represents a library hook used by the Library class to bind target library functions.
Usage:
LibraryHook(name="FreeImage_GetVersion", argumentsTypes=None, returnValue=ctypes.c_char_p)
Parameters: |
|
---|
Bases: object
Usage:
>>> path = "FreeImage.dll"
>>> functions = (LibraryHook(name="FreeImage_GetVersion", argumentsTypes=None, returnValue=ctypes.c_char_p),)
>>> library = Library(path, functions)
>>> library.FreeImage_GetVersion()
3.13.1
Parameters: |
|
---|
callback: Defines library callback default function. ( ctypes.CFUNCTYPE )
alias of CFunctionType
This method is the property for self.__librariesInstances attribute.
Returns: | self.__librariesInstances. ( WeakValueDictionary ) |
---|
This method is the property for self.__libraryInstantiated attribute.
Returns: | self.__libraryInstantiated. ( String ) |
---|
This method is the property for self.__libraryPath attribute.
Returns: | self.__libraryPath. ( String ) |
---|
This method is the property for self.__functions attribute.
Returns: | self.__functions. ( Tuple ) |
---|
This method is the property for self.__library attribute.
Returns: | self.__library. ( Object ) |
---|
This method binds given function to a class object attribute.
Usage:
>>> path = "FreeImage.dll"
>>> function = LibraryHook(name="FreeImage_GetVersion", argumentsTypes=None, returnValue=ctypes.c_char_p)
>>> library = Library(path, bindLibrary=False)
>>> library.bindFunction(function)
True
>>> library.FreeImage_GetVersion()
3.13.1
Parameters: | function – Function to bind. ( LibraryHook ) |
---|---|
Returns: | Method success. ( Boolean ) |
This method binds the Library using functions registered in the self.__functions attribute.
Usage:
>>> path = "FreeImage.dll"
>>> functions = (LibraryHook(name="FreeImage_GetVersion", argumentsTypes=None, returnValue=ctypes.c_char_p),)
>>> library = Library(path, functions, bindLibrary=False)
>>> library.bindLibrary()
True
>>> library.FreeImage_GetVersion()
3.13.1
Returns: | Method success. ( Boolean ) |
---|