![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
Functions | |
bool | fileExists (const std::string &name) noexcept |
Checks if a file exists. | |
std::string | readFile (const std::string &name) |
Helper to read a file. | |
std::vector< uint8_t > | readFileAsBytes (const std::string &name) |
Helper to read the bytes of a file. | |
std::vector< std::string > | splitString (const std::string &source, const char sep) |
Cut a string into pieces, given a character separator. | |
bool | isDouble (const std::string &s, double *output=nullptr) |
Checks if a string is a valid double. | |
ARK_API std::size_t | levenshteinDistance (const std::string &str1, const std::string &str2) |
Calculate the Levenshtein distance between two strings. | |
|
inlinenoexcept |
Checks if a file exists.
name | the file name |
Definition at line 29 of file Files.hpp.
Referenced by Ark::State::doFile(), Ark::State::feed(), and Ark::VM::loadPlugin().
|
inline |
Checks if a string is a valid double.
s | the string |
output | optional pointer to the output to avoid 2 conversions |
Definition at line 56 of file Utils.hpp.
Referenced by Ark::VM::safeRun().
std::size_t Ark::Utils::levenshteinDistance | ( | const std::string & | str1, |
const std::string & | str2 ) |
Calculate the Levenshtein distance between two strings.
str1 | |
str2 |
Definition at line 5 of file Utils.cpp.
Referenced by Ark::internal::NameResolutionPass::offerSuggestion().
|
inline |
Helper to read a file.
name | the file name |
Definition at line 48 of file Files.hpp.
Referenced by Ark::Welder::computeASTFromFile(), Ark::Diagnostics::generate(), Ark::Diagnostics::makeContextWithNode(), Ark::internal::ImportSolver::parseImport(), and Formatter::run().
|
inline |
Helper to read the bytes of a file.
name | filename |
Definition at line 63 of file Files.hpp.
Referenced by Ark::State::doFile(), and Ark::State::feed().
|
inline |
Cut a string into pieces, given a character separator.
source | |
sep |
Definition at line 32 of file Utils.hpp.
Referenced by Ark::Diagnostics::helper(), Ark::Diagnostics::makeContext(), and Ark::internal::NameResolutionPass::mayBeFromPlugin().