datactl/edlutils.h
datactl/edlutils.h
Namespaces
| Name |
|---|
| Syntalos |
| Syntalos::edl |
Classes
| Name | |
|---|---|
| struct | Syntalos::edl::CompactNameOptions |
Source code
/*
* Copyright (C) 2026 Matthias Klumpp <matthias@tenstral.net>
*
* Licensed under the GNU Lesser General Public License Version 3
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the license, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
// Private helper utilities for the datactl EDL implementation.
// Not part of the public API.
#pragma once
#include <cstddef>
#include <map>
#include <ostream>
#include <string>
#include <string_view>
#include <vector>
#include <filesystem>
#include <toml++/toml.h>
#include "streammeta.h"
// EdlDateTime is defined in edlstorage.h, but we only need the underlying type here.
// We declare it manually to avoid a circular include.
#include <chrono>
namespace Syntalos
{
using EdlDateTime = std::chrono::zoned_time<std::chrono::system_clock::duration>;
}
namespace Syntalos::edl
{
namespace fs = std::filesystem;
std::string createRandomString(size_t len);
toml::date_time toToml(const EdlDateTime &dt);
toml::table toTomlTable(const std::map<std::string, MetaValue> &attrs);
void naturalNumListSort(std::vector<std::string> &list);
std::string guessContentType(const fs::path &filePath, bool onlyCertain = true);
struct CompactNameOptions {
std::size_t maxLength = 80;
std::string_view fallback = "unnamed";
bool lowercase = false;
bool asciiOnly = false;
char wordSeparator = '-';
};
[[nodiscard]] std::string makeCompactName(std::string_view input, const CompactNameOptions &opts = {});
} // namespace Syntalos::edl
Updated on 2026-06-22 at 03:54:47 +0000