Console

Console class

Provides methods for outputting data to the standard output stream. This is a static type with no instance services. You should never create instances of it by any means.

class Console

Methods

MethodDescription
static void Beep()NOT IMPLEMENTED.
static SharedPtr<System::IO::TextWriter>& get_Error()Returns a shared pointer pointing to the object that represents the standard error stream.
static SharedPtr<System::IO::TextReader>& get_In()Returns a shared pointer pointing to the object that represents the standard input stream.
static SharedPtr<System::IO::TextWriter>& get_Out()Returns a shared pointer pointing to the object that represents the standard output stream.
static void Mute(bool)Mutes or unmutes the standard output stream.
static void ReadKey()NOT IMPLEMENTED.
static void SetError(const SharedPtr<System::IO::TextWriter>&)Assigns the specified object to the class’ Error property.
static void SetIn(const SharedPtr<System::IO::TextReader>&)Sets the In property to the specified TextReader object.
static void SetOut(const SharedPtr<System::IO::TextWriter>&)Assigns the specified object to the class’ Out property.
static void Write(const SharedPtr<T>&)Outputs the string representation of the specified object to the standard output stream.
static void Write(bool)Outputs the string representation of bool value to the standard output stream.
static void Write(char_t)Outputs the specified character value to the standard output stream.
static void Write(const ArrayPtr<char_t>&)Outputs the string representation of the specified character array to the standard output stream.
static void Write(const Decimal&)Outputs the string representation of Decimal value to the standard output stream.
static void Write(double)Outputs the string representation of double-precision floating-point value to the standard output stream.
static void Write(float)Outputs the string representation of single-precision floating-point value to the standard output stream.
static void Write(int32_t)Outputs the string representation of 32-bit integer value to the standard output stream.
static void Write(int64_t)Outputs the string representation of 64-bit integer value to the standard output stream.
static void Write(const String&)Outputs the specified string object to the standard output stream.
static void Write(const char_t *)Outputs the specified c-string to the standard output stream.
static void Write(const TypeInfo&)Outputs the string representation of TypeInfo value to the standard output stream.
static void Write(uint32_t)Outputs the string representation of unsigned 32-bit integer value to the standard output stream.
static void Write(uint64_t)Outputs the string representation of unsigned 64-bit integer value to the standard output stream.
static void Write(const ArrayPtr<char_t>&, int32_t, int32_t)Outputs the string representation of the specified range of the specified character array to the standard output stream.
static void Write(const String&, Args&&…)Outputs the string representation of the specified arguments formatted according to the specified format to the standard output stream.
static void Write(const char *)
static void WriteLine()Outputs the current line terminator to the standard output stream.
static void WriteLine(const SharedPtr<T>&)Outputs the string representation of the specified object followed by the current line terminator to the standard output stream.
static void WriteLine(bool)Outputs the string representation of bool value followed by the current line terminator to the standard output stream.
static void WriteLine(char_t)Outputs the specified character value followed by the current line terminator to the standard output stream.
static void WriteLine(const ArrayPtr<char_t>&)Outputs the string representation of the specified character array followed by the current line terminator to the standard output stream.
static void WriteLine(const Decimal&)Outputs the string representation of Decimal value followed by the current line terminator to the standard output stream.
static void WriteLine(double)Outputs the string representation of double-precision floating-point value followed by the current line terminator to the standard output stream.
static void WriteLine(float)Outputs the string representation of single-precision floating-point value followed by the current line terminator to the standard output stream.
static void WriteLine(int32_t)Outputs the string representation of 32-bit integer value followed by the current line terminator to the standard output stream.
static void WriteLine(int64_t)Outputs the string representation of 64-bit integer value followed by the current line terminator to the standard output stream.
static void WriteLine(const String&)Outputs the specified string object followed by the current line terminator to the standard output stream.
static void WriteLine(const char_t *)Outputs the specified c-string followed by the current line terminator to the standard output stream.
static void WriteLine(const TypeInfo&)Outputs the string representation of TypeInfo value followed by the current line terminator to the standard output stream.
static void WriteLine(uint32_t)Outputs the string representation of unsigned 32-bit integer value followed by the current line terminator to the standard output stream.
static void WriteLine(uint64_t)Outputs the string representation of unsigned 64-bit integer value followed by the current line terminator to the standard output stream.
static void WriteLine(const ArrayPtr<char_t>&, int, int)Outputs the string representation of the specified range of the specified character array followed by the current line terminator to the standard output stream.
static void WriteLine(const Exception&)Outputs the string representation of the specified Exception object followed by the current line terminator to the standard output stream.
static void WriteLine(const String&, Args&&…)Outputs the string representation of the specified arguments formatted according to the specified format followed by the current line terminator to the standard output stream.
static void WriteLine(const char *)

Remarks

#include "system/console.h"
#include <array>

int main()
{
  using namespace System;

  // Print the hello message.
  Console::WriteLine(u"Hello, world!");

  // Create an instance of the 'std::array' class.
  std::array<int, 5> arr = {1, 2, 3, 4, 5};

  // Print elements of the array.
  for (auto el: arr)
  {
    Console::Write(u"{0} ", el);
  }
  Console::WriteLine();

  return 0;
}
/*
This code example produces the following output:
Hello, world!
1 2 3 4 5
*/

See Also