fs/scoped: move indirection methods to parent classes

This commit is contained in:
Danny Robson 2022-08-25 15:26:24 +10:00
parent 52e9309949
commit cb802824df
2 changed files with 19 additions and 19 deletions

View File

@ -28,6 +28,22 @@ scoped_path::scoped_path (std::filesystem::path const &_path)
{ ; }
//-----------------------------------------------------------------------------
std::filesystem::path const &
scoped_path::operator* () const &
{
return get ();
}
//-----------------------------------------------------------------------------
std::filesystem::path const*
scoped_path::operator-> () const &
{
return &get();
}
//-----------------------------------------------------------------------------
std::filesystem::path const&
scoped_path::get () const&
@ -74,19 +90,3 @@ scoped_dir::scoped_dir (std::filesystem::path &&_path)
{
CHECK (std::filesystem::is_directory (get ()));
}
//-----------------------------------------------------------------------------
std::filesystem::path const &
scoped_dir::operator* () const &
{
return get ();
}
//-----------------------------------------------------------------------------
std::filesystem::path const*
scoped_dir::operator-> () const &
{
return &get();
}

View File

@ -27,6 +27,9 @@ namespace cruft::fs {
~scoped_path ();
std::filesystem::path const& operator* (void) const&;
std::filesystem::path const* operator-> (void) const&;
std::filesystem::path const& get (void) const&;
std::filesystem::path release (void);
@ -46,8 +49,5 @@ namespace cruft::fs {
explicit scoped_dir (std::filesystem::path &&);
using scoped_path::scoped_path;
std::filesystem::path const& operator* () const&;
std::filesystem::path const* operator-> () const&;
};
}