ArkScript
A small, fast, functional and scripting language for video games
Util.hpp
Go to the documentation of this file.
1/**
2 * @file Util.hpp
3 * @author Alexandre Plateau ([email protected])
4 * @brief replxx utilities
5 * @version 0.1
6 * @date 2020-10-27
7 *
8 * @copyright Copyright (c) 2020-2021
9 *
10 */
11
12#ifndef REPL_REPLXX_UTIL_HPP
13#define REPL_REPLXX_UTIL_HPP
14
15#include <vector>
16#include <utility>
17#include <string>
18
19#include <replxx.hxx>
20
21using Replxx = replxx::Replxx;
22
23int utf8str_codepoint_len(char const* s, int utf8len);
24int context_len(char const* prefix);
25Replxx::completions_t hook_completion(std::string const& context, int& contextLen, std::vector<std::string> const& user_data);
26void hook_color(std::string const& str, Replxx::colors_t& colors, std::vector<std::pair<std::string, Replxx::Color>> const& user_data);
27Replxx::hints_t hook_hint(std::string const& context, int& contextLen, Replxx::Color& color, std::vector<std::string> const& examples);
28
29#endif
replxx::Replxx Replxx
int utf8str_codepoint_len(char const *s, int utf8len)
Definition: Utils.cpp:5
Replxx::completions_t hook_completion(std::string const &context, int &contextLen, std::vector< std::string > const &user_data)
Definition: Utils.cpp:45
void hook_color(std::string const &str, Replxx::colors_t &colors, std::vector< std::pair< std::string, Replxx::Color > > const &user_data)
Definition: Utils.cpp:69
Replxx::hints_t hook_hint(std::string const &context, int &contextLen, Replxx::Color &color, std::vector< std::string > const &examples)
Definition: Utils.cpp:94
int context_len(char const *prefix)
Definition: Utils.cpp:27