mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 08:14:34 +00:00
28 lines
505 B
C++
28 lines
505 B
C++
#ifndef __TRACYFILESYSTEM_HPP__
|
|
#define __TRACYFILESYSTEM_HPP__
|
|
|
|
#include <sys/stat.h>
|
|
|
|
namespace tracy
|
|
{
|
|
|
|
static inline bool FileExists( const char* fn )
|
|
{
|
|
struct stat buf;
|
|
return stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0;
|
|
}
|
|
|
|
static inline bool SourceFileValid( const char* fn, uint64_t olderThan )
|
|
{
|
|
struct stat buf;
|
|
if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
|
|
{
|
|
return (uint64_t)buf.st_mtime < olderThan;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|