Files
Card-Collection-Manager-3/core/include/ccm/util/FsNames.hpp
T
Sebastian Dine 55ace147bc major: initial release
* initial development

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* pokemon

* pokemon

* pokemon

* pokemon

* pokemon

* pokemon

* improvements

* improvements

* ci/cd

* ci/cd

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

---------

Co-authored-by: sdine <sdine@sdine.com>
2026-05-09 11:05:47 +02:00

25 lines
875 B
C++

#pragma once
// Pure functions for filename munging. Ported from the original `util/fs.rs` so
// that file naming on disk stays identical between the two codebases.
#include <cstdint>
#include <string>
#include <string_view>
namespace ccm {
// Replace problematic characters so the result is safe to use as a filename
// component. Mirrors `format_text_for_fs` in Rust (drops apostrophes/commas,
// strips spaces, replaces `:` with `-`, `&` with `And`, `|` with `Or`,
// flattens accented vowels). Pure; safe at any call site.
std::string formatTextForFs(std::string_view text);
// Parse the trailing 1- or 2-digit numeric index from a filename. Examples:
// "Image1.png" -> 1
// "Image22.jpeg" -> 22
// Returns 0 on parse failure, matching the optimistic Rust behavior.
std::uint8_t parseIndexFromFilename(std::string_view filename) noexcept;
} // namespace ccm