# MemoryDevice

## Content

class | MemoryFilesystem

## Functions

bool | `Exists`
bool | `IsDirectory`
bool | `CreateDirs`
bool | `RemoveAll`
MemoryDeviceFile | `OpenFileForReading`
char const * | `ToAbsolutePath`

## Detailed Description

class `MemoryDevice`

  The MemoryDevice class is an in-memory virtual file device used to sandbox file IO. These objects can be obtained by Database::GetMemoryDevice.

  Public Functions

  bool `Exists`(char const *utf8_path)

    Queries if a path exists within this device.

    Returns: | True if the path exists and false otherwise.

  bool `IsDirectory`(char const *utf8_path)

    Queries if a path is a directory within this device.

    Returns: | True if the path is a directory and false otherwise.

  bool `CreateDirs`(char const *utf8_directory_path)

    Creates all the directories in this device required for the input directory path to exist.

    Returns: | True if the leaf directory was successfully created and false otherwise.

  bool `RemoveAll`(char const *utf8_path)

    Removes a file or directory in this device. If it is a directory, all of its children are also removed.

    Returns: | True if the directory was successfully removed and false otherwise.

  MemoryDeviceFile `OpenFileForReading`(char const *utf8_path)

    Opens the file specified by `path` for read operations. A valid MemoryDeviceFile will be returned which allows reading the file data.

    If the path is not a valid file, an Exception will be thrown.

    Returns: | A valid file object if the given path is an actual file.

  char const *`ToAbsolutePath`(char const *utf8_path)

    Transforms the given path into an absolute version of the same underlying path. To find the current working directory for the MemoryDevice, call this function with an empty string for the path.

    Returns: | An aboslute version of the given path.

  Friends

  friend class ::TC::IO::MemoryFilesystem

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...