#ifndef FILE_UTILS_H #define FILE_UTILS_H #include #include // File utility functions class FileUtils { public: // Read entire file content static std::string readFile(const std::string& filepath); // Write content to file static bool writeFile(const std::string& filepath, const std::string& content); // Check if file exists static bool fileExists(const std::string& filepath); // Create directory if it doesn't exist (recursive) static bool createDirectory(const std::string& dirpath); // Delete all files in a directory static bool cleanDirectory(const std::string& dirpath); // Join paths with proper separators static std::string joinPath(const std::string& path1, const std::string& path2); // Get files in directory matching pattern static std::vector listFiles(const std::string& dirpath, const std::string& extension = ""); // Replace all occurrences in string static std::string replaceAll(const std::string& str, const std::string& from, const std::string& to); // Trim whitespace from string static std::string trim(const std::string& str); // Split string by delimiter static std::vector split(const std::string& str, char delimiter); }; #endif