Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::bin::DirectoryListing Class Referenceabstract

#include <directory.h>

Inheritance diagram for dart::bin::DirectoryListing:
dart::bin::AsyncDirectoryListing dart::bin::SyncDirectoryListing

Public Member Functions

 DirectoryListing (Namespace *namespc, const char *dir_name, bool recursive, bool follow_links)
 
virtual ~DirectoryListing ()
 
virtual bool HandleDirectory (const char *dir_name)=0
 
virtual bool HandleFile (const char *file_name)=0
 
virtual bool HandleLink (const char *link_name)=0
 
virtual bool HandleError ()=0
 
virtual void HandleDone ()
 
void Push (DirectoryListingEntry *directory)
 
void Pop ()
 
bool IsEmpty () const
 
void PopAll ()
 
Namespacenamespc () const
 
DirectoryListingEntrytop () const
 
bool recursive () const
 
bool follow_links () const
 
const char * CurrentPath ()
 
PathBufferpath_buffer ()
 
bool error () const
 

Detailed Description

Definition at line 91 of file directory.h.

Constructor & Destructor Documentation

◆ DirectoryListing()

dart::bin::DirectoryListing::DirectoryListing ( Namespace namespc,
const char *  dir_name,
bool  recursive,
bool  follow_links 
)
inline

Definition at line 93 of file directory.h.

97 : namespc_(namespc),
98 top_(nullptr),
99 error_(false),
100 recursive_(recursive),
101 follow_links_(follow_links) {
102 if (!path_buffer_.Add(dir_name)) {
103 error_ = true;
104 }
105 Push(new DirectoryListingEntry(nullptr));
106 }
void Push(DirectoryListingEntry *directory)
Definition: directory.h:116
Namespace * namespc() const
Definition: directory.h:133
bool Add(const char *name)

◆ ~DirectoryListing()

virtual dart::bin::DirectoryListing::~DirectoryListing ( )
inlinevirtual

Definition at line 108 of file directory.h.

108{ PopAll(); }

Member Function Documentation

◆ CurrentPath()

const char * dart::bin::DirectoryListing::CurrentPath ( )
inline

Definition at line 141 of file directory.h.

141{ return path_buffer_.AsScopedString(); }
const char * AsScopedString() const

◆ error()

bool dart::bin::DirectoryListing::error ( ) const
inline

Definition at line 145 of file directory.h.

145{ return error_; }

◆ follow_links()

bool dart::bin::DirectoryListing::follow_links ( ) const
inline

Definition at line 139 of file directory.h.

139{ return follow_links_; }

◆ HandleDirectory()

virtual bool dart::bin::DirectoryListing::HandleDirectory ( const char *  dir_name)
pure virtual

◆ HandleDone()

virtual void dart::bin::DirectoryListing::HandleDone ( )
inlinevirtual

Reimplemented in dart::bin::AsyncDirectoryListing.

Definition at line 114 of file directory.h.

114{}

◆ HandleError()

virtual bool dart::bin::DirectoryListing::HandleError ( )
pure virtual

◆ HandleFile()

virtual bool dart::bin::DirectoryListing::HandleFile ( const char *  file_name)
pure virtual

◆ HandleLink()

virtual bool dart::bin::DirectoryListing::HandleLink ( const char *  link_name)
pure virtual

◆ IsEmpty()

bool dart::bin::DirectoryListing::IsEmpty ( ) const
inline

Definition at line 125 of file directory.h.

125{ return top_ == nullptr; }

◆ namespc()

Namespace * dart::bin::DirectoryListing::namespc ( ) const
inline

Definition at line 133 of file directory.h.

133{ return namespc_; }

◆ path_buffer()

PathBuffer & dart::bin::DirectoryListing::path_buffer ( )
inline

Definition at line 143 of file directory.h.

143{ return path_buffer_; }

◆ Pop()

void dart::bin::DirectoryListing::Pop ( )
inline

Definition at line 118 of file directory.h.

118 {
119 ASSERT(!IsEmpty());
120 DirectoryListingEntry* current = top_;
121 top_ = top_->parent();
122 delete current;
123 }
DirectoryListingEntry * parent() const
Definition: directory.h:72
#define ASSERT(E)

◆ PopAll()

void dart::bin::DirectoryListing::PopAll ( )
inline

Definition at line 127 of file directory.h.

127 {
128 while (!IsEmpty()) {
129 Pop();
130 }
131 }

◆ Push()

void dart::bin::DirectoryListing::Push ( DirectoryListingEntry directory)
inline

Definition at line 116 of file directory.h.

116{ top_ = directory; }

◆ recursive()

bool dart::bin::DirectoryListing::recursive ( ) const
inline

Definition at line 137 of file directory.h.

137{ return recursive_; }

◆ top()

DirectoryListingEntry * dart::bin::DirectoryListing::top ( ) const
inline

Definition at line 135 of file directory.h.

135{ return top_; }

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