def ReadVersion(self):
    library_name, _, _ = self.name.partition(u'_')
    version_line = b'#define {0:s}_VERSION'.format(library_name.upper())

    with open(self._path, 'rb') as file_object:
      for line in file_object.readlines():
        line = line.strip()
        if line.startswith(version_line):
          _, _, version = line.rpartition(version_line)
          version = version.strip()

          # TODO: convert version to integer?
          self.version = version.decode(u'ascii')

          return True

    return False
Reads the version from the definitions header file.
dataset/ETHPy150Open libyal/libyal/scripts/overview-generate.py/DefinitionsHeaderFile.ReadVersion