Layers 2.0 is archived. The latest version is 3.0. Read the 3.0 docs

lalgorithms.h Header

#include <Layers/lalgorithms.h>

Functions

T split(const LString & s, char delimiter)
std::string remove_whitespace(const std::string & str)
std::string load_json_file(const std::filesystem::path & path)

Function Documentation

template<typename T>
T split(const LString & s, char delimiter)

Splits a string into tokens based on a delimiter.

The template parameter T should be a container type (e.g., std::vector). Returns a container of LString tokens.

std::string remove_whitespace(const std::string & str)

Removes whitespace (spaces, newlines, carriage returns) from a string, preserving whitespace within quoted sections.

Returns a new string with whitespace removed.

std::string load_json_file(const std::filesystem::path & path)

Loads a JSON file from disk and returns its contents with whitespace removed.

Returns the file contents as a string, or an empty string if the file cannot be opened.

Appearance
Theme
—