Loading...
Searching...
No Matches
XrdCl::DirectoryList Class Reference

Directory list. More...

`#include <XrdClXRootDResponses.hh>`

Collaboration diagram for XrdCl::DirectoryList:

## Classes

class | ListEntry
| Directory entry. More...

## Public Types

typedef DirList::const_iterator | ConstIterator
| Directory listing const iterator.
typedef std::vector< ListEntry * > | DirList
| Directory listing.
typedef DirList::iterator | Iterator
| Directory listing iterator.

## Public Member Functions

| DirectoryList ()
| Constructor.
| ~DirectoryList ()
| Destructor.
void | Add (ListEntry *entry)
| Add an entry to the list - takes ownership.
ListEntry * | At (uint32_t index)
| Get an entry at given index.
Iterator | Begin ()
| Get the begin iterator.
ConstIterator | Begin () const
| Get the begin iterator.
Iterator | End ()
| Get the end iterator.
ConstIterator | End () const
| Get the end iterator.
const std::string & | GetParentName () const
| Get parent directory name.
uint32_t | GetSize () const
| Get the size of the listing.
bool | ParseServerResponse (const std::string &hostId, const char *data)
| Parse server response and fill up the object.
bool | ParseServerResponse (const std::string &hostId, const char *data, bool isDStat)
| Parse chunked server response and fill up the object.
void | SetParentName (const std::string &parent)
| Set name of the parent directory.

## Static Public Member Functions

static bool | HasStatInfo (const char *data)
| Returns true if data contain stat info.

## Detailed Description

Directory list.

Definition at line 650 of file XrdClXRootDResponses.hh.

## Member Typedef Documentation

## ConstIterator

typedef DirList::const_iterator XrdCl::DirectoryList::ConstIterator

Directory listing const iterator.

Definition at line 757 of file XrdClXRootDResponses.hh.

## DirList

typedef std::vector<ListEntry*> XrdCl::DirectoryList::DirList

Directory listing.

Definition at line 747 of file XrdClXRootDResponses.hh.

## Iterator

typedef DirList::iterator XrdCl::DirectoryList::Iterator

Directory listing iterator.

Definition at line 752 of file XrdClXRootDResponses.hh.

## Constructor & Destructor Documentation

## DirectoryList()

XrdCl::DirectoryList::DirectoryList | ( |  | ) |

Constructor.

Definition at line 514 of file XrdClXRootDResponses.cc.

{
}

## ~DirectoryList()

XrdCl::DirectoryList::~DirectoryList | ( |  | ) |

Destructor.

Definition at line 521 of file XrdClXRootDResponses.cc.

{
for( Iterator it = pDirList.begin(); it != pDirList.end(); ++it )
delete *it;
}
XrdCl::DirectoryList::Iterator
DirList::iterator Iterator
Directory listing iterator.
Definition XrdClXRootDResponses.hh:752

## Member Function Documentation

## Add()

void XrdCl::DirectoryList::Add | ( | ListEntry * | entry | ) |

inline

Add an entry to the list - takes ownership.

Definition at line 762 of file XrdClXRootDResponses.hh.

{
pDirList.push_back( entry );
}

Referenced by XrdCl::FileSystem::DirList(), XrdCl::ZipArchive::List(), and ParseServerResponse().

Here is the caller graph for this function:

## At()

ListEntry * XrdCl::DirectoryList::At | ( | uint32_t | index | ) |

inline

Get an entry at given index.

Definition at line 770 of file XrdClXRootDResponses.hh.

{
return pDirList[index];
}

Referenced by XrdCl::FileSystem::DirList().

Here is the caller graph for this function:

## Begin() [1/2]

Iterator XrdCl::DirectoryList::Begin | ( |  | ) |

inline

Get the begin iterator.

Definition at line 778 of file XrdClXRootDResponses.hh.

{
return pDirList.begin();
}

Referenced by XrdCl::FileSystem::DirList(), DoLS(), and IndexRemote().

Here is the caller graph for this function:

## Begin() [2/2]

ConstIterator XrdCl::DirectoryList::Begin | ( |  | ) | const

inline

Get the begin iterator.

Definition at line 786 of file XrdClXRootDResponses.hh.

{
return pDirList.begin();
}

## End() [1/2]

Iterator XrdCl::DirectoryList::End | ( |  | ) |

inline

Get the end iterator.

Definition at line 794 of file XrdClXRootDResponses.hh.

{
return pDirList.end();
}

Referenced by XrdCl::FileSystem::DirList(), DoLS(), and IndexRemote().

Here is the caller graph for this function:

## End() [2/2]

ConstIterator XrdCl::DirectoryList::End | ( |  | ) | const

inline

Get the end iterator.

Definition at line 802 of file XrdClXRootDResponses.hh.

