Skip to content

Commit 6764965

Browse files
committed
0.3.2 XMLWriter
1 parent 5fe2902 commit 6764965

File tree

18 files changed

+83
-64
lines changed

18 files changed

+83
-64
lines changed

libraries/XMLWriter/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2013-2021 Rob Tillaart
3+
Copyright (c) 2013-2022 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

libraries/XMLWriter/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

22
[![Arduino CI](https://github.com/RobTillaart/XMLWriter/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
3+
[![Arduino-lint](https://github.com/RobTillaart/XMLWriter/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/XMLWriter/actions/workflows/arduino-lint.yml)
4+
[![JSON check](https://github.com/RobTillaart/XMLWriter/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/XMLWriter/actions/workflows/jsoncheck.yml)
35
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/XMLWriter/blob/master/LICENSE)
46
[![GitHub release](https://img.shields.io/github/release/RobTillaart/XMLWriter.svg?maxAge=3600)](https://github.com/RobTillaart/XMLWriter/releases)
57

68

79
# XMLWriter
810

9-
Arduino Library to create simple XML (messages, files, print, ...)
11+
Arduino Library to create simple XML (messages, files, print, ...).
1012

1113

1214
## Description
@@ -18,9 +20,9 @@ When instantiating an XMLWriter one can define the internal buffer size.
1820
A bigger buffer will make the output faster, especially for Ethernet and SD.File.
1921
The buffer size should be at least 2 bytes and max 250.
2022
How much faster depends on the properties of the stream and the platform used.
21-
E.g. the baudrate and internal buffer of Serial, packet behaviour of Ethernet,
23+
E.g. the baud rate and internal buffer of Serial, packet behaviour of Ethernet,
2224
or paging of SD cards.
23-
If performance is low one should do testruns with different sizes for the buffer
25+
If performance is low one should do test runs with different sizes for the buffer
2426
and choose one that is appropriate.
2527

2628
Indicative sizes based upon the examples.
@@ -128,12 +130,13 @@ can inject strings.
128130

129131
## Configuration flags
130132

131-
| Flag | Value | Description |
132-
|:-----------------|:------|:-------------|
133+
| Flag | Value | Description |
134+
|:-----------------|:------|:------------------|
133135
|XMLWRITER_NONE | 0x00 | minimize output, smaller & faster |
134-
|XMLWRITER_COMMENT | 0x01 | allow comments |
136+
|XMLWRITER_COMMENT | 0x01 | allow comments |
135137
|XMLWRITER_INDENT | 0x02 | allow indentation |
136-
|XMLWRITER_NEWLINE | 0x04 | allow newlines |
138+
|XMLWRITER_NEWLINE | 0x04 | allow newlines |
139+
137140

138141
- **setConfig(XMLWRITER_NONE);** to minimize the output in bytes.
139142
- **setConfig(XMLWRITER_NEWLINE);** to break an XML stream in lines.
@@ -149,4 +152,6 @@ See examples
149152
## Future
150153

151154
- update documentation
152-
-
155+
-
156+
157+

libraries/XMLWriter/XMLWriter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: XMLWriter.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.3.1
4+
// VERSION: 0.3.2
55
// DATE: 2013-11-06
66
// PURPOSE: Arduino library for creating XML
77
//
@@ -26,7 +26,7 @@
2626
// 0.3.1 2021-11-11 refactor naming to improve readability
2727
// update build-CI,
2828
// update readme.md, Badges.
29-
//
29+
// 0.3.2 2021-12-29 update library.json, readme, license, unit test, minor edits
3030

3131

3232
#include "XMLWriter.h"
@@ -427,3 +427,4 @@ void XMLWriter::escape(const char* str)
427427

428428

429429
// -- END OF FILE --
430+

libraries/XMLWriter/XMLWriter.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: XMLWriter.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.3.1
5+
// VERSION: 0.3.2
66
// DATE: 2013-11-06
77
// PURPOSE: Arduino library for creating XML
88
//
@@ -11,40 +11,40 @@
1111
#include "Arduino.h"
1212

1313

14-
#define XMLWRITER_VERSION (F("0.3.1"))
14+
#define XMLWRITER_VERSION (F("0.3.2"))
1515

1616

1717
// for comment()
18-
#define NOMULTILINE false
19-
#define MULTILINE true
18+
#define NOMULTILINE false
19+
#define MULTILINE true
2020

2121
// for tagOpen(), tagEnd()
22-
#define NEWLINE true
23-
#define NONEWLINE false
24-
#define NOINDENT false // for tagClose()
22+
#define NEWLINE true
23+
#define NONEWLINE false
24+
#define NOINDENT false // for tagClose()
2525

2626
// for tagEnd()
27-
#define SLASH true
28-
#define NOSLASH false
27+
#define SLASH true
28+
#define NOSLASH false
2929

3030
// deepness of XML tree 5..10
3131
// needed for stack of tagStack
3232
#ifndef XMLWRITER_MAXLEVEL
33-
#define XMLWRITER_MAXLEVEL 5 // adjust for deeper nested structures
33+
#define XMLWRITER_MAXLEVEL 5 // adjust for deeper nested structures
3434
#endif
3535

3636
#ifndef XMLWRITER_MAXTAGSIZE
37-
#define XMLWRITER_MAXTAGSIZE 15 // adjust for longer fields - !! eats memory !!
37+
#define XMLWRITER_MAXTAGSIZE 15 // adjust for longer fields - !! eats memory !!
3838
#endif
3939

4040
// reduce footprint by commenting next line
4141
#define XMLWRITER_ESCAPE_SUPPORT
4242

4343
// configuration - setConfig
44-
#define XMLWRITER_NONE 0x00
45-
#define XMLWRITER_COMMENT 0x01
46-
#define XMLWRITER_INDENT 0x02
47-
#define XMLWRITER_NEWLINE 0x04
44+
#define XMLWRITER_NONE 0x00
45+
#define XMLWRITER_COMMENT 0x01
46+
#define XMLWRITER_INDENT 0x02
47+
#define XMLWRITER_NEWLINE 0x04
4848

4949
// uncomment next line to reduce ~30bytes RAM in escape() (AVR oonly)
5050
// #define __PROGMEM__

libraries/XMLWriter/examples/KMLWriterTest/KMLWriterTest.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//
22
// FILE: KMLWriterTest.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.3
54
// PURPOSE: simple KML writer
65
// DATE: 2015-05-21
76
// URL: https://github.com/RobTillaart/XMLWriter
8-
//
7+
98

109
#include <XMLWriter.h>
1110

@@ -96,3 +95,4 @@ This is a demo of the XMLWriter lib for Arduino
9695

9796

9897
// -- END OF FILE --
98+

libraries/XMLWriter/examples/XMLWriterDefaultSerial/XMLWriterDefaultSerial.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
//
22
// FILE: XMLWriterDefaultSerial.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.1
54
// PURPOSE: make a simple XML generating lib
65
// DATE: 2020-04-24
76
// URL: https://github.com/RobTillaart/XMLWriter
8-
//
97

108

119
#include <XMLWriter.h>
@@ -133,3 +131,4 @@ void loop()
133131

134132

135133
// -- END OF FILE --
134+

libraries/XMLWriter/examples/XMLWriterEthernet/0.1.0/XMLWriterEthernet.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//
22
// FILE: XMLWriterEthernet.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.0
54
// PURPOSE: demo XML writer for EthernetClient
65
// DATE: 2020-04-24
76
// URL: https://github.com/RobTillaart/XMLWriter
8-
//
7+
98

109
#include <XMLWriter.h>
1110

libraries/XMLWriter/examples/XMLWriterEthernet/XMLWriterEthernet.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
//
22
// FILE: XMLWriterEthernet.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.1
54
// PURPOSE: demo XML writer for EthernetClient
65
// DATE: 2020-04-24
76
// URL: https://github.com/RobTillaart/XMLWriter
8-
//
97

108

119
#include <XMLWriter.h>

libraries/XMLWriter/examples/XMLWriterPrint_1/XMLWriterPrint_1.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//
22
// FILE: XMLWriterPrint_1.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.1
54
// PURPOSE: demo Print interface
65
// DATE: 2020-07-07
76
// URL: https://github.com/RobTillaart/XMLWriter
8-
//
7+
98

109
#include <XMLWriter.h>
1110

@@ -24,7 +23,8 @@ void setup()
2423
XML.comment("XMLWriter Print interface");
2524
XML.setConfig(0); // no indent, no (further) comments
2625

27-
// The {} are not mandatory shows the XML structure in the code...
26+
// The {} and indentations are not mandatory
27+
// however they shows the XML structure in the code...
2828

2929
XML.tagOpen("Order");
3030
{

libraries/XMLWriter/examples/XMLWriterPrint_3/XMLWriterPrint_3.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
//
22
// FILE: XMLWriterPrint_3.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.1
54
// PURPOSE: demo Print interface - Printable data types
65
// DATE: 2020-07-07
76
// URL: https://github.com/RobTillaart/XMLWriter
87
//
9-
10-
// example works for UNO but does not compile for ESP,
11-
// to investigate [complex vs Complex]
8+
// example works for UNO but does not compile for ESP,
9+
// to investigate [complex vs Complex]
1210

1311

1412
#include <XMLWriter.h>
@@ -47,3 +45,4 @@ void loop()
4745

4846

4947
// -- END OF FILE --
48+

0 commit comments

Comments
 (0)