{"id":20526316,"url":"https://github.com/powerbroker2/safestring","last_synced_at":"2025-08-04T07:10:39.572Z","repository":{"id":39585987,"uuid":"271627952","full_name":"PowerBroker2/SafeString","owner":"PowerBroker2","description":"This SafeString library is designed for beginners to be a safe, robust and debuggable replacement for string processing in Arduino. Note, this is NOT my work, I am simply hosting it for easy access. The original code belongs to Forward Computing and Control Pty. Ltd.","archived":false,"fork":false,"pushed_at":"2025-06-19T02:40:06.000Z","size":1128,"stargazers_count":41,"open_issues_count":0,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-19T03:33:38.187Z","etag":null,"topics":["arduino-string","safestring"],"latest_commit_sha":null,"homepage":"https://www.forward.com.au/pfod/ArduinoProgramming/SafeString/index.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerBroker2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-11T19:13:27.000Z","updated_at":"2025-06-19T02:38:19.000Z","dependencies_parsed_at":"2023-02-11T11:01:03.820Z","dependency_job_id":"cbdd4267-8f3d-47d6-ab2b-cd117972ece7","html_url":"https://github.com/PowerBroker2/SafeString","commit_stats":null,"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/PowerBroker2/SafeString","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FSafeString","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FSafeString/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FSafeString/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FSafeString/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerBroker2","download_url":"https://codeload.github.com/PowerBroker2/SafeString/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FSafeString/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268660147,"owners_count":24286028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-string","safestring"],"created_at":"2024-11-15T23:13:38.718Z","updated_at":"2025-08-04T07:10:39.552Z","avatar_url":"https://github.com/PowerBroker2.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SafeString\nThis SafeString library is designed for beginners to be a safe, robust and debuggable replacement for string processing in Arduino and provides non-blocking text I/O and parsing and testing for Real World use.\n\nThis library includes:-  \n* **SafeString**, a safe, robust and debuggable replacement for string processing in Arduino  \n* **SafeStringReader**, a non-blocking tokenizing text reader replacement for Serial read()  \n* **BufferedOutput**, non-blocking replacement for Serial print()  \n* **SafeStringStream**, a stream to provide test inputs for repeated testing of I/O sketches   \n* **BufferedInput**, extra buffering for text input  \n* **loopTimer**, (loopTimerClass) to track of the maximum and average run times for the loop()  \n* **millisDelay**, a non-blocking delay replacement, with single-shot, repeating, restart and stop facilities.  \n* **PinFlasher**, a non-blocking flashing of an output pin.  \n* **SerialComs**, to send messages between Arduinos via Serial\n\n  To create SafeStrings use one of the four (4) macros **createSafeString** or **cSF**, **createSafeStringFromCharArray** or **cSFA**, **createSafeStringFromCharPtr** or **cSFP**, **createSafeStringFromCharPtrWithSize** or **cSFPS**\u003cbr\u003e \n  For example sketches see SafeString_ConstructorAndDebugging.ino, SafeStringFromCharArray.ino, SafeStringFromCharPtr.ino and SafeStringFromCharPtrWithSize.ino\u003cbr\u003e\n  and the [SafeString Tutorial](https://www.forward.com.au/pfod/ArduinoProgramming/SafeString/index.html)\n    \n# How-To\nSee [SafeString Documentation](https://www.forward.com.au/pfod/ArduinoProgramming/SafeString/docs/html/index.html)  \nSee [SafeString Tutorial](https://www.forward.com.au/pfod/ArduinoProgramming/SafeString/index.html)  \nSee [Arduino to Arduino/PC via Serial](https://www.forward.com.au/pfod/ArduinoProgramming/SoftwareSolutions/ComsPair.html)  \nSee [Arduino Text I/O for the Real World](https://www.forward.com.au/pfod/ArduinoProgramming/Serial_IO/index.html)  \nSee [Simple Multitasking Arduino](https://www.forward.com.au/pfod/ArduinoProgramming/RealTimeArduino/index.html)  \nSee [How to code Timers and Delays in Arduino](https://www.forward.com.au/pfod/ArduinoProgramming/TimingDelaysInArduino.html)  \n\n# Sparkfun SAMD compile issue  \nSee issue https://github.com/PowerBroker2/SafeString/issues/73  \n\nSparkfun's SAMD board support does not provide a define to distinguish it from Arduino's SAMD boards.  \nThis causes SafeString compile to fail with  \n    \n **error: expected class-name before '{' token 73 | class SafeStringReader : public SafeString {**      \n\nThis fix is to remove the contents of these three header files  \nSafeStringNameSpace.h  \nSafeStringNameSpaceEnd.h  \nSafeStringNameSpaceStart.h  \n\nThat is just have empty files for those three headers.  \n\n# PlatformIO support\nThis library is primarily an Arduino IDE library, but users have had success using it with PlatformIO.  \nSee the PlatformIO subdirectory for the two PlatformIO versions.  One for boards that use the arduino namespace, e.g. Arduino Zero, and one for boards that don't, e.g. UNO.\nTo see which board yours is, check the Print.h file and see if it includes the lines   \n\n    namespace arduino {  \n    class Print    \n\nIf it does, then unzip the SafeStringIO_namespace.zip and use that library.  If it does not, then unzip the SafeStringIO.zip and use that library.\n\n# Software License\nSee the top of each file for its license\n\n# Note\nNote, this is NOT my work, I am simply hosting it for easy access. The original code belongs to [Forward Computing and Control Pty. Ltd](https://www.forward.com.au/pfod/ArduinoProgramming/SafeString/index.html).\n\n# Revisions\nV4.1.41 fixed millisDelay repeat after stop()/finish()    \nV4.1.40 add support for separate setting of on and off times for PinFlasher    \nV4.1.39 add int64_t for += and -= operators  \nV4.1.38 corrected print(int64_t)  \nV4.1.37 added print(int64_t) support and check for invalid bases.  \nV4.1.36 added toInt64_t for parsing time_t inputs.  \nV4.1.35 minor edit to BufferedOutput  \nV4.1.34 fixed SafeStringLengthTrim example (removed unsupported setLength() calls)  \nV4.1.33 fix for bool for SAM boards  \nV4.1.32 added support for Adafruit SAMD boards  \nV4.1.31 added support for other Arduino MBED boards like Opta   \nV4.1.30 added default initializations   \nV4.1.29 removed F() macro and FlashStringHelper class from SafeString.h.  SafeString now depends of the board's core to define these.   \nV4.1.28 fixes for Arduino UNO R4 and R4 WiFi   \nV4.1.27 revised defines for Arduino Zero   \nV4.1.26 fixed F()for Arduino IDE 2 and ESP32     \nV4.1.25 added NULL detection to readFrom(const char*, unsigned int maxCharsToRead)     \nV4.1.24 added NULL detection to readFrom(const char*)     \nV4.1.23 added readFrom(const char*)     \nV4.1.22 added link to docs in README.md     \nV4.1.21 minor change document correction     \nV4.1.20 fixed for ESP32 V2.0.3 dtostrf     \nV4.1.19 minor change to PinFlasher to support ESP32_WS2812Flasher extension     \nV4.1.18 changed firstToken() arguments now defaults to returning empty tokens     \nV4.1.17 restored firstToken() method     \nV4.1.16 minor text corrections, SafeStringReader.getDelimiter() now returns int, fix for SafeStringReader.flushInput()     \nV4.1.15 added support for ARDUINO_ARCH_NRF52 and ARDUINO_ARCH_NRF5    \nV4.1.14 minor fix PinFlasher  \nV4.1.13 minor change PinFlasher to simplify loop logic    \nV4.1.12 adds PinFlasher class  \nV4.1.11 adds support for Ardafruit M4 and Moteino M4  \nV4.1.10 fixed SafeStringStream to handle data \u003e= 0x80  \nV4.1.9 added toUnsignedLong coversions, removed firstToken()  \nV4.1.7-8 added MegaTinyCore support \nV4.1.6 added Teensy2 to Teensy4.1 support (dtostrf)  \nV4.1.5 SerialComs timeout 5sec, added firstToken()  \nV4.1.4 fixed dtostrf support  \nV4.1.3 added Arduino Due support  \nV4.1.2 fixed SerialComs when msg times out without delimiter, fixed support for Adafruit Feather nRF52 (V0.21.0)  \nV4.1.1 fixed nullpointer, check for Out-Of-Memory on createSafeString, support for Earl Philhower's pi pico board package  \nV4.1.0 added SerialComs class for Arduino to Arduino/PC via Serial, added fixed width formatting, print(value,decPlaces,width) see example SafeString_Tests/SafeString_fixedWidthFormat.ino  \nV4.0.5 added returnEmptyTokens() option to SafeStringReader  \nV4.0.4 adds support for Raspberry Pi Pico using Arduino Mbed OS RP2040 V2.0.0 board package ,nextToken() now returns last un-terminated token by default (can be overridded by optional arg), option to return empty tokens  \nV4.0.3 allow createSafeString for small sizes, fixed bool for DUE (ARDUINO_ARCH_SAM)  \nV4.0.2 added flushInput() method to SafeStringReader  \nV4.0.1 fixed SafeStringReader timeout and NanoBLE F() macro  \nV4.0.0 changes method returns to better match Arduino String methods, main change is indexOf now returns int and returns -1 if not found  \nV3.1.0 adds hasError() method  \nV3.0.6 adds support for Arduino megaAVR boards  \nV3.0.5 adds support for SparkFun Redboard Turbo,but may interfer with other SAM ZERO based boards, also adds support for Due and STM32F1 and STM32F4  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerbroker2%2Fsafestring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerbroker2%2Fsafestring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerbroker2%2Fsafestring/lists"}