plptools
Loading...
Searching...
No Matches
PlpDirent Class Reference

A class, representing a directory entry of the Psion. More...

#include <plpdirent.h>

Collaboration diagram for PlpDirent:

Public Member Functions

 PlpDirent ()
 Default constructor. More...
 
 PlpDirent (const PlpDirent &e)=default
 A copy constructor. More...
 
 PlpDirent (const uint32_t size, const uint32_t attr, const uint32_t tHi, const uint32_t tLo, const std::string &dirname, const char *const name)
 Initializing Constructor. More...
 
 ~PlpDirent ()
 Default destructor. More...
 
uint32_t getSize () const
 Retrieves the file size of a directory entry. More...
 
uint32_t getAttr () const
 Retrieves the file attributes of a directory entry. More...
 
bool isDirectory () const
 Determine if the directory entry represents a directory. More...
 
uint32_t getUID (int uididx)
 Retrieves the UIDs of a directory entry. More...
 
PlpUIDgetUID ()
 Retrieves the PlpUID object of a directory entry. More...
 
std::string getPath () const
 
const char * getName () const
 Retrieve the file name of a directory entry. More...
 
PsiTime getPsiTime ()
 Retrieve the modification time of a directory entry. More...
 
void setName (const char *str)
 Set the file name of a directory entry. More...
 
PlpDirentoperator= (const PlpDirent &e)=default
 Assignment operator Mainly used by STL container classes. More...
 

Private Attributes

uint32_t size
 
uint32_t attr
 
PlpUID UID
 
PsiTime time
 
std::string attrstr
 
std::string dirname_
 
std::string name
 

Friends

class RFSV32
 
class RFSV16
 
std::ostreamoperator<< (std::ostream &o, const PlpDirent &e)
 Prints the object contents. More...
 

Detailed Description

A class, representing a directory entry of the Psion.

Objects of this type are used by RFSV::readdir , RFSV::dir and RFSV::fgeteattr for returning the entries of a directory.

Author
Fritz Elfert felfe.nosp@m.rt@t.nosp@m.o.com

Definition at line 79 of file plpdirent.h.

Constructor & Destructor Documentation

◆ PlpDirent() [1/3]

PlpDirent::PlpDirent ( )

Default constructor.

Definition at line 46 of file plpdirent.cc.

◆ PlpDirent() [2/3]

PlpDirent::PlpDirent ( const PlpDirent e)
default

A copy constructor.

Mainly used by STL container classes.

Parameters
eThe object to be used as initializer.

◆ PlpDirent() [3/3]

PlpDirent::PlpDirent ( const uint32_t  size,
const uint32_t  attr,
const uint32_t  tHi,
const uint32_t  tLo,
const std::string &  dirname,
const char *const  name 
)

Initializing Constructor.

Definition at line 56 of file plpdirent.cc.

◆ ~PlpDirent()

PlpDirent::~PlpDirent ( )
inline

Default destructor.

Definition at line 110 of file plpdirent.h.

Member Function Documentation

◆ getAttr()

uint32_t PlpDirent::getAttr ( ) const

Retrieves the file attributes of a directory entry.

Returns
The generic attributes ( RFSV::file_attribs ).

Definition at line 75 of file plpdirent.cc.

◆ getName()

const char * PlpDirent::getName ( ) const

Retrieve the file name of a directory entry.

Returns
The name of the file.

Definition at line 102 of file plpdirent.cc.

◆ getPath()

std::string PlpDirent::getPath ( ) const

Definition at line 93 of file plpdirent.cc.

◆ getPsiTime()

PsiTime PlpDirent::getPsiTime ( )

Retrieve the modification time of a directory entry.

Returns
A PsiTime object, representing the time.

Definition at line 106 of file plpdirent.cc.

◆ getSize()

uint32_t PlpDirent::getSize ( ) const

Retrieves the file size of a directory entry.

Returns
The file size in bytes.

Definition at line 71 of file plpdirent.cc.

◆ getUID() [1/2]

PlpUID & PlpDirent::getUID ( )

Retrieves the PlpUID object of a directory entry.

Returns
The PlpUID object.

Definition at line 89 of file plpdirent.cc.

◆ getUID() [2/2]

uint32_t PlpDirent::getUID ( int  uididx)

Retrieves the UIDs of a directory entry.

This method returns always 0 with a Series3.

Parameters
uididxThe index of the UID to retrieve (0 .. 2).
Returns
The selected UID or 0 if the index is out of range.

Definition at line 83 of file plpdirent.cc.

◆ isDirectory()

bool PlpDirent::isDirectory ( ) const

Determine if the directory entry represents a directory.

Returns
true if the directory entry is itself a directory; false otherwise.

Definition at line 79 of file plpdirent.cc.

◆ operator=()

PlpDirent & PlpDirent::operator= ( const PlpDirent e)
default

Assignment operator Mainly used by STL container classes.

Parameters
eThe new value to assign.
Returns
The modified object.

◆ setName()

void PlpDirent::setName ( const char *  str)

Set the file name of a directory entry.

This is currently unused. It does NOT change the name of the corresponding file on the Psion.

Parameters
strThe new name of the file.

Definition at line 110 of file plpdirent.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream o,
const PlpDirent e 
)
friend

Prints the object contents.

The output is in human readable similar to the output of a "ls" command.

Definition at line 114 of file plpdirent.cc.

◆ RFSV16

friend class RFSV16
friend

Definition at line 81 of file plpdirent.h.

◆ RFSV32

friend class RFSV32
friend

Definition at line 80 of file plpdirent.h.

Member Data Documentation

◆ attr

uint32_t PlpDirent::attr
private

Definition at line 195 of file plpdirent.h.

◆ attrstr

std::string PlpDirent::attrstr
private

Definition at line 198 of file plpdirent.h.

◆ dirname_

std::string PlpDirent::dirname_
private

Definition at line 199 of file plpdirent.h.

◆ name

std::string PlpDirent::name
private

Definition at line 200 of file plpdirent.h.

◆ size

uint32_t PlpDirent::size
private

Definition at line 194 of file plpdirent.h.

◆ time

PsiTime PlpDirent::time
private

Definition at line 197 of file plpdirent.h.

◆ UID

PlpUID PlpDirent::UID
private

Definition at line 196 of file plpdirent.h.


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