MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / ParseResult

Class ParseResult

Source/Utils/cxxopts.hpp:1457–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1455 using NameHashMap = std::unordered_map<std::string, size_t>;
1456
1457 class ParseResult
1458 {
1459 public:
1460 class Iterator
1461 {
1462 public:
1463 using iterator_category = std::forward_iterator_tag;
1464 using value_type = KeyValue;
1465 using difference_type = void;
1466 using pointer = const KeyValue*;
1467 using reference = const KeyValue&;
1468
1469 Iterator() = default;
1470 Iterator(const Iterator&) = default;
1471
1472 Iterator(const ParseResult *pr, bool end=false)
1473 : m_pr(pr)
1474 , m_iter(end? pr->m_defaults.end(): pr->m_sequential.begin())
1475 {
1476 }
1477
1478 Iterator& operator++()
1479 {
1480 ++m_iter;
1481 if(m_iter == m_pr->m_sequential.end())
1482 {
1483 m_iter = m_pr->m_defaults.begin();
1484 return *this;
1485 }
1486 return *this;
1487 }
1488
1489 Iterator operator++(int)
1490 {
1491 Iterator retval = *this;
1492 ++(*this);
1493 return retval;
1494 }
1495
1496 bool operator==(const Iterator& other) const
1497 {
1498 return m_iter == other.m_iter;
1499 }
1500
1501 bool operator!=(const Iterator& other) const
1502 {
1503 return !(*this == other);
1504 }
1505
1506 const KeyValue& operator*()
1507 {
1508 return *m_iter;
1509 }
1510
1511 const KeyValue* operator->()
1512 {
1513 return m_iter.operator->();
1514 }

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected