MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / OpenFileNameField

Class OpenFileNameField

python/interaction.py:322–368  ·  view source on GitHub ↗

``OpenFileNameField`` prompts the user to specify a file name to open. Result is stored in self.result as a string.

Source from the content-addressed store, hash-verified

320
321
322class OpenFileNameField:
323 """
324 ``OpenFileNameField`` prompts the user to specify a file name to open. Result is stored in self.result as a string.
325 """
326 def __init__(self, prompt: str, ext: str = "", default: Optional[str] = None):
327 self._prompt = prompt
328 self._ext = ext
329 self._default = default
330 self._result = None
331
332 def _fill_core_struct(self, value):
333 value.type = FormInputFieldType.OpenFileNameFormField
334 value.prompt = self._prompt
335 value.ext = self._ext
336 value.hasDefault = self._default is not None
337 if self._default is not None:
338 value.stringDefault = self._default
339
340 def _fill_core_result(self, value):
341 value.stringResult = core.BNAllocString(str(self.result))
342
343 def _get_result(self, value):
344 self._result = value.stringResult
345
346 @property
347 def prompt(self):
348 return self._prompt
349
350 @prompt.setter
351 def prompt(self, value):
352 self._prompt = value
353
354 @property
355 def ext(self):
356 return self._ext
357
358 @ext.setter
359 def ext(self, value):
360 self._ext = value
361
362 @property
363 def result(self):
364 return self._result
365
366 @result.setter
367 def result(self, value):
368 self._result = value
369
370
371class SaveFileNameField:

Callers 1

_get_form_inputMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected