Syntalos::edl

Syntalos::edl

Syntalos::edl

Classes

Name
structSyntalos::edl::CompactNameOptions

Functions

Name
std::stringcreateRandomString(size_t len)
Create a random alphanumeric string.
toml::date_timetoToml(const EdlDateTime & dt)
Convert an EdlDateTime to a TOML date-time with local UTC offset.
toml::tabletoTomlTable(const std::map< std::string, MetaValue > & attrs)
Convert a MetaValue map to a TOML table.
voidnaturalNumListSort(std::vector< std::string > & list)
Sort a vector of strings, with any numbers sorted numerically / “naturally” for humans.
std::stringguessContentType(const fs::path & filePath, bool onlyCertain =true)
Guess the content type (MIME type) of a file based on its contents or extension.
std::stringmakeCompactName(std::string_view input, const CompactNameOptions & opts ={})
toml::arraymetaArrayToToml(const MetaArray & arr)
constexpr charasciiToLower(char c)
constexpr boolisAsciiWhitespace(char c)
voidreplaceAll(std::string & s, std::string_view from, std::string_view to)
std::size_tutf8BoundedLength(std::string_view s, std::size_t limit)

Functions Documentation

function createRandomString

std::string createRandomString(
    size_t len
)

Create a random alphanumeric string.

function toToml

toml::date_time toToml(
    const EdlDateTime & dt
)

Convert an EdlDateTime to a TOML date-time with local UTC offset.

function toTomlTable

toml::table toTomlTable(
    const std::map< std::string, MetaValue > & attrs
)

Convert a MetaValue map to a TOML table.

function naturalNumListSort

void naturalNumListSort(
    std::vector< std::string > & list
)

Sort a vector of strings, with any numbers sorted numerically / “naturally” for humans.

This sorts text alphabetically, but treats sequences of digits as numbers. For example, “file2” will come before “file10”.

function guessContentType

std::string guessContentType(
    const fs::path & filePath,
    bool onlyCertain =true
)

Guess the content type (MIME type) of a file based on its contents or extension.

Parameters:

  • filePath The path of the file for which the content type is to be determined.
  • onlyCertain If true, the function returns an empty string when the content type guess is uncertain.

Return: The guessed content type as a string, or an empty string if uncertain and onlyCertain is set to true.

This function attempts to determine the content type of a file. If the result is uncertain, it can optionally return an empty string depending on the onlyCertain parameter.

function makeCompactName

std::string makeCompactName(
    std::string_view input,
    const CompactNameOptions & opts ={}
)

Parameters:

  • input The string to simplify (any byte sequence).
  • opts Behavior options; see CompactNameOptions.

Simplify a string into a filesystem-friendly identifier.

Collapses whitespace runs (to CompactNameOptions::wordSeparator or nothing), maps /, \, and : to _, drops characters unwanted in filenames or URLs, replaces . with - and keeps remaining punctuation. Optionally drops non-ASCII bytes and/or ASCII-lowercases. The result is bounded to CompactNameOptions::maxLength, preferring a word boundary when truncating.

function metaArrayToToml

static toml::array metaArrayToToml(
    const MetaArray & arr
)

function asciiToLower

static constexpr char asciiToLower(
    char c
)

function isAsciiWhitespace

static constexpr bool isAsciiWhitespace(
    char c
)

function replaceAll

static void replaceAll(
    std::string & s,
    std::string_view from,
    std::string_view to
)

Replace every non-overlapping occurrence of from with to, in a single pass.

function utf8BoundedLength

static std::size_t utf8BoundedLength(
    std::string_view s,
    std::size_t limit
)

Largest byte length <= limit that does not fall inside a multi-byte UTF-8 sequence, so truncating s to it can never produce invalid UTF-8.


Updated on 2026-06-22 at 03:54:46 +0000