newspeoplefor developersdocumentationdownloads

_nfiletime_posix.h

Go to the documentation of this file.
00001 #ifndef N_FILETIMEPOSIX_H
00002 #define N_FILETIMEPOSIX_H
00003 //------------------------------------------------------------------------------
00013 #include "kernel/ntypes.h"
00014 
00015 #if !defined(__LINUX__) && !defined(__MACOSX__)
00016 #error "_nFileTimePosix: trying to compile POSIX class on hostile platform"
00017 #endif
00018 
00019 #include <time.h>
00020 
00021 //------------------------------------------------------------------------------
00022 class _nFileTimePosix
00023 {
00024 public:
00026     _nFileTimePosix();
00028     friend bool operator ==(const _nFileTimePosix& a, const _nFileTimePosix& b);
00030     friend bool operator !=(const _nFileTimePosix& a, const _nFileTimePosix& b);
00032     friend bool operator >(const _nFileTimePosix& a, const _nFileTimePosix& b);
00034     friend bool operator <(const _nFileTimePosix& a, const _nFileTimePosix& b);
00035 
00036 private:
00037     friend class nFile;
00038     time_t time;
00039 };
00040 
00041 //------------------------------------------------------------------------------
00044 inline
00045 _nFileTimePosix::_nFileTimePosix()
00046 {
00047     time = 0;
00048 }
00049 
00050 //------------------------------------------------------------------------------
00053 inline
00054 bool
00055 operator ==(const _nFileTimePosix& a, const _nFileTimePosix& b)
00056 {
00057     return (a.time == b.time);
00058 }
00059 
00060 //------------------------------------------------------------------------------
00063 inline
00064 bool
00065 operator !=(const _nFileTimePosix& a, const _nFileTimePosix& b)
00066 {
00067     return (a.time != b.time);
00068 }
00069 
00070 //------------------------------------------------------------------------------
00073 inline
00074 bool
00075 operator >(const _nFileTimePosix& a, const _nFileTimePosix& b)
00076 {
00077     return (a.time > b.time);
00078 }
00079 
00080 //------------------------------------------------------------------------------
00083 inline
00084 bool
00085 operator <(const _nFileTimePosix& a, const _nFileTimePosix& b)
00086 {
00087     return (a.time < b.time);
00088 }
00089 
00090 //------------------------------------------------------------------------------
00091 #endif
00092 

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.