AceCommon  1.5.2
Arduino library for low-level common functions and features with no external dependencies
AceCommon.h
1 /*
2 MIT License
3 
4 Copyright (c) 2020 Brian T. Park
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 
36 #ifndef ACE_COMMON_H
37 #define ACE_COMMON_H
38 
39 // Blacklist platforms using https://github.com/arduino/ArduinoCore-api due to
40 // incompatibilities. This currently includes all megaAVR boards and SAMD21
41 // boards using arduino::samd >= 1.8.10.
42 #if defined(ARDUINO_API_VERSION)
43 #error Platforms using ArduinoCore-API not supported
44 #endif
45 
46 #include "arithmetic/arithmetic.h"
47 
48 #include "pstrings/pstrings.h"
49 #include "fstrings/FCString.h"
50 #include "fstrings/FlashString.h"
51 #include "kstrings/KString.h"
52 #include "cstrings/copyReplace.h"
53 
54 #include "print_str/PrintStr.h"
55 
56 #include "print_utils/printPadTo.h"
57 #include "print_utils/printfTo.h"
60 
61 #include "timing_stats/TimingStats.h"
62 #include "timing_stats/GenericStats.h"
63 
66 
67 #include "hash/djb2.h"
68 
70 #include "algorithms/isSorted.h"
72 #include "algorithms/reverse.h"
73 
74 // Version format: "xx.yy.zz" => xxyyzz (without leading 0)
75 #define ACE_COMMON_VERSION 10502
76 #define ACE_COMMON_VERSION_STRING "1.5.2"
77 
78 #endif
Common functions involving arithmetics such as incrementing, addition, subtraction,...
Provides 2 functions to perform backslash-x encoding and decoding.
Templatized implementation of binary search function over a sorted array of things.
Functions that copy c-strings from src to dst while replacing a given character with another characte...
Implement the djb2 hash algorithm (http://www.cse.yorku.ca/~oz/hash.html) for normal strings and flas...
Templatized functions that determine if an array of things is sorted.
Templatized implementation of linear search function over an array of things, which is not necessaril...
Print integers as floating point numbers, without using floatin point operations which are expensive ...
Various function that prints a uint16_t integer using N decimal places, padded with a space or 0 char...
Functions that print strings from src to the given Print object while replacing a given character wit...
Implement a printfTo() that accept formatting strings like printf() and prints the result to the give...
String functions on strings stored in flash memory through the PROGMEM attribute.
Templatized function that reverses the elements of a given array.
Provides 2 functions to perform URL form encoding and decoding.