IDA Domain
Segments Class Reference

Provides access to segment-related operations in the IDA database. More...

#include <segment.hpp>

Classes

class  Iterator
 Iterator for segments in the IDA database. More...
 

Public Member Functions

 Segments (const Database &database)
 Constructs a segments handler for the given database. More...
 
segment_t * get_at (const ea_t ea) const
 Retrieves the segment that contains the given address. More...
 
std::string get_name (const segment_t *segment) const
 Retrieves the name of the given segment. More...
 
bool set_name (segment_t *segment, const std::string &name) const
 Renames a segment. More...
 
Iterator get_all () const
 Retrieves an iterator over all segments in the database. More...
 

Detailed Description

Provides access to segment-related operations in the IDA database.

Constructor & Destructor Documentation

◆ Segments()

Segments::Segments ( const Database database)
inline

Constructs a segments handler for the given database.

Parameters
databaseReference to the active IDA database.

Member Function Documentation

◆ get_all()

Iterator Segments::get_all ( ) const
inline

Retrieves an iterator over all segments in the database.

Returns
A SegmentsIterator instance.

◆ get_at()

segment_t* Segments::get_at ( const ea_t  ea) const

Retrieves the segment that contains the given address.

Parameters
eaThe effective address to search.
Returns
A pointer to the containing segment, or nullptr if none found.

◆ get_name()

std::string Segments::get_name ( const segment_t *  segment) const

Retrieves the name of the given segment.

Parameters
segmentPointer to the segment.
Returns
The segment name as a string, or an empty string if unavailable.

◆ set_name()

bool Segments::set_name ( segment_t *  segment,
const std::string &  name 
) const

Renames a segment.

Parameters
segmentPointer to the segment to rename.
nameThe new name to assign to the segment.
Returns
True if the rename operation succeeded, false otherwise.

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