Utility functions for working with data formats used by property exchange messages. More...
#include <juce_CIEncodings.h>
Public Member Functions | |
Encodings ()=delete | |
Static Public Member Functions | |
static String | stringFrom7BitText (Span< const std::byte > bytes) |
Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits. | |
static std::vector< std::byte > | stringTo7BitText (const String &text) |
Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits. | |
static var | jsonFrom7BitText (Span< const std::byte > bytes) |
Converts a list of bytes representing a 7-bit ASCII string to JSON. | |
static std::vector< std::byte > | jsonTo7BitText (const var &v) |
Converts a JSON object to a list of bytes in 7-bit ASCII format. | |
static std::vector< std::byte > | toMcoded7 (Span< const std::byte > bytes) |
Each group of seven stored bytes is transmitted as eight bytes. | |
static std::vector< std::byte > | fromMcoded7 (Span< const std::byte > bytes) |
Each group of seven stored bytes is transmitted as eight bytes. | |
static std::optional< std::vector< std::byte > > | tryEncode (Span< const std::byte > bytes, Encoding mutualEncoding) |
Attempts to encode the provided byte span using the specified encoding. | |
static std::vector< std::byte > | decode (Span< const std::byte > bytes, Encoding mutualEncoding) |
Decodes the provided byte span using the specified encoding. | |
Utility functions for working with data formats used by property exchange messages.
|
delete |
Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits.
The encoding rules are in section 5.10.4 of the CI spec.
Referenced by midi_ci::Message::ACK::getMessageTextAsString(), midi_ci::Message::NAK::getMessageTextAsString(), and jsonFrom7BitText().
|
static |
Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits.
The encoding rules are in section 5.10.4 of the CI spec.
Referenced by jsonTo7BitText().
Converts a list of bytes representing a 7-bit ASCII string to JSON.
References JSON::parse(), and stringFrom7BitText().
|
static |
Converts a JSON object to a list of bytes in 7-bit ASCII format.
References JSON::none, stringTo7BitText(), JSON::toString(), and JSON::FormatOptions::withSpacing().
|
static |
Each group of seven stored bytes is transmitted as eight bytes.
First, the sign bits of the seven bytes are sent, followed by the low-order 7 bits of each byte.
|
static |
Each group of seven stored bytes is transmitted as eight bytes.
First, the sign bits of the seven bytes are sent, followed by the low-order 7 bits of each byte.
|
static |
Attempts to encode the provided byte span using the specified encoding.
The ASCII encoding does not make any changes to the input stream, but encoding will fail if any byte has its most significant bit set.
|
static |
Decodes the provided byte span using the specified encoding.
All bytes of the input must be 7-bit values, i.e. all most-significant bits are unset.