> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/annotated/class_directory.md).

# Directory

[Data Structures](#nested-classes) | [Public Types](#pub-types) | [Public Member Functions](#pub-methods)

`#include <`[directory.h](/adk-5.0-programmers-guide/directory_8h_source.md)`>`

|                 |                                                                                                    |
| --------------- | -------------------------------------------------------------------------------------------------- |
| Data Structures |                                                                                                    |
| struct          | [Entry](/adk-5.0-programmers-guide/readme/annotated/class_directory/struct_directory_1_1_entry.md) |

|              |                                                                                                                                                                                                                                                                                                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Public Types |                                                                                                                                                                                                                                                                                                                                                                         |
| enum         | [FileType](#a2c794c5c13ab4dd7e65bad031dbe41c3) { [File](#a2c794c5c13ab4dd7e65bad031dbe41c3a1ab5ebbd194ab0b95e5697aca9ba274f), [Dir](#a2c794c5c13ab4dd7e65bad031dbe41c3ade1fdd6d5cfced39efa84b6ba6db7ca2), [Link](#a2c794c5c13ab4dd7e65bad031dbe41c3ad288cb65204ac772551b27769451efc2), [Special](#a2c794c5c13ab4dd7e65bad031dbe41c3ac18c85698a8e17ceb09f0393f47d43d3) } |
| enum         | { [Read](#abed82baf7f470b522273a3e37c24c600a809abe96853e69894bbf8e5730b31348) = 1, [Write](#abed82baf7f470b522273a3e37c24c600aa56670174817e3fed92bfd8182d7c0d1) = 2 }                                                                                                                                                                                                   |

|                         |                                                                                                                                                              |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Public Member Functions |                                                                                                                                                              |
|                         | [Directory](#a38d47b06522240db90b8b01e51af6968) ()                                                                                                           |
| virtual                 | [\~Directory](#aafb25e10c4cbdc7824beecf2a28cf10a) ()                                                                                                         |
| int                     | [open](#adf02eebfa74c648cdf8eb58331ec2334) (const std::string &\_dirname)                                                                                    |
| int                     | [readEntry](#a146efd6a8d54b8727b20c2164a9333d8) ([Entry](/adk-5.0-programmers-guide/readme/annotated/class_directory/struct_directory_1_1_entry.md) \&entry) |
| void                    | [pushBack](#ad46c690eb8d3d3ca0958371d41ae5556) ()                                                                                                            |
| void                    | [close](#a5ae591df94fc66ccb85cbb6565368bca) ()                                                                                                               |

### DetailedDescription <a href="#detailed-description" id="detailed-description"></a>

class for reading directories

### MemberEnumeration Documentation <a href="#member-enumeration-documentation" id="member-enumeration-documentation"></a>

### anonymousenum <a href="#abed82baf7f470b522273a3e37c24c600" id="abed82baf7f470b522273a3e37c24c600"></a>

anonymous enum

|            |   |
| ---------- | - |
| Enumerator |   |
| Read       |   |
| Write      |   |

### FileType <a href="#a2c794c5c13ab4dd7e65bad031dbe41c3" id="a2c794c5c13ab4dd7e65bad031dbe41c3"></a>

enum \[FileType]\(#a2c794c5c13ab4dd7e65bad031dbe41c3)

|            |   |
| ---------- | - |
| Enumerator |   |
| File       |   |
| Dir        |   |
| Link       |   |
| Special    |   |

### Constructor& Destructor Documentation

### Directory() <a href="#a38d47b06522240db90b8b01e51af6968" id="a38d47b06522240db90b8b01e51af6968"></a>

[Directory](/adk-5.0-programmers-guide/readme/annotated/class_directory.md)

constructor

### \~Directory() <a href="#aafb25e10c4cbdc7824beecf2a28cf10a" id="aafb25e10c4cbdc7824beecf2a28cf10a"></a>

virtual \\\~[Directory](/adk-5.0-programmers-guide/readme/annotated/class_directory.md)

inlinevirtual

destructor

### MemberFunction Documentation <a href="#member-function-documentation" id="member-function-documentation"></a>

### close() <a href="#a5ae591df94fc66ccb85cbb6565368bca" id="a5ae591df94fc66ccb85cbb6565368bca"></a>

void close

close the directory

### open() <a href="#adf02eebfa74c648cdf8eb58331ec2334" id="adf02eebfa74c648cdf8eb58331ec2334"></a>

int open

open a directory for reading

**Parameters**

\[in] **\_dirname** name of the directory

#### Returns

1 in case of success, 0 in case of failure

### pushBack() <a href="#ad46c690eb8d3d3ca0958371d41ae5556" id="ad46c690eb8d3d3ca0958371d41ae5556"></a>

void pushBack

inline

push back one directory entry (it will be read by the next [readEntry()](#a146efd6a8d54b8727b20c2164a9333d8)). Only one entry can be pushed back.

### readEntry() <a href="#a146efd6a8d54b8727b20c2164a9333d8" id="a146efd6a8d54b8727b20c2164a9333d8"></a>

int readEntry

read the next directory entry

**Parameters**

\[out] **entry** next directory entry

#### Returns

1 in case of success, 0 in case of failure (e.g. end of directory)

***

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

* sdi/src/[directory.h](/adk-5.0-programmers-guide/directory_8h_source.md)
* sdi/src/[directory.cpp](/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/directory_8cpp.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/annotated/class_directory.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
