A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
offsets.h File Reference
#include <cstddef>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <nlohmann/json_fwd.hpp>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  a11::flow::TextIndex
 A document, and the offset arithmetic every editor protocol needs over it. More...
 

Namespaces

namespace  a11
 
namespace  a11::flow
 

Enumerations

enum class  a11::flow::OffsetBasis { a11::flow::kBytes , a11::flow::kUtf16 }
 Which basis the offsets in a request and its answer are counted in. More...
 

Functions

bool a11::flow::OffsetBasisFromName (std::string_view name, OffsetBasis &basis)
 The basis a request named, or kBytes when it named none.
 
std::string_view a11::flow::OffsetBasisName (OffsetBasis basis)
 The name of a basis, for a message and for the JSON.
 
void a11::flow::RebaseToUtf16 (nlohmann::json &answer, const TextIndex &index)
 Rewrite every document offset in an answer from bytes into UTF-16 units.