HexEdit/HexEditWidget.py

changeset 4659
2863d05e83c6
parent 4658
d760763dcc4a
child 4663
e2625053a0e2
diff -r d760763dcc4a -r 2863d05e83c6 HexEdit/HexEditWidget.py
--- a/HexEdit/HexEditWidget.py	Mon Jan 11 17:39:04 2016 +0100
+++ b/HexEdit/HexEditWidget.py	Mon Jan 11 19:46:19 2016 +0100
@@ -750,6 +750,17 @@
         if not modified and setCleanState:
             self.__undoStack.setClean()
     
+    def selectionToHexString(self):
+        """
+        Public method to get a hexadecimal representation of the selection.
+        
+        @return hexadecimal representation of the selection
+        @rtype str
+        """
+        byteArray = self.__chunks.data(self.getSelectionBegin(),
+                                       self.__getSelectionLength())
+        return self.__toHex(byteArray).decode(encoding="ascii")
+    
     def selectionToReadableString(self):
         """
         Public method to get a formatted representation of the selection.

eric ide

mercurial