createDefaultBindings Creates the default Chaiscript to C++ bindings.
84 auto module = createModule();
bool openInDefaultApplication(const std::string &path)
openInDefaultApplication Opens the given path in the default application.
Definition: util.cpp:219
std::string getAppDataLocation()
getAppDataLocation Returns a directory location where persistent application data can be stored...
Definition: util.cpp:260
float randomFloatInRange(const float lower, const float upper)
Definition: bindingswrapper.cpp:224
bool fileExists(const std::string &filePath)
fileExists Checks if a file exists, returns true if it does.
Definition: util.cpp:86
void clearGlobalClipboard()
clearGlobalClipboard Clears the global system clipboard contents.
Definition: util.cpp:230
void setTranslatorsForLocale(const QString &locale)
installTranslatorsForLocale Installs translators for the application.
Definition: localization.cpp:75
void printToAllScriptConsoleWidgets(const std::string &str)
printToAllScriptConsoleWidgets A convenience function for printing a string to all the GUI console wi...
Definition: util.cpp:58
std::string getGlobalClipboardText()
getGlobalClipboardText Gets the global system clipboard text.
Definition: util.cpp:235
bool vectorContains(const std::vector< T > &v, const T &t)
Definition: bindingswrapper.h:158
int clampInt(const int value, const int lower, const int upper)
Definition: bindingswrapper.cpp:229
void processApplicationEvents()
processApplicationEvents Processes all pending application events for the calling thread...
Definition: util.cpp:76
std::string getHomeDirectoryLocation()
getHomeDirectoryLocation Returns a path to where the user's home directory is.
Definition: util.cpp:265
int randomIntInRange(const int lower, const int upper)
Definition: bindingswrapper.cpp:219
float clampFloat(const float value, const float lower, const float upper)
Definition: bindingswrapper.cpp:234
std::string getFirstFileWithExtensions(const std::string &dirPath, const std::vector< std::string > &extensions)
getFirstFileWithExtensions Gets the absolute file path to the first file with one of the given extens...
Definition: util.cpp:180
std::string readFileAsString(const std::string &filePath)
readFileAsString Reads a file, returning a string containing the contents.
Definition: util.cpp:111
bool revealInDefaultApplication(const std::string &path)
revealInDefaultApplication Reveals the given path in the parent folder (or path with the filename tri...
Definition: util.cpp:224
bool stringEndsWith(const std::string &str, const std::string &suffix)
stringEndsWith Checks if a string ends with the given suffix.
Definition: util.cpp:250
std::vector< std::string > getSupportedImageFileExtensions()
Definition: bindingswrapper.cpp:135
T randomInVector(const std::vector< T > &v)
Definition: bindingswrapper.h:134
std::vector< std::string > getScriptsForPath(const std::string &dirPath)
getScriptsForPath Gets the absolute file paths to the script files (*.chai) for the given directory...
Definition: util.cpp:192
std::string percentEncode(const std::string &str)
percentEncode Returns a percent-encoded copy of the input string.
Definition: util.cpp:290
std::string getFirstFileWithExtension(const std::string &dirPath, const std::string &extension)
getFirstFileWithExtension Gets the absolute file path to the first file with the given extension in t...
Definition: util.cpp:170
bool directoryExists(const std::string &dirPath)
directoryExists Checks if a directory exists, returns true if it does.
Definition: util.cpp:91
void sleep(const std::size_t ms)
sleep Causes the calling thread to sleep for the given length of time.
Definition: scriptutil.cpp:43
void printToConsole(const std::string &str)
printToConsole A convenience function for printing a string to the command-line console.
Definition: util.cpp:53
void openTask(const std::string &url, const bool addToRecents)
Definition: bindingswrapper.cpp:145
std::vector< std::string > getFilesWithExtension(const std::string &dirPath, const std::string &extension)
getFilesWithExtension Gets the absolute file paths to the files with the given extension in the given...
Definition: util.cpp:159
void messageBox(const std::string &str)
messageBox A convenience function for displaying a message box containing a message.
Definition: util.cpp:69
std::vector< std::string > getFilesWithExtensions(const std::string &, const std::vector< std::string > &)
Definition: bindingswrapper.cpp:119
bool directoryContainsFile(const std::string &dirPath, const std::string &fileName)
directoryContainsFile Checks if the directory contains the given file, returns true if it does...
Definition: util.cpp:96
std::string getApplicationDirectoryLocation()
getApplicationDirectory Get directory that the application is in.
Definition: util.cpp:255
#define COMMA
Definition: bindingshelpers.h:5
#define ADD_FREE_FUN_TEMPLATE(Name, Params)
Definition: bindingshelpers.h:9
bool stringBeginsWith(const std::string &str, const std::string &prefix)
stringBeginsWith Checks if a string begins with the given prefix.
Definition: util.cpp:245
#define ADD_FREE_FUN(Name)
Definition: bindingshelpers.h:8
std::string getApplicationDirectoryPath()
getApplicationDirectoryPath Gets the directory that contains the application executable.
Definition: searchpaths.cpp:16
std::vector< std::string > getFilePathsForDirectory(const std::string &dirPath)
getFilePathsForDirectory Gets the absolute file paths to the files in the given directory.
Definition: util.cpp:122
T clamp(T value, T lower, T upper)
clamp Clamps a value within a range.
Definition: util.h:220
std::vector< std::string > getTemplateSearchPaths()
getTemplateSearchpaths Gets the directory paths that the program will search for project file templat...
Definition: searchpaths.cpp:26
void debugBreak()
debugBreak Forces the debugger to break/halt the application when this is called. ...
Definition: util.cpp:41
std::vector< std::string > getScriptSearchPaths()
getScriptSearchPaths Gets the directory paths that the program will search for scripts. These may include resources (":/resourcedir/"), relative ("../../templates"), or absolute directory paths ("C:/Users/admin/Desktop").
Definition: searchpaths.cpp:21
std::vector< std::string > split(const std::string &s, const char delimiter)
split Splits a given string into a vector of tokens using the given delimiter.
Definition: util.cpp:303
void setGlobalClipboardText(const std::string &text)
setClipboardText Sets the global system clipboard text.
Definition: util.cpp:240
std::string getOperatingSystemProductType()
getOperatingSystemProductType Returns the product name of the operating system this application is ru...
Definition: util.cpp:325
int randomInRange(const int lower, const int upper)
randomInRange Returns a random integer in the range [lower, upper], inclusive. Note that this uses th...
Definition: util.cpp:297
bool writeStringToFile(const std::string &str, const std::string &path)
writeStringToFile Writes the string to the file path, attempting to overwrite any existing file at th...
Definition: util.cpp:270