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

OpenLightingProject / ola / 11783254300

11 Nov 2024 05:23PM UTC coverage: 45.767% (+0.09%) from 45.677%
11783254300

push

github

web-flow
Merge pull request #1978 from DMXControl/add_nodle_r4s

Add DMXControl Projects e.V. Nodle R4S

7798 of 17938 branches covered (43.47%)

0 of 1 new or added line in 1 file covered. (0.0%)

721 existing lines in 11 files now uncovered.

22344 of 48821 relevant lines covered (45.77%)

64.39 hits per line

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

92.59
/common/messaging/SchemaPrinter.cpp
1
/*
2
 * This library is free software; you can redistribute it and/or
3
 * modify it under the terms of the GNU Lesser General Public
4
 * License as published by the Free Software Foundation; either
5
 * version 2.1 of the License, or (at your option) any later version.
6
 *
7
 * This library is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10
 * Lesser General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU Lesser General Public
13
 * License along with this library; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
 *
16
 * SchemaPrinter.cpp
17
 * Prints the text representation of a schema.
18
 * Copyright (C) 2011 Simon Newton
19
 */
20

21

22
#include <ola/messaging/Descriptor.h>
23
#include <ola/messaging/SchemaPrinter.h>
24
#include <iostream>
25
#include <string>
26

27
namespace ola {
28
namespace messaging {
29

30

31
using std::string;
32
using std::endl;
33

34

35
void SchemaPrinter::Visit(const BoolFieldDescriptor *descriptor) {
2✔
36
  m_str << string(m_indent, ' ') << descriptor->Name() << ": bool" << endl;
2✔
37
}
2✔
38

39

40
void SchemaPrinter::Visit(const IPV4FieldDescriptor *descriptor) {
1✔
41
  m_str << string(m_indent, ' ') << descriptor->Name() << ": IPv4 address"
1✔
42
        << endl;
1✔
43
}
1✔
44

45

46
void SchemaPrinter::Visit(const IPV6FieldDescriptor *descriptor) {
1✔
47
  m_str << string(m_indent, ' ') << descriptor->Name() << ": IPv6 address"
1✔
48
        << endl;
1✔
49
}
1✔
50

51

52
void SchemaPrinter::Visit(const MACFieldDescriptor *descriptor) {
1✔
53
  m_str << string(m_indent, ' ') << descriptor->Name() << ": MAC" << endl;
1✔
54
}
1✔
55

56

57
void SchemaPrinter::Visit(const UIDFieldDescriptor *descriptor) {
1✔
58
  m_str << string(m_indent, ' ') << descriptor->Name() << ": UID" << endl;
1✔
59
}
1✔
60

61

62
void SchemaPrinter::Visit(const StringFieldDescriptor *descriptor) {
3✔
63
  m_str << string(m_indent, ' ') << descriptor->Name() << ": string [" <<
3✔
64
    descriptor->MinSize() << ", " << descriptor->MaxSize() << "]" << endl;
3✔
65
}
3✔
66

67

68
void SchemaPrinter::Visit(const UInt8FieldDescriptor *descriptor) {
8✔
69
  AppendHeading(descriptor->Name(), "uint8");
8✔
70
  MaybeAppendIntervals(descriptor->Intervals());
8✔
71
  MaybeAppendLabels(descriptor->Labels());
8✔
72
  m_str << endl;
8✔
73
}
8✔
74

75

76
void SchemaPrinter::Visit(const UInt16FieldDescriptor *descriptor) {
11✔
77
  AppendHeading(descriptor->Name(), "uint16");
11✔
78
  MaybeAppendIntervals(descriptor->Intervals());
11✔
79
  MaybeAppendLabels(descriptor->Labels());
11✔
80
  m_str << endl;
11✔
81
}
11✔
82

83

84
void SchemaPrinter::Visit(const UInt32FieldDescriptor *descriptor) {
6✔
85
  AppendHeading(descriptor->Name(), "uint32");
6✔
86
  MaybeAppendIntervals(descriptor->Intervals());
6✔
87
  MaybeAppendLabels(descriptor->Labels());
6✔
88
  m_str << endl;
6✔
89
}
6✔
90

91

UNCOV
92
void SchemaPrinter::Visit(const UInt64FieldDescriptor *descriptor) {
×
UNCOV
93
  AppendHeading(descriptor->Name(), "uint64");
×
UNCOV
94
  MaybeAppendIntervals(descriptor->Intervals());
×
UNCOV
95
  MaybeAppendLabels(descriptor->Labels());
×
UNCOV
96
  m_str << endl;
×
UNCOV
97
}
×
98

99

100
void SchemaPrinter::Visit(const Int8FieldDescriptor *descriptor) {
1✔
101
  AppendHeading(descriptor->Name(), "int8");
1✔
102
  MaybeAppendIntervals(descriptor->Intervals());
1✔
103
  MaybeAppendLabels(descriptor->Labels());
1✔
104
  m_str << endl;
1✔
105
}
1✔
106

107

108
void SchemaPrinter::Visit(const Int16FieldDescriptor *descriptor) {
1✔
109
  AppendHeading(descriptor->Name(), "int16");
1✔
110
  MaybeAppendIntervals(descriptor->Intervals());
1✔
111
  MaybeAppendLabels(descriptor->Labels());
1✔
112
  m_str << endl;
1✔
113
}
1✔
114

115

116
void SchemaPrinter::Visit(const Int32FieldDescriptor *descriptor) {
1✔
117
  AppendHeading(descriptor->Name(), "int32");
1✔
118
  MaybeAppendIntervals(descriptor->Intervals());
1✔
119
  MaybeAppendLabels(descriptor->Labels());
1✔
120
  m_str << endl;
1✔
121
}
1✔
122

123

124
void SchemaPrinter::Visit(const Int64FieldDescriptor *descriptor) {
1✔
125
  AppendHeading(descriptor->Name(), "int64");
1✔
126
  MaybeAppendIntervals(descriptor->Intervals());
1✔
127
  MaybeAppendLabels(descriptor->Labels());
1✔
128
  m_str << endl;
1✔
129
}
1✔
130

131

132
void SchemaPrinter::Visit(const FieldDescriptorGroup *descriptor) {
2✔
133
  m_str << string(m_indent, ' ') << descriptor->Name() << " {" << endl;
2✔
134
  m_indent += m_indent_size;
2✔
135
}
2✔
136

137

138
void SchemaPrinter::PostVisit(const FieldDescriptorGroup *descriptor) {
2✔
139
  m_indent -= m_indent_size;
2✔
140
  m_str << string(m_indent, ' ') << "}" << endl;
2✔
141
  (void) descriptor;
2✔
142
}
2✔
143

144

145
void SchemaPrinter::AppendHeading(const string &name, const string &type) {
29✔
146
  m_str << string(m_indent, ' ') << name << ": " << type;
29✔
147
}
29✔
148
}  // namespace messaging
149
}  // namespace ola
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