Skip to content

Commit

Permalink
Document the introduced structs
Browse files Browse the repository at this point in the history
  • Loading branch information
dr8co committed Nov 18, 2023
1 parent 1d647ef commit ea7d1db
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/fileShredder/shredFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ inline void renameAndRemove(const std::string &filename, int numTimes = 1) {
if (ec) std::cerr << "Failed to delete " << filename << ": " << ec.message() << '\n';
}

/// \struct FileDescriptor
/// \brief Represents a file descriptor.
///
/// The FileDescriptor class provides a convenient way to manage a file descriptor. It automatically opens the file
/// with the specified filename upon initialization, and closes the file when the object is destroyed. If the file
/// open operation fails, a runtime_error exception is thrown.
struct FileDescriptor {
int fd{-1};

Expand All @@ -163,6 +169,12 @@ struct FileDescriptor {
}
};

/// \struct FileStatInfo
/// \brief Provides information about a file based on its file descriptor.
///
/// The FileStatInfo struct encapsulates the information obtained from the stat function
/// for a given file descriptor. It provides a simple way to access file attributes such as
/// file size, permissions, and timestamps.
struct FileStatInfo {
struct stat fileStat{};

Expand Down

0 comments on commit ea7d1db

Please sign in to comment.