0.3.2 PrintSize

This commit is contained in:
rob tillaart 2021-12-24 13:42:31 +01:00
parent b6aff9cca8
commit 6444416eb4
10 changed files with 14 additions and 26 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-2021 Rob Tillaart
Copyright (c) 2017-2022 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -2,7 +2,7 @@
//
// FILE: PrintSize.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.1
// VERSION: 0.3.2
// PURPOSE: Class that determines printSize
// DATE: 2017-12-09
// URL: https://github.com/RobTillaart/PrintSize
@ -15,12 +15,12 @@
// 0.3.0 2021-01-06 Arduino-CI + unit test
// 0.3.1 2021-11-13 update Arduino-CI, readme.md, badges
// add write(str, length) for Print interface.
//
// 0.3.2 2021-12-24 update library.json, license, minor edits
#include "Print.h"
#define PRINTSIZE_VERSION (F("0.3.1"))
#define PRINTSIZE_VERSION (F("0.3.2"))
class PrintSize: public Print
@ -32,7 +32,6 @@ public:
};
size_t write(uint8_t c) // note: warning unused parameter
{
_total++;
@ -58,4 +57,6 @@ private:
};
// -- END OF FILE --

View File

@ -1,10 +1,8 @@
//
// FILE: PrintSize1.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: demo printSize
// URL: https://github.com/RobTillaart/PrintSize
//
#include "PrintSize.h"

View File

@ -1,10 +1,8 @@
//
// FILE: PrintSize_centering.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: demo printSize centring
// URL: https://github.com/RobTillaart/PrintSize
//
#include "PrintSize.h"

View File

@ -1,12 +1,9 @@
//
// FILE: PrintSize_printf.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo printSize printf
//
// NOTE:
// - UNO does not support printf, - ESP32 does
//
// NOTE: - UNO does not support printf, - ESP32 does
#include "PrintSize.h"

View File

@ -1,11 +1,9 @@
//
// FILE: PrintSize_total.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: demo printSize total counter
// URL: https://github.com/RobTillaart/PrintSize
//
/*
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mattis eget odio ut
tempor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin consectetur,

View File

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

View File

@ -1,5 +1,5 @@
name=PrintSize
version=0.3.1
version=0.3.2
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Library to determine size of a printed variable.

View File

@ -38,7 +38,7 @@ Can be used to calculate the needed space.
- to properly do a right alignment e.g. for numbers or variable text.
- do left alignment and overwrite previous output with just enough spaces.
- centring of numbers.
- see if output will fit into a line / display
- see if output will fit into a line / display.
- see if a string fits in EEPROM or any other storage medium.
- see if a string fits in a communication buffer.
@ -47,6 +47,6 @@ Can be used to calculate the needed space.
- add examples
- 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)**.
-

View File

@ -38,6 +38,7 @@
unittest_setup()
{
fprintf(stderr, "PRINTSIZE_VERSION: %s\n", (char *) PRINTSIZE_VERSION);
}
unittest_teardown()
@ -59,8 +60,6 @@ unittest(test_new_operator)
unittest(test_constructor)
{
fprintf(stderr, "VERSION: %s\n", (char *) PRINTSIZE_VERSION);
PrintSize ps;
assertEqual(0, ps.total());
@ -70,8 +69,6 @@ unittest(test_constructor)
unittest(test_print)
{
fprintf(stderr, "VERSION: %s\n", (char *) PRINTSIZE_VERSION);
PrintSize ps;
assertEqual(0, ps.total());
@ -92,8 +89,6 @@ unittest(test_print)
unittest(test_write)
{
fprintf(stderr, "VERSION: %s\n", (char *) PRINTSIZE_VERSION);
PrintSize ps;
assertEqual(0, ps.total());