• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bblanchon / ArduinoJson / 11857529172

15 Nov 2024 01:55PM CUT coverage: 99.327%. First build
11857529172

push

github

bblanchon
Make `ElementProxy` and `MemberProxy` non-copyable

22 of 22 new or added lines in 5 files covered. (100.0%)

3982 of 4009 relevant lines covered (99.33%)

10805.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/src/ArduinoJson/Array/ArrayData.hpp
1
// ArduinoJson - https://arduinojson.org
2
// Copyright © 2014-2024, Benoit BLANCHON
3
// MIT License
4

5
#pragma once
6

7
#include <ArduinoJson/Collection/CollectionData.hpp>
8

9
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
10

11
class ArrayData : public CollectionData {
12
 public:
13
  VariantData* addElement(ResourceManager* resources);
14

15
  static VariantData* addElement(ArrayData* array, ResourceManager* resources) {
223✔
16
    if (!array)
223✔
17
      return nullptr;
×
18
    return array->addElement(resources);
223✔
19
  }
20

21
  template <typename T>
22
  bool addValue(T&& value, ResourceManager* resources);
23

24
  template <typename T>
25
  static bool addValue(ArrayData* array, T&& value,
66,681✔
26
                       ResourceManager* resources) {
27
    if (!array)
66,681✔
28
      return false;
3✔
29
    return array->addValue(value, resources);
66,678✔
30
  }
31

32
  VariantData* getOrAddElement(size_t index, ResourceManager* resources);
33

34
  VariantData* getElement(size_t index, const ResourceManager* resources) const;
35

36
  static VariantData* getElement(const ArrayData* array, size_t index,
460✔
37
                                 const ResourceManager* resources) {
38
    if (!array)
460✔
39
      return nullptr;
15✔
40
    return array->getElement(index, resources);
445✔
41
  }
42

43
  void removeElement(size_t index, ResourceManager* resources);
44

45
  static void removeElement(ArrayData* array, size_t index,
15✔
46
                            ResourceManager* resources) {
47
    if (!array)
15✔
48
      return;
1✔
49
    array->removeElement(index, resources);
14✔
50
  }
51

52
  void remove(iterator it, ResourceManager* resources) {
19✔
53
    CollectionData::removeOne(it, resources);
19✔
54
  }
19✔
55

56
  static void remove(ArrayData* array, iterator it,
6✔
57
                     ResourceManager* resources) {
58
    if (array)
6✔
59
      return array->remove(it, resources);
5✔
60
  }
61

62
 private:
63
  iterator at(size_t index, const ResourceManager* resources) const;
64
};
65

66
ARDUINOJSON_END_PRIVATE_NAMESPACE
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc