⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 string.cpp

📁 MONA是为数不多的C++语言编写的一个很小的操作系统
💻 CPP
字号:
/*Copyright (c) 2004 baysideAll rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:1. Redistributions of source code must retain the above copyright   notice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright   notice, this list of conditions and the following disclaimer in the   documentation and/or other materials provided with the distribution.3. The name of the author may not be used to endorse or promote products   derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OFTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/#include "baygui.h"/** 僐儞僗僩儔僋僞 */String::String(char *s){	c_str = (char *)malloc(strlen(s) + 1);	memcpy(c_str, s, strlen(s) + 1);}/** 僨僗僩儔僋僞 */String::~String(){	free(c_str);}/** 暥帤楍偺挿偝傪曉偡 */int String::length(){	return strlen(c_str);}/** 暥帤楍傪曉偡 */char *String::toString(){	return c_str;}#if 0/** 巜掕偟偨暥帤楍偱巒傑偭偰偄傞偐偳偆偐敾掕偡傞 */bool String::startsWith(String *s){	return false;}/** 巜掕偟偨暥帤楍偱廔傢偭偰偄傞偐偳偆偐敾掕偡傞 */bool endsWidth(String *s){	return false;}/** 巜掕偟偨暥帤楍偲摍偟偄偐偳偆偐敾掕偡傞 */bool String::equals(String *s){	return false;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -