Crashpad
Public Types | Public Member Functions | List of all members
crashpad::DirectoryReader Class Reference

Iterates over the file and directory names in a directory. More...

#include "util/file/directory_reader.h"

Public Types

enum  Result
 The result of a call to NextFile(). More...
 

Public Member Functions

bool Open (const base::FilePath &path)
 Opens the directory specified by path for reading. More...
 
Result NextFile (base::FilePath *filename)
 Advances the reader to the next file in the directory. More...
 
int DirectoryFD ()
 Returns the file descriptor associated with this reader, logging a message and returning -1 on error.
 

Detailed Description

Iterates over the file and directory names in a directory.

The names enumerated are relative to the specified directory and do not include ".", "..", or files and directories in subdirectories.

Member Enumeration Documentation

◆ Result

The result of a call to NextFile().

Enumerator
kError 

An error occurred and a message was logged.

kSuccess 

A file was found.

kNoMoreFiles 

No more files were found.

Member Function Documentation

◆ NextFile()

DirectoryReader::Result crashpad::DirectoryReader::NextFile ( base::FilePath *  filename)

Advances the reader to the next file in the directory.

Parameters
[out]filenameThe filename of the next file.
Returns
a Result value. filename is only valid when Result::kSuccess is returned. If Result::kError is returned, a message will be logged.

◆ Open()

bool crashpad::DirectoryReader::Open ( const base::FilePath &  path)

Opens the directory specified by path for reading.

Parameters
[in]pathThe path to the directory to read.
Returns
true on success. false on failure with a message logged.

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