LLVM 20.0.0git
Public Member Functions | Protected Attributes | List of all members
llvm::sys::fs::basic_file_status Class Reference

Represents the result of a call to directory_iterator::status(). More...

#include "llvm/Support/FileSystem.h"

Inheritance diagram for llvm::sys::fs::basic_file_status:
Inheritance graph
[legend]

Public Member Functions

 basic_file_status ()=default
 
 basic_file_status (file_type Type)
 
 basic_file_status (file_type Type, perms Perms, time_t ATime, uint32_t ATimeNSec, time_t MTime, uint32_t MTimeNSec, uid_t UID, gid_t GID, off_t Size)
 
file_type type () const
 
perms permissions () const
 
TimePoint getLastAccessedTime () const
 The file access time as reported from the underlying file system.
 
TimePoint getLastModificationTime () const
 The file modification time as reported from the underlying file system.
 
uint32_t getUser () const
 
uint32_t getGroup () const
 
uint64_t getSize () const
 
void type (file_type v)
 
void permissions (perms p)
 

Protected Attributes

time_t fs_st_atime = 0
 
time_t fs_st_mtime = 0
 
uint32_t fs_st_atime_nsec = 0
 
uint32_t fs_st_mtime_nsec = 0
 
uid_t fs_st_uid = 0
 
gid_t fs_st_gid = 0
 
off_t fs_st_size = 0
 
file_type Type = file_type::status_error
 
perms Perms = perms_not_known
 

Detailed Description

Represents the result of a call to directory_iterator::status().

This is a subset of the information returned by a regular sys::fs::status() call, and represents the information provided by Windows FileFirstFile/FindNextFile.

Definition at line 136 of file FileSystem.h.

Constructor & Destructor Documentation

◆ basic_file_status() [1/3]

llvm::sys::fs::basic_file_status::basic_file_status ( )
default

◆ basic_file_status() [2/3]

llvm::sys::fs::basic_file_status::basic_file_status ( file_type  Type)
inlineexplicit

Definition at line 160 of file FileSystem.h.

◆ basic_file_status() [3/3]

llvm::sys::fs::basic_file_status::basic_file_status ( file_type  Type,
perms  Perms,
time_t  ATime,
uint32_t  ATimeNSec,
time_t  MTime,
uint32_t  MTimeNSec,
uid_t  UID,
gid_t  GID,
off_t  Size 
)
inline

Definition at line 163 of file FileSystem.h.

Member Function Documentation

◆ getGroup()

uint32_t llvm::sys::fs::basic_file_status::getGroup ( ) const
inline

Definition at line 203 of file FileSystem.h.

References fs_st_gid.

◆ getLastAccessedTime()

TimePoint llvm::sys::fs::basic_file_status::getLastAccessedTime ( ) const

The file access time as reported from the underlying file system.

Also see comments on getLastModificationTime() related to the precision of the returned value.

◆ getLastModificationTime()

TimePoint llvm::sys::fs::basic_file_status::getLastModificationTime ( ) const

The file modification time as reported from the underlying file system.

The returned value allows for nanosecond precision but the actual resolution is an implementation detail of the underlying file system. There is no guarantee for what kind of resolution you can expect, the resolution can differ across platforms and even across mountpoints on the same machine.

Referenced by llvm::pruneCache().

◆ getSize()

uint64_t llvm::sys::fs::basic_file_status::getSize ( ) const
inline

Definition at line 204 of file FileSystem.h.

References fs_st_size.

◆ getUser()

uint32_t llvm::sys::fs::basic_file_status::getUser ( ) const
inline

Definition at line 202 of file FileSystem.h.

References fs_st_uid.

Referenced by llvm::FilePermissionsApplier::apply().

◆ permissions() [1/2]

perms llvm::sys::fs::basic_file_status::permissions ( ) const
inline

Definition at line 184 of file FileSystem.h.

References Perms.

◆ permissions() [2/2]

void llvm::sys::fs::basic_file_status::permissions ( perms  p)
inline

Definition at line 221 of file FileSystem.h.

References Perms.

◆ type() [1/2]

file_type llvm::sys::fs::basic_file_status::type ( ) const
inline

◆ type() [2/2]

void llvm::sys::fs::basic_file_status::type ( file_type  v)
inline

Definition at line 220 of file FileSystem.h.

Member Data Documentation

◆ fs_st_atime

time_t llvm::sys::fs::basic_file_status::fs_st_atime = 0
protected

Definition at line 139 of file FileSystem.h.

◆ fs_st_atime_nsec

uint32_t llvm::sys::fs::basic_file_status::fs_st_atime_nsec = 0
protected

Definition at line 141 of file FileSystem.h.

◆ fs_st_gid

gid_t llvm::sys::fs::basic_file_status::fs_st_gid = 0
protected

Definition at line 144 of file FileSystem.h.

Referenced by getGroup().

◆ fs_st_mtime

time_t llvm::sys::fs::basic_file_status::fs_st_mtime = 0
protected

Definition at line 140 of file FileSystem.h.

◆ fs_st_mtime_nsec

uint32_t llvm::sys::fs::basic_file_status::fs_st_mtime_nsec = 0
protected

Definition at line 142 of file FileSystem.h.

◆ fs_st_size

off_t llvm::sys::fs::basic_file_status::fs_st_size = 0
protected

Definition at line 145 of file FileSystem.h.

Referenced by getSize().

◆ fs_st_uid

uid_t llvm::sys::fs::basic_file_status::fs_st_uid = 0
protected

Definition at line 143 of file FileSystem.h.

Referenced by getUser().

◆ Perms

perms llvm::sys::fs::basic_file_status::Perms = perms_not_known
protected

Definition at line 155 of file FileSystem.h.

Referenced by permissions().

◆ Type

file_type llvm::sys::fs::basic_file_status::Type = file_type::status_error
protected

Definition at line 154 of file FileSystem.h.

Referenced by type().


The documentation for this class was generated from the following file: