MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / get_slice_filename

Function get_slice_filename

Source/astcenccli_toplevel.cpp:311–328  ·  view source on GitHub ↗

* @brief Utility to generate a slice file name from a pattern. * * Convert "foo/bar.png" into "foo/bar_ .png" * * @param basename The base pattern; must contain a file extension. * @param index The slice index. * @param error Set to false on success, true on error (no extension found). * * @return The slice file name. */

Source from the content-addressed store, hash-verified

309 * @return The slice file name.
310 */
311static std::string get_slice_filename(
312 const std::string& basename,
313 unsigned int index,
314 bool& error
315) {
316 size_t sep = basename.find_last_of('.');
317 if (sep == std::string::npos)
318 {
319 error = true;
320 return "";
321 }
322
323 std::string base = basename.substr(0, sep);
324 std::string ext = basename.substr(sep);
325 std::string name = base + "_" + std::to_string(index) + ext;
326 error = false;
327 return name;
328}
329
330/**
331 * @brief Load a non-astc image file from memory.

Callers 1

load_uncomp_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected