Skip to content

Commit

Permalink
Create path class
Browse files Browse the repository at this point in the history
  • Loading branch information
bugdea1er committed Jan 27, 2024
1 parent 535ee62 commit d4654da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/tmp/directory.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <tmp/path.hpp>

#include <filesystem>
#include <string_view>
#include <system_error>
Expand Down Expand Up @@ -37,7 +39,7 @@ namespace tmp {
/// directory with the product identifier prefix. When the function returns,
/// the tmp::directory object goes out of scope and the temporary directory is
/// deleted along with all of its contents.
class directory {
class directory final : public path {
std::filesystem::path p; ///< This directory path

/// Deletes this directory recursively
Expand Down
4 changes: 3 additions & 1 deletion include/tmp/file.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <tmp/path.hpp>

#include <filesystem>
#include <fstream>
#include <string_view>
Expand Down Expand Up @@ -45,7 +47,7 @@ namespace tmp {
/// The above example uses a tmp::file object to create a temporary file with
/// the product identifier prefix. When the function returns, the tmp::file
/// object goes out of scope and the temporary file is deleted.
class file {
class file final : public path {
public:
/// Creates a unique temporary binary file using the system's default
/// location for temporary files. If a prefix is provided to the
Expand Down
5 changes: 5 additions & 0 deletions include/tmp/path.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

class path {

};

0 comments on commit d4654da

Please sign in to comment.