ArkScript
A small, fast, functional and scripting language for video games
Utils.cpp File Reference
#include <Ark/REPL/replxx/Util.hpp>
#include <cstring>
#include <regex>
+ Include dependency graph for Utils.cpp:

Go to the source code of this file.

Functions

int utf8str_codepoint_len (char const *s, int utf8len)
 
int context_len (char const *prefix)
 
Replxx::completions_t hook_completion (std::string const &context, int &contextLen, std::vector< std::string > const &examples)
 
void hook_color (std::string const &context, Replxx::colors_t &colors, std::vector< std::pair< std::string, Replxx::Color > > const &regex_color)
 
Replxx::hints_t hook_hint (std::string const &context, int &contextLen, Replxx::Color &color, std::vector< std::string > const &examples)
 

Function Documentation

◆ context_len()

int context_len ( char const *  prefix)

Definition at line 27 of file Utils.cpp.

Referenced by hook_completion(), and hook_hint().

◆ hook_color()

void hook_color ( std::string const &  context,
Replxx::colors_t &  colors,
std::vector< std::pair< std::string, Replxx::Color > > const &  regex_color 
)

Definition at line 69 of file Utils.cpp.

References utf8str_codepoint_len().

Referenced by Ark::Repl::cui_setup().

◆ hook_completion()

Replxx::completions_t hook_completion ( std::string const &  context,
int &  contextLen,
std::vector< std::string > const &  examples 
)

Definition at line 45 of file Utils.cpp.

References context_len(), and utf8str_codepoint_len().

Referenced by Ark::Repl::cui_setup().

◆ hook_hint()

Replxx::hints_t hook_hint ( std::string const &  context,
int &  contextLen,
Replxx::Color &  color,
std::vector< std::string > const &  examples 
)

Definition at line 94 of file Utils.cpp.

References context_len(), and utf8str_codepoint_len().

Referenced by Ark::Repl::cui_setup().

◆ utf8str_codepoint_len()

int utf8str_codepoint_len ( char const *  s,
int  utf8len 
)

Definition at line 5 of file Utils.cpp.

Referenced by hook_color(), hook_completion(), and hook_hint().