Skip to content

Get All Groups

GetAllGroups

Retrieves all account groups from the system.

int GetAllGroups(std::vector<GroupRecord>* groups);

Parameters

  • groups — pointer to a std::vector of GroupRecord structures where the retrieved groups will be stored.

Return Value

  • RET_OK — groups found and successfully retrieved.
  • RET_NOT_FOUND — no groups found in the system.
  • RET_* — other error codes.
  • Return Codes

Example

std::vector<GroupRecord> allGroups;
if (GetAllGroups(&allGroups) == RET_OK) {
    // Process allGroups
}

Warning

  • The groups pointer must point to a valid std::vector<GroupRecord> object.
  • If no groups are found, the function will return RET_NOT_FOUND and leave groups unchanged.
  • Always check the return code before accessing groups.