15#include "../utils/utils.h"
61 static void createDir(
const std::string& entity_name);
73 static void renameDir(
const std::string& old_entity_name,
const std::string& new_entity_name);
80 static void deleteDir(
const std::string& entity_name);
93 static std::string
dirPath(
const std::string& entity_name,
bool create_if_missing =
false);
106 static std::string
filePath(
const std::string& entity_name,
const std::string& filename);
119 static std::optional<std::string>
getFilePath(
const std::string& entity_name,
const std::string& filename);
128 static bool removeFile(
const std::string& entity_name,
const std::string& filename);
136 static void removeFiles(
const std::string& entity_name,
const std::vector<std::string>& files);
145 static bool fileExists(
const std::string& entity_name,
const std::string& filename);
File management for entity file assets.
Definition files.h:50
static bool isCanonicalPath(const fs::path &path)
Check if a path is canonical and within the files base directory.
Definition files.cpp:198
static void removeFiles(const std::string &entity_name, const std::vector< std::string > &files)
Remove multiple files from an entity's directory.
Definition files.cpp:136
static void createDir(const std::string &entity_name)
Create a directory for the given entity.
Definition files.cpp:16
static bool removeFile(const std::string &entity_name, const std::string &filename)
Remove a file from an entity's directory.
Definition files.cpp:119
static std::optional< std::string > getFilePath(const std::string &entity_name, const std::string &filename)
Get file path only if the file exists.
Definition files.cpp:63
static std::string dirPath(const std::string &entity_name, bool create_if_missing=false)
Get the directory path for an entity.
Definition files.cpp:77
static fs::path getCanonicalPath(const fs::path &path)
Get canonical path and verify it's within the files base directory.
Definition files.cpp:153
static bool fileExists(const std::string &entity_name, const std::string &filename)
Check if a file exists in an entity's directory.
Definition files.cpp:143
static std::string filePath(const std::string &entity_name, const std::string &filename)
Get the absolute file path for an entity and filename.
Definition files.cpp:103
static void renameDir(const std::string &old_entity_name, const std::string &new_entity_name)
Rename an entity directory.
Definition files.cpp:33
static fs::path filesBaseDir()
Get the base directory for all entity files.
Definition files.cpp:241
static void deleteDir(const std::string &entity_name)
Delete an entity directory and all its contents.
Definition files.cpp:57
router.h
Definition auth.h:15