Skip to content

Commit

Permalink
✨ decode_one and encode_one functions
Browse files Browse the repository at this point in the history
— 📝 Add single and bulk function descriptions in API documentation
  • Loading branch information
ThePhD committed Apr 14, 2022
1 parent 3f2042e commit 3db8c3b
Show file tree
Hide file tree
Showing 12 changed files with 1,691 additions and 45 deletions.
14 changes: 11 additions & 3 deletions documentation/source/api/conversions/decode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
decode
======

The ``decode`` grouping of functions (``decode``, ``decode_to``, and ``decode_into``) perform the task of doing bulk decoding from an ``input`` of ``code_unit``\ s to the encoding's ``code_point`` type.
The ``decode`` grouping of functions (``decode``, ``decode_to``, and ``decode_into``) perform the task of doing bulk decoding from an ``input`` of ``code_unit``\ s to the encoding's ``code_point`` type. They are also accompanied by ``decode_one`` variants (``decode_one``, ``decode_one_to``, ``decode_one_into``), which serve the same purpose as their bulk counterpoints but only do a single :term:`indivisible unit of work`'s worth of work.



Expand Down Expand Up @@ -113,8 +113,16 @@ The base function call, ``basic_decode_into``, simply performs the :doc:`core de



Functions
---------
Bulk Functions
--------------

.. doxygengroup:: ztd_text_decode
:content-only:



Single Functions
----------------

.. doxygengroup:: ztd_text_decode_one
:content-only:
14 changes: 11 additions & 3 deletions documentation/source/api/conversions/encode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
encode
======

The ``encode`` grouping of functions (``encode``, ``encode_to``, and ``encode_into``) perform the task of doing bulk decoding from an ``input`` of ``code_point``\ s to the encoding's ``code_unit`` type.
The ``encode`` grouping of functions (``encode``, ``encode_to``, and ``encode_into``) perform the task of doing bulk decoding from an ``input`` of ``code_point``\ s to the encoding's ``code_unit`` type. They are also accompanied by ``encode_one`` variants (``encode_one``, ``encode_one_to``, ``encode_one_into``), which serve the same purpose as their bulk counterpoints but only do a single :term:`indivisible unit of work`'s worth of work.



Expand Down Expand Up @@ -113,8 +113,16 @@ The final function call, ``basic_encode_into``, simply performs the :doc:`core e



Functions
---------
Bulk Functions
--------------

.. doxygengroup:: ztd_text_encode
:content-only:



Single Functions
----------------

.. doxygengroup:: ztd_text_encode_one
:content-only:
13 changes: 10 additions & 3 deletions documentation/source/api/conversions/transcode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
transcode
=========

The ``transcode`` grouping of functions (``transcode``, ``transcode_to``, and ``transcode_into``) perform the task of doing bulk transcoding from an ``input`` of ``code_unit``\ s to a second encoding's ``code_unit`` type. It expects to traffic through the ``code_point`` type as the intermediary between the two functions.
The ``transcode`` grouping of functions (``transcode``, ``transcode_to``, and ``transcode_into``) perform the task of doing bulk transcoding from an ``input`` of ``code_unit``\ s to a second encoding's ``code_unit`` type. It expects to traffic through the ``code_point`` type as the intermediary between the two functions. There is also a ``transcode_one`` API as well that does a single indivisible unit of work for both decoding (to a common representation) and then encoding, and has the same variants as the bulk function.



Expand Down Expand Up @@ -113,8 +113,15 @@ The ``transcode_one`` extension point is also used in the :doc:`ztd::text::trans



Functions
---------
Bulk Functions
--------------

.. doxygengroup:: ztd_text_transcode
:content-only:


Single Functions
----------------

.. doxygengroup:: ztd_text_transcode_one
:content-only:
3 changes: 3 additions & 0 deletions documentation/source/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Occasionally, we may need to use precise language to describe what we want. This

The other definition is just an abstract unit of information in human languages and writing. The closest approximation that Unicode has for the human language/writing character is a :term:`Grapheme Cluster <grapheme cluster>`.

indivisible unit of work
A single unit of transcoding effort when going from one encoding to another that consumes the smallest possible input to produce an output, to change the state, to both produce an output and change the state, or to produce an error. Unlike :term:`unicode code points <unicode code point>` or :term:`unicode scalar values <unicode scalar value>`, indivisible units of work do not have a fixed width or fixed definition and are dependent on the two encodings involved in the transcoding operation being performed.

unicode code point
A single unit of decoded information for Unicode. It represents the smallest, non-encoded, and indivisible piece of information that can be used to talk about higher level algorithms, properties, and more from the Unicode Standard.

Expand Down
1 change: 0 additions & 1 deletion include/ztd/text/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

#include <string>
#include <vector>
#include <string_view>

#include <ztd/prologue.hpp>

Expand Down

0 comments on commit 3db8c3b

Please sign in to comment.