Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
StringMover.hpp
00001 // ArduinoJson - arduinojson.org 00002 // Copyright Benoit Blanchon 2014-2021 00003 // MIT License 00004 00005 #pragma once 00006 00007 #include <ArduinoJson/Namespace.hpp> 00008 #include <ArduinoJson/Strings/StoragePolicy.hpp> 00009 00010 namespace ARDUINOJSON_NAMESPACE { 00011 00012 class StringMover { 00013 public: 00014 StringMover(char* ptr) : _writePtr(ptr) {} 00015 00016 void startString() { 00017 _startPtr = _writePtr; 00018 } 00019 00020 const char* save() const { 00021 return _startPtr; 00022 } 00023 00024 void append(char c) { 00025 *_writePtr++ = c; 00026 } 00027 00028 bool isValid() const { 00029 return true; 00030 } 00031 00032 const char* c_str() const { 00033 return _startPtr; 00034 } 00035 00036 typedef storage_policies::store_by_address storage_policy; 00037 00038 private: 00039 char* _writePtr; 00040 char* _startPtr; 00041 }; 00042 } // namespace ARDUINOJSON_NAMESPACE
Generated on Wed Jul 13 2022 01:10:36 by
1.7.2