XRootD
XrdCl::StatInfo Class Reference

Object stat info. More...

#include <XrdClXRootDResponses.hh>

+ Collaboration diagram for XrdCl::StatInfo:

Public Types

enum  Flags {
  XBitSet = kXR_xset ,
  IsDir = kXR_isDir ,
  Other = kXR_other ,
  Offline = kXR_offline ,
  POSCPending = kXR_poscpend ,
  IsReadable = kXR_readable ,
  IsWritable = kXR_writable ,
  BackUpExists = kXR_bkpexist
}
 Flags. More...
 

Public Member Functions

 StatInfo ()
 Constructor. More...
 
 StatInfo (const StatInfo &info)
 Copy constructor. More...
 
 StatInfo (const std::string &id, uint64_t size, uint32_t flags, uint64_t modTime)
 Constructor. More...
 
 ~StatInfo ()
 Destructor. More...
 
bool ExtendedFormat () const
 Has extended stat information. More...
 
uint64_t GetAccessTime () const
 Get change time (in seconds since epoch) More...
 
std::string GetAccessTimeAsString () const
 Get change time. More...
 
uint64_t GetChangeTime () const
 Get change time (in seconds since epoch) More...
 
std::string GetChangeTimeAsString () const
 Get change time. More...
 
const std::string & GetChecksum () const
 Get checksum. More...
 
uint32_t GetFlags () const
 Get flags. More...
 
const std::string & GetGroup () const
 Get group. More...
 
const std::string & GetId () const
 Get id. More...
 
const std::string GetModeAsOctString () const
 Get mode. More...
 
const std::string & GetModeAsString () const
 Get mode. More...
 
uint64_t GetModTime () const
 Get modification time (in seconds since epoch) More...
 
std::string GetModTimeAsString () const
 Get modification time. More...
 
const std::string & GetOwner () const
 Get owner. More...
 
uint64_t GetSize () const
 Get size (in bytes) More...
 
bool HasChecksum () const
 Has checksum. More...
 
bool ParseServerResponse (const char *data)
 Parse server response and fill up the object. More...
 
void SetFlags (uint32_t flags)
 Set flags. More...
 
void SetSize (uint64_t size)
 Set size. More...
 
bool TestFlags (uint32_t flags) const
 Test flags. More...
 

Detailed Description

Object stat info.

Definition at line 400 of file XrdClXRootDResponses.hh.

Member Enumeration Documentation

◆ Flags

Flags.

Enumerator
XBitSet 

Executable/searchable bit set.

IsDir 

This is a directory.

Other 

Neither a file nor a directory.

Offline 

File is not online (ie. on disk)

POSCPending 

File opened with POST flag, not yet successfully closed

IsReadable 

Read access is allowed.

IsWritable 

Write access is allowed.

BackUpExists 

Back up copy exists.

Definition at line 406 of file XrdClXRootDResponses.hh.

407  {
408  XBitSet = kXR_xset,
409  IsDir = kXR_isDir,
410  Other = kXR_other,
411  Offline = kXR_offline,
417  };
@ kXR_readable
Definition: XProtocol.hh:1224
@ kXR_isDir
Definition: XProtocol.hh:1221
@ kXR_offline
Definition: XProtocol.hh:1223
@ kXR_bkpexist
Definition: XProtocol.hh:1227
@ kXR_other
Definition: XProtocol.hh:1222
@ kXR_poscpend
Definition: XProtocol.hh:1226
@ kXR_writable
Definition: XProtocol.hh:1225
@ kXR_xset
Definition: XProtocol.hh:1220
@ IsReadable
Read access is allowed.
@ IsDir
This is a directory.
@ Other
Neither a file nor a directory.
@ BackUpExists
Back up copy exists.
@ XBitSet
Executable/searchable bit set.
@ Offline
File is not online (ie. on disk)
@ IsWritable
Write access is allowed.

Constructor & Destructor Documentation

◆ StatInfo() [1/3]

XrdCl::StatInfo::StatInfo ( )

Constructor.

Definition at line 226 of file XrdClXRootDResponses.cc.

226  : pImpl( new StatInfoImpl() )
227  {
228  }

◆ StatInfo() [2/3]