{
return pDirList.end();
}

## GetParentName()

const std::string & XrdCl::DirectoryList::GetParentName | ( |  | ) | const

inline

Get parent directory name.

Definition at line 818 of file XrdClXRootDResponses.hh.

{
return pParent;
}

Referenced by XrdCl::FileSystem::DirList(), and DoLS().

Here is the caller graph for this function:

## GetSize()

uint32_t XrdCl::DirectoryList::GetSize | ( |  | ) | const

inline

Get the size of the listing.

Definition at line 810 of file XrdClXRootDResponses.hh.

{
return pDirList.size();
}

Referenced by XrdCl::FileSystem::DirList().

Here is the caller graph for this function:

## HasStatInfo()

bool XrdCl::DirectoryList::HasStatInfo | ( | const char * | data | ) |

static

Returns true if data contain stat info.

Definition at line 594 of file XrdClXRootDResponses.cc.

{
std::string dat = data;
return !dat.compare( 0, dStatPrefix.size(), dStatPrefix );
}

Referenced by ParseServerResponse().

Here is the caller graph for this function:

## ParseServerResponse() [1/2]

bool XrdCl::DirectoryList::ParseServerResponse | ( | const std::string & | hostId,
|  | const char * | data )

Parse server response and fill up the object.

Definition at line 530 of file XrdClXRootDResponses.cc.

{
if( !data )
return false;
//--------------------------------------------------------------------------
// Check what kind of response we're dealing with
//--------------------------------------------------------------------------
bool isDStat = HasStatInfo( data );
if( isDStat )
data += dStatPrefix.size();
return ParseServerResponse( hostId, data, isDStat );
}
XrdCl::DirectoryList::HasStatInfo
static bool HasStatInfo(const char *data)
Returns true if data contain stat info.
Definition XrdClXRootDResponses.cc:594
XrdCl::DirectoryList::ParseServerResponse
bool ParseServerResponse(const std::string &hostId, const char *data)
Parse server response and fill up the object.
Definition XrdClXRootDResponses.cc:530

References HasStatInfo(), and ParseServerResponse().

Referenced by ParseServerResponse().

Here is the call graph for this function:
Here is the caller graph for this function:

## ParseServerResponse() [2/2]

bool XrdCl::DirectoryList::ParseServerResponse | ( | const std::string & | hostId,
|  | const char * | data,
|  | bool | isDStat )

Parse chunked server response and fill up the object.

Definition at line 548 of file XrdClXRootDResponses.cc.

{
if( !data )
return false;
std::string dat = data;
std::vector<std::string> entries;
std::vector<std::string>::iterator it;
Utils::splitString( entries, dat, "\n" );
//--------------------------------------------------------------------------
// Normal response
//--------------------------------------------------------------------------
if( !isDStat )
{
for( it = entries.begin(); it != entries.end(); ++it )
Add( new ListEntry( hostId, *it ) );
return true;
}
//--------------------------------------------------------------------------
// kXR_dstat
//--------------------------------------------------------------------------
if( entries.size() % 2 )
return false;
it = entries.begin(); //++it; ++it;
for( ; it != entries.end(); ++it )
{
ListEntry *entry = new ListEntry( hostId, *it );
Add( entry );
++it;
StatInfo *i = new StatInfo();
entry->SetStatInfo( i );
bool ok = i->ParseServerResponse( it->c_str() );
if( !ok )
return false;
}
return true;
}
XrdCl::DirectoryList::ListEntry
Directory entry.
Definition XrdClXRootDResponses.hh:658
XrdCl::DirectoryList::Add
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition XrdClXRootDResponses.hh:762
XrdCl::Utils::splitString
static void splitString(Container &result, const std::string &input, const std::string &delimiter)
Split a string.
Definition XrdClUtils.hh:56

References Add(), XrdCl::StatInfo::ParseServerResponse(), XrdCl::DirectoryList::ListEntry::SetStatInfo(), and XrdCl::Utils::splitString().

Here is the call graph for this function:

## SetParentName()

void XrdCl::DirectoryList::SetParentName | ( | const std::string & | parent | ) |

inline

Set name of the parent directory.

Definition at line 826 of file XrdClXRootDResponses.hh.

{
size_t pos = parent.find( '?' );
pParent = pos == std::string::npos ? parent : parent.substr( 0, pos );
if( !pParent.empty() && pParent[pParent.length()-1] != '/' )
pParent += "/";
}
parent
static void parent()
Definition XrdClDefaultEnv.cc:80

References parent().

Referenced by XrdCl::FileSystem::DirList(), and XrdCl::ZipArchive::List().

Here is the call graph for this function:
Here is the caller graph for this function:

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

- XrdClXRootDResponses.hh
- XrdClXRootDResponses.cc