OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::make_tmpfile_fn Struct Reference

Function object to create a unique temporary file path with a specified extension. More...

#include <tmpfile.hpp>

Public Member Functions

auto operator() (std::string const &extension="tmp") const
 Generates a unique temporary file path with a specified extension.

Detailed Description

Function object to create a unique temporary file path with a specified extension.

This functor generates a unique temporary file path in the system's temporary directory with the specified extension. It uses a UUID to ensure uniqueness and returns a unique_ptr managing the temporary file path. The temporary file will be automatically removed when the unique_ptr goes out of scope.

Member Function Documentation

◆ operator()()

auto oxy::make_tmpfile_fn::operator() ( std::string const & extension = "tmp") const
inline

Generates a unique temporary file path with a specified extension.

Parameters
extensionThe file extension to use for the temporary file. Defaults to "tmp".
Returns
A unique file path in the system's temporary directory with a UUID-based filename and the specified extension.

References oxy::make_unique_path(), oxy::make_uuid(), and oxy::to_string().