mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Fix operators for vfspath
This commit is contained in:
@@ -123,32 +123,32 @@ namespace Tesses::Framework::Date
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DateTime operator+(const DateTime& dt, const TimeSpan& ts)
|
inline DateTime operator+(const DateTime& dt, const TimeSpan& ts)
|
||||||
{
|
{
|
||||||
DateTime dt2(dt.ToEpoch() + ts.TotalSeconds());
|
DateTime dt2(dt.ToEpoch() + ts.TotalSeconds());
|
||||||
if(dt.IsLocal())
|
if(dt.IsLocal())
|
||||||
dt2.SetToLocal();
|
dt2.SetToLocal();
|
||||||
return dt2;
|
return dt2;
|
||||||
}
|
}
|
||||||
DateTime operator+(const TimeSpan& ts,const DateTime& dt)
|
inline DateTime operator+(const TimeSpan& ts,const DateTime& dt)
|
||||||
{
|
{
|
||||||
DateTime dt2(dt.ToEpoch() + ts.TotalSeconds());
|
DateTime dt2(dt.ToEpoch() + ts.TotalSeconds());
|
||||||
if(dt.IsLocal())
|
if(dt.IsLocal())
|
||||||
dt2.SetToLocal();
|
dt2.SetToLocal();
|
||||||
return dt2;
|
return dt2;
|
||||||
}
|
}
|
||||||
TimeSpan operator+(const TimeSpan& ts, const TimeSpan& ts2)
|
inline TimeSpan operator+(const TimeSpan& ts, const TimeSpan& ts2)
|
||||||
{
|
{
|
||||||
return (int64_t)ts + (int64_t)ts2;
|
return (int64_t)ts + (int64_t)ts2;
|
||||||
}
|
}
|
||||||
DateTime operator-(const DateTime& dt, const TimeSpan& ts)
|
inline DateTime operator-(const DateTime& dt, const TimeSpan& ts)
|
||||||
{
|
{
|
||||||
DateTime dt2(dt.ToEpoch() - ts.TotalSeconds());
|
DateTime dt2(dt.ToEpoch() - ts.TotalSeconds());
|
||||||
if(dt.IsLocal())
|
if(dt.IsLocal())
|
||||||
dt2.SetToLocal();
|
dt2.SetToLocal();
|
||||||
return dt2;
|
return dt2;
|
||||||
}
|
}
|
||||||
TimeSpan operator-(const DateTime& dt, const DateTime& dt2)
|
inline TimeSpan operator-(const DateTime& dt, const DateTime& dt2)
|
||||||
{
|
{
|
||||||
return (int64_t)dt - (int64_t)dt2;
|
return (int64_t)dt - (int64_t)dt2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,17 +61,9 @@ namespace Tesses::Framework::Filesystem
|
|||||||
VFSPath MakeRelative(VFSPath toMakeRelativeTo) const;
|
VFSPath MakeRelative(VFSPath toMakeRelativeTo) const;
|
||||||
};
|
};
|
||||||
VFSPath operator/(VFSPath p, VFSPath p2);
|
VFSPath operator/(VFSPath p, VFSPath p2);
|
||||||
VFSPath operator/(VFSPath p, std::string p2);
|
|
||||||
VFSPath operator/(std::string p, VFSPath p2);
|
|
||||||
VFSPath operator+(VFSPath p, VFSPath p2);
|
VFSPath operator+(VFSPath p, VFSPath p2);
|
||||||
VFSPath operator+(VFSPath p, std::string p2);
|
|
||||||
VFSPath operator+(std::string p, VFSPath p2);
|
|
||||||
bool operator==(VFSPath p,VFSPath p2);
|
bool operator==(VFSPath p,VFSPath p2);
|
||||||
bool operator!=(VFSPath p,VFSPath p2);
|
bool operator!=(VFSPath p,VFSPath p2);
|
||||||
bool operator==(std::string p,VFSPath p2);
|
|
||||||
bool operator!=(std::string p,VFSPath p2);
|
|
||||||
bool operator==(VFSPath p,std::string p2);
|
|
||||||
bool operator!=(VFSPath p,std::string p2);
|
|
||||||
class VFSPathEnumeratorData {
|
class VFSPathEnumeratorData {
|
||||||
public:
|
public:
|
||||||
VFSPathEnumeratorData(std::function<bool(VFSPath&)> moveNext, std::function<void()> destroy)
|
VFSPathEnumeratorData(std::function<bool(VFSPath&)> moveNext, std::function<void()> destroy)
|
||||||
|
|||||||
@@ -111,14 +111,7 @@ namespace Tesses::Framework::Filesystem
|
|||||||
{
|
{
|
||||||
return VFSPath(p,p2);
|
return VFSPath(p,p2);
|
||||||
}
|
}
|
||||||
VFSPath operator/(VFSPath p, std::string p2)
|
|
||||||
{
|
|
||||||
return VFSPath(p,p2);
|
|
||||||
}
|
|
||||||
VFSPath operator/(std::string p, VFSPath p2)
|
|
||||||
{
|
|
||||||
return VFSPath(p,p2);
|
|
||||||
}
|
|
||||||
VFSPath operator+(VFSPath p, VFSPath p2)
|
VFSPath operator+(VFSPath p, VFSPath p2)
|
||||||
{
|
{
|
||||||
VFSPath pout;
|
VFSPath pout;
|
||||||
@@ -146,14 +139,7 @@ namespace Tesses::Framework::Filesystem
|
|||||||
|
|
||||||
return pout;
|
return pout;
|
||||||
}
|
}
|
||||||
VFSPath operator+(VFSPath p, std::string p2)
|
|
||||||
{
|
|
||||||
return p + VFSPath(p2);
|
|
||||||
}
|
|
||||||
VFSPath operator+(std::string p, VFSPath p2)
|
|
||||||
{
|
|
||||||
return VFSPath(p) + p2;
|
|
||||||
}
|
|
||||||
bool operator==(VFSPath p,VFSPath p2)
|
bool operator==(VFSPath p,VFSPath p2)
|
||||||
{
|
{
|
||||||
if(p.relative != p2.relative) return false;
|
if(p.relative != p2.relative) return false;
|
||||||
@@ -171,22 +157,6 @@ namespace Tesses::Framework::Filesystem
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
bool operator==(std::string p,VFSPath p2)
|
|
||||||
{
|
|
||||||
return VFSPath(p) == p2;
|
|
||||||
}
|
|
||||||
bool operator!=(std::string p,VFSPath p2)
|
|
||||||
{
|
|
||||||
return VFSPath(p) != p2;
|
|
||||||
}
|
|
||||||
bool operator==(VFSPath p,std::string p2)
|
|
||||||
{
|
|
||||||
return p == VFSPath(p2);
|
|
||||||
}
|
|
||||||
bool operator!=(VFSPath p,std::string p2)
|
|
||||||
{
|
|
||||||
return p != VFSPath(p2);
|
|
||||||
}
|
|
||||||
VFSPath VFS::ReadLink(VFSPath path)
|
VFSPath VFS::ReadLink(VFSPath path)
|
||||||
{
|
{
|
||||||
return VFSPath("/");
|
return VFSPath("/");
|
||||||
|
|||||||
Reference in New Issue
Block a user