console.cpp

来自「MONA是为数不多的C++语言编写的一个很小的操作系统」· C++ 代码 · 共 33 行

CPP
33
字号
// This file is in the public domain.// There are no restrictions on any sort of usage of this file.#ifdef MONA#include <monapi.h>#else#include <stdio.h>#endif#include <gui/System/Console.h>namespace System{	void Console::Write(String text)	{		int len = text.get_Length();		char* buf = new char[len + 1];		for (int i = 0; i < len; i++)		{			wchar ch = text[i];			buf[i] = ch < 128 ? (char)ch : '?';		}		buf[len] = '\0';		::printf(buf);		delete [] buf;	}		void Console::WriteLine(String text)	{		Console::Write(text);		::printf("\n");	}}

⌨️ 快捷键说明

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