arduino-esp32/cores/esp32/WString.cpp

861 lines
22 KiB
C++
Raw Normal View History

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
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
*/
#include <Arduino.h>
2016-10-06 14:21:30 +03:00
#include "WString.h"
#include "stdlib_noniso.h"
/*********************************************/
/* Constructors */
/*********************************************/
String::String(const char *cstr) {
2016-10-06 14:21:30 +03:00
init();
if (cstr)
2016-10-06 14:21:30 +03:00
copy(cstr, strlen(cstr));
}
String::String(const char *cstr, unsigned int length) {
init();
if (cstr)
copy(cstr, length);
}
String::String(const String &value) {
2016-10-06 14:21:30 +03:00
init();