IdentifyArea.cpp 592 B

123456789101112131415161718192021
  1. #include "stdafx.h"
  2. #include "IdentifyArea.h"
  3. std::string get_str_by_identify_group(int omr_out_type, IdentifyGroup*ptr_group,char option_spacer)
  4. {
  5. std::string ret = "";
  6. if (ptr_group&&ptr_group->select){
  7. for (int i = 0; i < ptr_group->item_count; ++i){
  8. int *ptr_int = ptr_group->select + i;
  9. auto ptr_tmp = ptr_group->get_item_by_index(i);
  10. if (*ptr_int == 1 && ptr_tmp){
  11. ret += ptr_tmp->name;
  12. if (omr_out_type == 0) break;
  13. ret += option_spacer;
  14. }
  15. }
  16. }
  17. if (!ret.empty() && ret[ret.size() - 1] == ',')
  18. ret = std::string(ret, 0, ret.size() - 1);
  19. return ret;
  20. }