XrdCl::StatInfo::StatInfo ( const std::string &  id,
uint64_t  size,
uint32_t  flags,
uint64_t  modTime 
)

Constructor.

Definition at line 233 of file XrdClXRootDResponses.cc.

234  : pImpl( new StatInfoImpl() )
235 
236  {
237  pImpl->pId = id;
238  pImpl->pSize = size;
239  pImpl->pFlags = flags;
240  pImpl->pModifyTime = modTime;
241  }

◆ StatInfo() [3/3]

XrdCl::StatInfo::StatInfo ( const StatInfo info)

Copy constructor.

Definition at line 246 of file XrdClXRootDResponses.cc.

246  : pImpl( new StatInfoImpl( *info.pImpl) )
247  {
248  }

◆ ~StatInfo()

XrdCl::StatInfo::~StatInfo ( )
default

Destructor.

Member Function Documentation

◆ ExtendedFormat()

bool XrdCl::StatInfo::ExtendedFormat ( ) const

Has extended stat information.

Parse server response and fill up the object.

Definition at line 417 of file XrdClXRootDResponses.cc.

418  {
419  return pImpl->pExtended;
420  }

Referenced by DoStat(), PrintDirListStatInfo(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ GetAccessTime()

uint64_t XrdCl::StatInfo::GetAccessTime ( ) const

Get change time (in seconds since epoch)

Definition at line 346 of file XrdClXRootDResponses.cc.

347  {
348  return pImpl->pAccessTime;
349  }

Referenced by XrdCl::StatAction::Serialize(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ GetAccessTimeAsString()

std::string XrdCl::StatInfo::GetAccessTimeAsString ( ) const

Get change time.

Definition at line 354 of file XrdClXRootDResponses.cc.

355  {
356  return TimeToString( pImpl->pAccessTime );
357  }

Referenced by DoStat().

+ Here is the caller graph for this function:

◆ GetChangeTime()

uint64_t XrdCl::StatInfo::GetChangeTime ( ) const

Get change time (in seconds since epoch)

Definition at line 330 of file XrdClXRootDResponses.cc.

331  {
332  return pImpl->pChangeTime;
333  }

Referenced by XrdCl::StatAction::Serialize(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ GetChangeTimeAsString()

std::string XrdCl::StatInfo::GetChangeTimeAsString ( ) const

Get change time.

Definition at line 338 of file XrdClXRootDResponses.cc.

339  {
340  return TimeToString( pImpl->pChangeTime );
341  }

Referenced by DoStat().

+ Here is the caller graph for this function:

◆ GetChecksum()

const std::string & XrdCl::StatInfo::GetChecksum ( ) const

Get checksum.

Definition at line 409 of file XrdClXRootDResponses.cc.

410  {
411  return pImpl->pCksum;
412  }

Referenced by DoLS(), PrintDirListStatInfo(), and XrdCl::StatAction::Serialize().

+ Here is the caller graph for this function:

◆ GetFlags()

uint32_t XrdCl::StatInfo::GetFlags ( ) const

Get flags.

Definition at line 290 of file XrdClXRootDResponses.cc.

291  {
292  return pImpl->pFlags;
293  }

Referenced by DoStat(), XrdCl::StatAction::Serialize(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ GetGroup()

const std::string & XrdCl::StatInfo::GetGroup ( ) const

Get group.

Definition at line 401 of file XrdClXRootDResponses.cc.

402  {
403  return pImpl->pGroup;
404  }

Referenced by DoLS(), DoStat(), PrintDirListStatInfo(), and XrdCl::StatAction::Serialize().

+ Here is the caller graph for this function:

◆ GetId()

const std::string & XrdCl::StatInfo::GetId ( ) const

Get id.

Definition at line 266 of file XrdClXRootDResponses.cc.

267  {
268  return pImpl->pId;
269  }

Referenced by DoStat(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ GetModeAsOctString()

const std::string XrdCl::StatInfo::GetModeAsOctString ( ) const

Get mode.

Definition at line 370 of file XrdClXRootDResponses.cc.

371  {
372  std::string ret;
373  ret.reserve( 9 );
374 
375  // we care about 3 last digits
376  size_t size = pImpl->pMode.size();
377 
378  uint8_t oct = pImpl->pMode[size - 3] - '0';
379  OctToString( oct, ret );
380 
381  oct = pImpl->pMode[size - 2] - '0';
382  OctToString( oct, ret );
383 
384  oct = pImpl->pMode[size - 1] - '0';
385  OctToString( oct, ret );
386 
387  return ret;
388  }
@ oct
Definition: XrdSysTrace.hh:42

References Xrd::oct.

Referenced by PrintDirListStatInfo(), and XrdCl::StatAction::Serialize().

+ Here is the caller graph for this function:

◆ GetModeAsString()

const std::string & XrdCl::StatInfo::GetModeAsString ( ) const

Get mode.

Definition at line 362 of file XrdClXRootDResponses.cc.

363  {
364  return pImpl->pMode;
365  }

Referenced by DoStat().

+ Here is the caller graph for this function:

◆ GetModTime()

uint64_t XrdCl::StatInfo::GetModTime ( ) const

Get modification time (in seconds since epoch)

Definition at line 314 of file XrdClXRootDResponses.cc.

315  {
316  return pImpl->pModifyTime;
317  }

Referenced by XrdCl::StatAction::Serialize(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ GetModTimeAsString()

std::string XrdCl::StatInfo::GetModTimeAsString ( ) const

Get modification time.

Definition at line 322 of file XrdClXRootDResponses.cc.

323  {
324  return TimeToString( pImpl->pModifyTime );
325  }

Referenced by DoStat(), and PrintDirListStatInfo().

+ Here is the caller graph for this function:

◆ GetOwner()

const std::string & XrdCl::StatInfo::GetOwner ( ) const

Get owner.

Definition at line 393 of file XrdClXRootDResponses.cc.

394  {
395  return pImpl->pOwner;
396  }

Referenced by DoLS(), DoStat(), PrintDirListStatInfo(), and XrdCl::StatAction::Serialize().

+ Here is the caller graph for this function:

◆ GetSize()

uint64_t XrdCl::StatInfo::GetSize ( ) const

Get size (in bytes)

Definition at line 274 of file XrdClXRootDResponses.cc.

275  {
276  return pImpl->pSize;
277  }

Referenced by XrdCl::AssureFile(), DoLS(), DoStat(), DoTail(), XrdCl::FileStateHandler::OnOpen(), PrintDirListStatInfo(), XrdCl::StatAction::Serialize(), XrdPosixAdmin::Stat(), and XrdPosixFile::Stat().

+ Here is the caller graph for this function:

◆ HasChecksum()

bool XrdCl::StatInfo::HasChecksum ( ) const

Has checksum.

Definition at line 425 of file XrdClXRootDResponses.cc.

426  {
427  return pImpl->pHasCksum;
428  }

Referenced by PrintDirListStatInfo().

+ Here is the caller graph for this function:

◆ ParseServerResponse()

bool XrdCl::StatInfo::ParseServerResponse ( const char *  data)

Parse server response and fill up the object.

Definition at line 258 of file XrdClXRootDResponses.cc.

259  {
260  return pImpl->ParseServerResponse( data );
261  }

Referenced by XrdCl::DirectoryList::ParseServerResponse(), and XrdCl::LocalFileHandler::Stat().

+ Here is the caller graph for this function:

◆ SetFlags()

void XrdCl::StatInfo::SetFlags ( uint32_t  flags)

Set flags.

Definition at line 298 of file XrdClXRootDResponses.cc.

299  {
300  pImpl->pFlags = flags;
301  }

◆ SetSize()

void XrdCl::StatInfo::SetSize ( uint64_t  size)

Set size.

Definition at line 282 of file XrdClXRootDResponses.cc.

283  {
284  pImpl->pSize = size;
285  }

◆ TestFlags()

bool XrdCl::StatInfo::TestFlags ( uint32_t  flags) const

Test flags.

Definition at line 306 of file XrdClXRootDResponses.cc.

307  {
308  return pImpl->pFlags & flags;
309  }

Referenced by DoCD(), DoLS(), DoStat(), XrdCl::ZipListHandler::HandleResponse(), IndexRemote(), main(), PrintDirListStatInfo(), and ProcessStatQuery().

+ Here is the caller graph for this function:

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