0.3.4 PrintSize

This commit is contained in:
Rob Tillaart 2023-11-16 10:38:25 +01:00
parent 4b028f2564
commit f196e5164d
5 changed files with 56 additions and 13 deletions

View File

@ -6,12 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.3.4] - 2023-11-15
- update readme.md
## [0.3.3] - 2022-11-22 ## [0.3.3] - 2022-11-22
- add changelog.md - add changelog.md
- add RP2040 to build-CI - add RP2040 to build-CI
- minor edits - minor edits
## [0.3.2] - 2021-12-24 ## [0.3.2] - 2021-12-24
- update library.json - update library.json
- update license - update license

View File

@ -2,7 +2,7 @@
// //
// FILE: PrintSize.h // FILE: PrintSize.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.3.3 // VERSION: 0.3.4
// PURPOSE: Library to determine size of a printed variable. // PURPOSE: Library to determine size of a printed variable.
// DATE: 2017-12-09 // DATE: 2017-12-09
// URL: https://github.com/RobTillaart/PrintSize // URL: https://github.com/RobTillaart/PrintSize
@ -11,7 +11,7 @@
#include "Arduino.h" #include "Arduino.h"
#include "Print.h" #include "Print.h"
#define PRINTSIZE_VERSION (F("0.3.3")) #define PRINTSIZE_VERSION (F("0.3.4"))
class PrintSize: public Print class PrintSize: public Print
@ -49,5 +49,5 @@ private:
}; };
// -- END OF FILE -- // -- END OF FILE --

View File

@ -15,9 +15,9 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/PrintSize.git" "url": "https://github.com/RobTillaart/PrintSize.git"
}, },
"version": "0.3.3", "version": "0.3.4",
"license": "MIT", "license": "MIT",
"frameworks": "arduino", "frameworks": "*",
"platforms": "*", "platforms": "*",
"headers": "PrintSize.h" "headers": "PrintSize.h"
} }

View File

@ -1,9 +1,9 @@
name=PrintSize name=PrintSize
version=0.3.3 version=0.3.4
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Library to determine size of a printed variable. sentence=Library to determine size of a printed variable.
paragraph= paragraph=
category=Data Processing category=Data Processing
url=https://github.com/RobTillaart/PrintSize url=https://github.com/RobTillaart/PrintSize
architectures=* architectures=*

View File

@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/PrintSize/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino CI](https://github.com/RobTillaart/PrintSize/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/PrintSize/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/PrintSize/actions/workflows/arduino-lint.yml) [![Arduino-lint](https://github.com/RobTillaart/PrintSize/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/PrintSize/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/PrintSize/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/PrintSize/actions/workflows/jsoncheck.yml) [![JSON check](https://github.com/RobTillaart/PrintSize/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/PrintSize/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/PrintSize.svg)](https://github.com/RobTillaart/PrintSize/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/PrintSize/blob/master/LICENSE) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/PrintSize/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/PrintSize.svg?maxAge=3600)](https://github.com/RobTillaart/PrintSize/releases) [![GitHub release](https://img.shields.io/github/release/RobTillaart/PrintSize.svg?maxAge=3600)](https://github.com/RobTillaart/PrintSize/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/PrintSize.svg)](https://registry.platformio.org/libraries/robtillaart/PrintSize)
# PrintSize # PrintSize
@ -21,9 +24,27 @@ Works for **print()**, **println()** and if supported **printf()** e.g. ESP32.
Finally since **0.2.0** it has a total counter to add up the characters "printed" since Finally since **0.2.0** it has a total counter to add up the characters "printed" since
the last **reset()** call. (see example) the last **reset()** call. (see example)
This library is related to
- https://github.com/RobTillaart/PrintCharArray (captures data in a buffer) #### Related
- https://github.com/RobTillaart/PrintSize. (captures data in a String)
- https://github.com/RobTillaart/PrintCharArray (captures data in a char buffer)
- https://github.com/RobTillaart/PrintSize (counts length of a number of print commands)
- https://github.com/RobTillaart/PrintString (captures data in a String)
## Interface
```cpp
#include "PrintSize.h"
```
- **PrintSize()** Constructor
- **size_t write(uint8_t c)** core.
Note: gives a warning unused parameter.
- **size_t write(uint8_t \* str, uint8_t length)**
Note: gives a warning unused parameter.
- **void reset()** reset the total counter.
- **uint32_t total()** total bytes "printed".
## Operational ## Operational
@ -46,11 +67,30 @@ Can be used to calculate the needed space.
## Future ## Future
#### Must
#### Should
- add examples - add examples
- add a function to handle **tab** char correctly e.g. - add a function to handle **tab** char correctly e.g.
could add more than one char. Interferes with the **write(str, length)**. could add more than one char. Interferes with the **write(str, length)**.
- setTabSize(2,4,6, 8...); - setTabSize(2, 4, 6, 8...);
- getTabSize(); - getTabSize();
- uint8_t \_tabSize = 4; - uint8_t \_tabSize = 4;
-
#### Could
- PRINTSIZE_LIB_VERSION ?
#### Wont
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,