2016-10-06 14:21:30 +03:00
|
|
|
/*
|
|
|
|
|
WString.cpp - String library for Wiring & Arduino
|
|
|
|
|
...mostly rewritten by Paul Stoffregen...
|
|
|
|
|
Copyright (c) 2009-10 Hernando Barragan. All rights reserved.
|
|
|
|
|
Copyright 2011, Paul Stoffregen, paul@pjrc.com
|
2019-04-26 09:41:42 -07:00
|
|
|
Modified by Ivan Grokhotkov, 2014 - esp8266 support
|
|
|
|
|
Modified by Michael C. Miller, 2015 - esp8266 progmem support
|
2016-10-06 14:21:30 +03:00
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
2019-04-26 09:41:42 -07:00
|
|
|
#include <Arduino.h>
|
2016-10-06 14:21:30 +03:00
|
|
|
#include "WString.h"
|
|
|
|
|
#include "stdlib_noniso.h"
|
|
|
|
|
|
|
|
|
|
/*********************************************/
|
|
|
|
|
/* Constructors */
|
|
|
|
|
/*********************************************/
|
|
|
|
|
|
2019-04-26 09:41:42 -07:00
|
|
|
String::String(const char *cstr) {
|
2016-10-06 14:21:30 +03:00
|
|
|
init();
|
2019-08-27 10:05:36 -07:00
|
|
|
if (cstr)
|
2016-10-06 14:21:30 +03:00
|
|
|
copy(cstr, strlen(cstr));
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 01:12:27 -05:00
|
|
|
String::String(const char *cstr, unsigned int length) {
|
|
|
|
|
init();
|
|
|
|
|
if (cstr)
|
|
|
|
|
copy(cstr, length);
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-26 09:41:42 -07:00
|
|
|
String::String(const String &value) {
|
2016-10-06 14:21:30 +03:00
|
|
|
init();
|
|
|
|
|