libkate: Text manipulation

# Text manipulation

## Functions
int | kate_text_get_character (kate_text_encoding text_encoding, const char **const text, size_t *len0)
int | kate_text_set_character (kate_text_encoding text_encoding, int c, char **const text, size_t *len0)
int | kate_text_remove_markup (kate_text_encoding text_encoding, char *text, size_t *len0)
int | kate_text_validate (kate_text_encoding text_encoding, const char *text, size_t len0)

## Detailed Description

## Function Documentation

int kate_text_get_character | ( | kate_text_encoding | text_encoding,
|  | const char **const | text,
|  | size_t * | len0 |
| ) |  |  |

Reads a code point from the string, advancing the text pointer to the next one.

Parameters:

  | text_encoding | the character encoding the text is coded in
  | text | a pointer to the text pointer, to be advanced to the next character on success
  | len0 | a pointer to the length of the buffer, including any terminating NUL, to be decreased by the number of bytes that text is advanced on success

Returns:
  >=0 success, the unicode code point read
  KATE_E_* error

References KATE_E_INVALID_PARAMETER, KATE_E_TEXT, and kate_utf8.

Referenced by kate_tracker_init().

int kate_text_remove_markup | ( | kate_text_encoding | text_encoding,
|  | char * | text,
|  | size_t * | len0 |
| ) |  |  |

Removes markup from the given text.

Parameters:

  | text_encoding | the character encoding the text is coded in
  | text | the text to remove markup from
  | len0 | the length in bytes of the text, including any terminating NUL - will be set to the length of the text with markup removed, including any terminating NUL

Returns:
  0 success
  KATE_E_* error

References KATE_E_INVALID_PARAMETER, and kate_utf8.

int kate_text_set_character | ( | kate_text_encoding | text_encoding,
|  | int | c,
|  | char **const | text,
|  | size_t * | len0 |
| ) |  |  |

Writes a code point to the given string, advancing the text pointer to the next byte.

Parameters:

  | text_encoding | the character encoding the text is coded in
  | c | the unicode code point to write to the string
  | text | a pointer to the text pointer, to be advanced to the next character on success
  | len0 | a pointer to the length of the buffer, including any terminating NUL, to be decreased by the number of bytes that text is advanced on success

Returns:
  >=0 success, the number of bytes used to write this code point
  KATE_E_* error

References KATE_E_INVALID_PARAMETER, KATE_E_TEXT, and kate_utf8.

int kate_text_validate | ( | kate_text_encoding | text_encoding,
|  | const char * | text,
|  | size_t | len0 |
| ) |  |  |

Validates text for the given character encoding, flagging partial sequences and invalid sequences.

Parameters:

  | text_encoding | the character encoding the text is coded in
  | text | the text to validate (may include embedded NULs)
  | len0 | the length in bytes of the text, including any terminating NUL

Returns:
  0 success
  KATE_E_* error

References KATE_E_INVALID_PARAMETER, KATE_E_TEXT, and kate_utf8.

Referenced by kate_comment_add_length(), kate_encode_text_raw_times(), and kate_meta_add_string().