ArkScript
A small, fast, functional and scripting language for video games
Util.hpp File Reference

replxx utilities More...

#include <vector>
#include <utility>
#include <string>
#include <replxx.hxx>
+ Include dependency graph for Util.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

using Replxx = replxx::Replxx
 

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 &user_data)
 
void hook_color (std::string const &str, Replxx::colors_t &colors, std::vector< std::pair< std::string, Replxx::Color > > const &user_data)
 
Replxx::hints_t hook_hint (std::string const &context, int &contextLen, Replxx::Color &color, std::vector< std::string > const &examples)
 

Detailed Description

replxx utilities

Author
Alexandre Plateau (lexpl.nosp@m.t.de.nosp@m.v@gma.nosp@m.il.c.nosp@m.om)
Version
0.1
Date
2020-10-27

Definition in file Util.hpp.

Typedef Documentation

◆ Replxx

using Replxx = replxx::Replxx

Definition at line 21 of file Util.hpp.

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 &  str,
Replxx::colors_t &  colors,
std::vector< std::pair< std::string, Replxx::Color > > const &  user_data 
)

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 &  user_data 
)

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().