layout: doc title: “Starboard Module Reference: directory.h”

Provides directory listing functions.

Structs

SbDirectoryEntry

Represents a directory entry.

Members

SbDirectory

A handle to an open directory stream.

Functions

SbDirectoryCanOpen

Description

Indicates whether SbDirectoryOpen is allowed for the given path.

Declaration and definitions

#include "starboard/directory.h"

bool SbDirectoryCanOpen(const char* /*path*/) {
  return false;
}

Parameters

SbDirectoryClose

Description

Closes an open directory stream handle. The return value indicates whether the directory was closed successfully.

Declaration and definitions

#include "starboard/directory.h"

bool SbDirectoryClose(SbDirectory /*directory*/) {
  return false;
}

Parameters

SbDirectoryCreate

Description

Creates the directory path, assuming the parent directory already exists. This function returns true if the directory now exists (even if it existed before) and returns false if the directory does not exist.

Declaration and definitions

#include "starboard/directory.h"

bool SbDirectoryCreate(const char* /*path*/) {
  return false;
}

Parameters

SbDirectoryGetNext

Description

Populates out_entry with the next entry in the specified directory stream, and moves the stream forward by one entry.
This function returns true if there was a next directory, and false at the end of the directory stream.

Declaration and definitions

#include "starboard/directory.h"

bool SbDirectoryGetNext(SbDirectory /*directory*/,
                        SbDirectoryEntry* /*out_entry*/) {
  return false;
}

Parameters

SbDirectoryIsValid

Description

Returns whether the given directory stream handle is valid.

Declaration

static SB_C_INLINE bool SbDirectoryIsValid(SbDirectory directory) {
  return directory != kSbDirectoryInvalid;
}

Parameters

SbDirectoryOpen

Description

Opens the given existing directory for listing. This function returns kSbDirectoryInvalidHandle if it is not successful.
If out_error is provided by the caller, it will be set to the appropriate SbFileError code on failure.

Declaration and definitions

#include "starboard/directory.h"

SbDirectory SbDirectoryOpen(const char* /*path*/, SbFileError* /*out_error*/) {
  return kSbDirectoryInvalid;
}

Parameters