| 1570 | } |
| 1571 | |
| 1572 | bool ParseBuildName() { |
| 1573 | std::string build_mark(" (build "); |
| 1574 | auto build_mark_position = created_by_.find(build_mark, version_end_); |
| 1575 | // No BUILD_NAME. |
| 1576 | if (build_mark_position == std::string::npos) { |
| 1577 | return false; |
| 1578 | } |
| 1579 | auto build_name_start = build_mark_position + build_mark.size(); |
| 1580 | RemovePrecedingSpaces(created_by_, build_name_start, created_by_.size()); |
| 1581 | auto build_name_end = created_by_.find_first_of(")", build_name_start); |
| 1582 | // No end ")". |
| 1583 | if (build_name_end == std::string::npos) { |
| 1584 | return false; |
| 1585 | } |
| 1586 | RemoveTrailingSpaces(created_by_, build_name_start, build_name_end); |
| 1587 | application_version_.build_ = |
| 1588 | created_by_.substr(build_name_start, build_name_end - build_name_start); |
| 1589 | |
| 1590 | return true; |
| 1591 | } |
| 1592 | |
| 1593 | const std::string& created_by_; |
| 1594 | ApplicationVersion& application_version_; |