IDA C++ SDK 9.2
Loading...
Searching...
No Matches
dirtree.hpp File Reference

Types involved in grouping of item into folders. More...

Go to the source code of this file.

Classes

struct  direntry_t
 Directory entry: either a file or directory. More...
struct  dirspec_t
 Directory tree specialization. More...
struct  dirtree_cursor_t
 Position in the directory tree. More...
struct  dirtree_selection_t
struct  dirtree_iterator_t
 Helper class to iterate over files. More...
struct  dirtree_visitor_t
 A visitor, for use with dirtree_t::traverse. More...
class  dirtree_t
 Directory tree. More...

Typedefs

typedef qvector< inode_tinodevec_t
typedef uval_t diridx_t
 Directory indexes are simple numbers like 0,1,2,3... They are independent of inode numbers.
typedef qvector< diridx_tdirvec_t
typedef ea_t blob_idx_t
 Blob index, used for storing/restoring dirtree_t information.
typedef qvector< direntry_tdirentry_vec_t
typedef qvector< dirtree_cursor_tdirtree_cursor_vec_t

Enumerations

enum  { DTN_FULL_NAME = 0x00 , DTN_DISPLAY_NAME = 0x01 }
enum  dterr_t {
  DTE_OK , DTE_ALREADY_EXISTS , DTE_NOT_FOUND , DTE_NOT_DIRECTORY ,
  DTE_NOT_EMPTY , DTE_BAD_PATH , DTE_CANT_RENAME , DTE_OWN_CHILD ,
  DTE_MAX_DIR , DTE_LAST
}
 Directory tree: error codes. More...
enum  dirtree_id_t {
  DIRTREE_LOCAL_TYPES , DIRTREE_FUNCS , DIRTREE_NAMES , DIRTREE_IMPORTS ,
  DIRTREE_IDAPLACE_BOOKMARKS , DIRTREE_BPTS , DIRTREE_LTYPES_BOOKMARKS , DIRTREE_END
}
 Built-in dirtree specializations: More...

Functions

 DECLARE_TYPE_AS_MOVABLE (direntry_t)
 DECLARE_TYPE_AS_MOVABLE (dirtree_cursor_t)
idaman dirtree_t *ida_export get_std_dirtree (dirtree_id_t id)

Detailed Description

Types involved in grouping of item into folders.

The dirtree_t class is used to organize a directory tree on top of any collection that allows for accessing its elements by an id (inode).

No requirements are imposed on the inodes apart from the forbidden value -1 (used to denote a bad inode).

The dirspec_t class is used to specialize the dirtree. It can be used to introduce a directory structure for:

  • local types
  • structs
  • enums
  • functions
  • names
  • etc
Note
you should be manipulating dirtree_t (and, if implementing a new tree backend, dirspec_t) instances, not calling top-level functions in this file directly.

Typedef Documentation

◆ inodevec_t

◆ diridx_t

typedef uval_t diridx_t

Directory indexes are simple numbers like 0,1,2,3... They are independent of inode numbers.

The root directory always exists and has the index 0 (direntry_t::ROOTIDX).

◆ dirvec_t

◆ blob_idx_t

typedef ea_t blob_idx_t

Blob index, used for storing/restoring dirtree_t information.

◆ direntry_vec_t

◆ dirtree_cursor_vec_t

Enumeration Type Documentation

◆ dterr_t

enum dterr_t

Directory tree: error codes.

Enumerator
DTE_OK 

ok

DTE_ALREADY_EXISTS 

item already exists

DTE_NOT_FOUND 

item not found

DTE_NOT_DIRECTORY 

item is not a directory

DTE_NOT_EMPTY 

directory is not empty

DTE_BAD_PATH 

invalid path

DTE_CANT_RENAME 

failed to rename an item

DTE_OWN_CHILD 

moving inside subdirectory of itself

DTE_MAX_DIR 

maximum directory count achieved

DTE_LAST 

◆ dirtree_id_t

Built-in dirtree specializations:

Enumerator
DIRTREE_LOCAL_TYPES 
DIRTREE_FUNCS 
DIRTREE_NAMES 
DIRTREE_IMPORTS 
DIRTREE_IDAPLACE_BOOKMARKS 
DIRTREE_BPTS 
DIRTREE_LTYPES_BOOKMARKS 
DIRTREE_END 

Function Documentation

◆ DECLARE_TYPE_AS_MOVABLE() [1/2]

DECLARE_TYPE_AS_MOVABLE ( direntry_t )

◆ DECLARE_TYPE_AS_MOVABLE() [2/2]

DECLARE_TYPE_AS_MOVABLE ( dirtree_cursor_t )

◆ get_std_dirtree()

idaman dirtree_t *ida_export get_std_dirtree ( dirtree_id_t id)