Hex.Document
Description: Reference for Hex.Document

### Class

# HexDocument

#### Description

    final class Hex.Document : GObject.Object {
      /* No available fields */
    }

`HexDocument` is an object which allows raw data to be loaded, saved and manipulated, intended primarily to be used with the `HexWidget` widget.

#### Ancestors

- GObject

#### Constructors

###### hex_document_new

Create a new empty `HexDocument` object.

###### hex_document_new_from_file

A convenience method to create a new `HexDocument` from file.

#### Instance methods

###### hex_document_can_redo

Determine whether a redo operation is possible.

###### hex_document_can_undo

Determine whether an undo operation is possible.

###### hex_document_changed

Convenience method to emit the `HexDocument::document-changed` signal. This method is mostly only useful for widgets utilizing `HexDocument`.

###### hex_document_compare_data

No description available.

###### hex_document_compare_data_full

Full version of `hex_document_compare_data()` to allow data comparisons broader than byte-for-byte matches only. However, it is less convenient than the above since it requires the caller to allocate and free a `HexDocumentFindData` structure.

since: 4.2

###### hex_document_delete_data

Delete data at `offset` of `length` within the buffer.

###### hex_document_export_html

Export the `HexDocument` to HTML.

###### hex_document_find_backward

Find a string backwards in a `HexDocument`.

###### hex_document_find_backward_async

Non-blocking version of `hex_document_find_backward()`. This is the function that should generally be used by a GUI client to find a string backwards in a `HexDocument`.

###### hex_document_find_backward_full

Full version of `hex_document_find_backward()` which allows for more flexibility than the above, which is only for a byte-by-byte exact match. However, it is less convenient to call since the caller must create and and free a `HexDocumentFindData` structure manually.

since: 4.2

###### hex_document_find_backward_full_async

Non-blocking version of `hex_document_find_backward_full()`.

since: 4.2

###### hex_document_find_finish

Obtain the result of a completed asynchronous find operation (forwards or backwards).

###### hex_document_find_forward

Find a string forwards in a `HexDocument`.

###### hex_document_find_forward_async

Non-blocking version of `hex_document_find_forward()`. This is the function that should generally be used by a GUI client to find a string forwards in a `HexDocument`.

###### hex_document_find_forward_full

Full version of `hex_document_find_forward()` which allows for more flexibility than the above, which is only for a byte-by-byte exact match. However, it is less convenient to call since the caller must create and and free a `HexDocumentFindData` structure manually.

since: 4.2

###### hex_document_find_forward_full_async

Non-blocking version of `hex_document_find_forward_full()`.

since: 4.2

###### hex_document_get_buffer

Get the `HexBuffer` connected with the `HexDocument`.

###### hex_document_get_file

Get the `GFile` connected with the `HexDocument`.

###### hex_document_get_file_size

No description available.

###### hex_document_get_undo_data

Get the undo data at the top of the undo stack of a `HexDocument`, if any.

###### hex_document_has_changed

Method to check whether the `HexDocument` has changed.

###### hex_document_read_async

Read the `GFile` into the buffer connected to the `HexDocument` object.

###### hex_document_read_finish

Obtain the result of a completed file read operation.

###### hex_document_redo

Perform a redo operation.

###### hex_document_set_buffer

Set the `HexBuffer` connected with the `HexDocument`.

since: 4.2

###### hex_document_set_byte

Set a particular byte of a `HexDocument` at position `offset` within the payload.

###### hex_document_set_data

A convenience wrapper for `hex_buffer_set_data()`. See the description of that method for details.

###### hex_document_set_file

Set the file of a `HexDocument` object by `GFile`.

###### hex_document_set_max_undo

Set the maximum size of the `HexDocument` undo stack.

###### hex_document_set_nibble

Set a particular nibble of a `HexDocument`.

###### hex_document_undo

Perform an undo operation.

###### hex_document_write

Write the buffer to the pre-existing `GFile` connected to the `HexDocument` object. This can be used for a ‘Save (in place)’ operation.

###### hex_document_write_async

Write the buffer to the pre-existing `GFile` connected to the `HexDocument` object. This can be used for a ‘Save (in place)’ operation. This is the non-blocking version of `hex_document_write()`.

###### hex_document_write_finish

Obtain the result of a completed write-to-file operation.

###### hex_document_write_to_file

Write the buffer to `file`. This can be used for a ‘Save As’ operation.

###### hex_document_write_to_file_async

Write the buffer to `file` asynchronously. This can be used for a ‘Save As’ operation. This is the non-blocking version of `hex_document_write_to_file()`.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Hex.Document:buffer

No description available.

###### Hex.Document:file

No description available.

#### Signals

###### Hex.Document::document-changed

No description available.

###### Hex.Document::file-loaded

No description available.

###### Hex.Document::file-name-changed

No description available.

###### Hex.Document::file-read-started

No description available.

###### Hex.Document::file-saved

No description available.

###### Hex.Document::redo

No description available.

###### Hex.Document::undo

No description available.

###### Hex.Document::undo-stack-forget

No description available.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct HexDocumentClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.