add try_engine
This commit is contained in:
39
src/rrr/content/file/file.cpp
Normal file
39
src/rrr/content/file/file.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "file.hpp"
|
||||
|
||||
namespace rrr
|
||||
{
|
||||
file::file(std::filesystem::path path_, file_type type_, bool is_link_) : id { ++hack::utils::counter<int>::id }, path { path_ }, type { type_ }, is_link { is_link_ } {}
|
||||
|
||||
file::file(file&& f) : id { ++hack::utils::counter<int>::id }, path { std::move(f.path) }, type { std::move(f.type) }, is_link { std::move(f.is_link) }, is_mark { std::move(f.is_mark) } {}
|
||||
|
||||
file::file(const file& f) : id { ++hack::utils::counter<int>::id }, path { f.path }, type { f.type }, is_link { f.is_link }, is_mark { f.is_mark } {}
|
||||
|
||||
file& file::operator=(const file& other)
|
||||
{
|
||||
if (this == &other) return *this;
|
||||
|
||||
path = other.path;
|
||||
type = other.type;
|
||||
is_link = other.is_link;
|
||||
is_mark = other.is_mark;
|
||||
id = ++hack::utils::counter<int>::id ;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool file::operator<(const file& other) const
|
||||
{
|
||||
return path.string().compare(other.path.string()) < 0;
|
||||
}
|
||||
|
||||
bool file::operator==(const file& f) const
|
||||
{
|
||||
if (this->path == f.path)
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const file& f)
|
||||
{
|
||||
return os << f.path << std::endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user