Base Framework
Public Types | Public Member Functions | List of all members
FolderInfo Class Reference

Folder information. More...

#include <base/filesystem/FolderInfo.h>

Inherits Object.

Public Types

enum  Sticky { SET_UID = 0x4000, SET_GID = 0x2000, RESTRICT = 0x1000, STICKY_MASK = SET_UID|SET_GID|RESTRICT }
 
enum  Permissions {
  RUSR = 0x400, WUSR = 0x200, XUSR = 0x100, RWXU = RUSR|WUSR|XUSR,
  RGRP = 0x40, WGRP = 0x20, XGRP = 0x10, RWXG = RGRP|WGRP|XGRP,
  ROTH = 0x4, WOTH = 0x2, XOTH = 0x1, RWXO = ROTH|WOTH|XOTH,
  PERMISSION_MASK = RWXU|RWXG|RWXO
}
 

Public Member Functions

 FolderInfo (const String &path)
 
FolderInfo getParent () const
 
Array< StringgetEntries () const
 
const UsergetOwner () const noexcept
 
const GroupgetGroup () const noexcept
 
unsigned int getMode () const noexcept
 
unsigned int getLinks () const noexcept
 
const DategetLastModification () const noexcept
 
const DategetLastAccess () const noexcept
 
const DategetLastChange () const noexcept
 
const StringgetPath () const noexcept
 

Detailed Description

Folder information.

Folder information wrapper class.

Version
1.2
Examples
testsuite/digest.cpp, testsuite/du.cpp, testsuite/ls.cpp, and testsuite/rm.cpp.

Member Enumeration Documentation

◆ Permissions

Permissions.

Enumerator
RUSR 

Read permission for the owner of the file.

WUSR 

Write permission for the owner of the file.

XUSR 

Execute permission for the owner of the file.

RWXU 

Read, write, and execute permissions for the owner of the file.

RGRP 

Read permission for the group associated with the file.

WGRP 

Write permission for the group associated with the file.

XGRP 

Execute permission for the group associated with the file.

RWXG 

Read, write, and execute permissions for the group associated with the file.

ROTH 

Read permission for other users.

WOTH 

Write permission for other users.

XOTH 

Execute permission for other users.

RWXO 

Read, write, and execute permissions for other users.

PERMISSION_MASK 

Any access.

◆ Sticky

Sticky bit.

Enumerator
SET_UID 

Set user id on execution.

SET_GID 

Set group id on execution.

RESTRICT 

Restrict flag.

STICKY_MASK 

All sticky bits.

Constructor & Destructor Documentation

◆ FolderInfo()

FolderInfo::FolderInfo ( const String path)

Initializes a folder.

Parameters
paththe path of the folder.

Member Function Documentation

◆ getEntries()

Array<String> FolderInfo::getEntries ( ) const

Returns the names of the entries (files and subfolders) of this folder.

Examples
testsuite/digest.cpp, testsuite/du.cpp, testsuite/ls.cpp, and testsuite/rm.cpp.

◆ getGroup()

const Group& FolderInfo::getGroup ( ) const
inlinenoexcept

Returns the group of the folder.

Examples
testsuite/ls.cpp.

◆ getLastAccess()

const Date& FolderInfo::getLastAccess ( ) const
inlinenoexcept

Returns the last access time of the folder.

◆ getLastChange()

const Date& FolderInfo::getLastChange ( ) const
inlinenoexcept

Returns the last chnage time of the folder.

◆ getLastModification()

const Date& FolderInfo::getLastModification ( ) const
inlinenoexcept

Returns the last modification time of the folder.

Examples
testsuite/ls.cpp.

◆ getLinks()

unsigned int FolderInfo::getLinks ( ) const
inlinenoexcept

Returns the number of links to the folder.

Returns
0 is not supported.
Examples
testsuite/ls.cpp.

◆ getMode()

unsigned int FolderInfo::getMode ( ) const
inlinenoexcept

Returns the mode of the folder.

Returns
The maximum possible value if mode isn't supported.
Examples
testsuite/ls.cpp.

◆ getOwner()

const User& FolderInfo::getOwner ( ) const
inlinenoexcept

Returns the owner of the folder.

Examples
testsuite/ls.cpp.

◆ getParent()

FolderInfo FolderInfo::getParent ( ) const

Returns a folder object for the parent folder.

◆ getPath()

const String& FolderInfo::getPath ( ) const
inlinenoexcept

Returns the path of the folder.