System::Console Class Reference

Static Public Member Functions

template<class T >
static void Write (const SharedPtr< T > &object)
 
static ASPOSECPP_SHARED_API void Write (bool value)
 
static ASPOSECPP_SHARED_API void Write (char_t value)
 
static ASPOSECPP_SHARED_API void Write (const ArrayPtr< char_t > &buffer)
 
static ASPOSECPP_SHARED_API void Write (const Decimal &value)
 
static ASPOSECPP_SHARED_API void Write (double value)
 
static ASPOSECPP_SHARED_API void Write (float value)
 
static ASPOSECPP_SHARED_API void Write (int32_t value)
 
static ASPOSECPP_SHARED_API void Write (int64_t value)
 
static ASPOSECPP_SHARED_API void Write (const String &value)
 
static ASPOSECPP_SHARED_API void Write (const char_t *value)
 
static ASPOSECPP_SHARED_API void Write (const TypeInfo &value)
 
static ASPOSECPP_SHARED_API void Write (uint32_t value)
 
static ASPOSECPP_SHARED_API void Write (uint64_t value)
 
static ASPOSECPP_SHARED_API void Write (const ArrayPtr< char_t > &buffer, int32_t index, int32_t count)
 
template<class... Args>
static void Write (const String &format, Args &&... args)
 
static ASPOSECPP_SHARED_API void WriteLine ()
 Outputs the current line terminator to the standard output stream. More...
 
template<class T >
static void WriteLine (const SharedPtr< T > &object)
 
static ASPOSECPP_SHARED_API void WriteLine (bool value)
 
static ASPOSECPP_SHARED_API void WriteLine (char_t value)
 
static ASPOSECPP_SHARED_API void WriteLine (const ArrayPtr< char_t > &buffer)
 
static ASPOSECPP_SHARED_API void WriteLine (const Decimal &value)
 
static ASPOSECPP_SHARED_API void WriteLine (double value)
 
static ASPOSECPP_SHARED_API void WriteLine (float value)
 
static ASPOSECPP_SHARED_API void WriteLine (int32_t value)
 
static ASPOSECPP_SHARED_API void WriteLine (int64_t value)
 
static ASPOSECPP_SHARED_API void WriteLine (const String &value)
 
static ASPOSECPP_SHARED_API void WriteLine (const char_t *value)
 
static ASPOSECPP_SHARED_API void WriteLine (const TypeInfo &value)
 
static ASPOSECPP_SHARED_API void WriteLine (uint32_t value)
 
static ASPOSECPP_SHARED_API void WriteLine (uint64_t value)
 
static ASPOSECPP_SHARED_API void WriteLine (const ArrayPtr< char_t > &buffer, int index, int count)
 
static ASPOSECPP_SHARED_API void WriteLine (const Exception &e)
 
template<class... Args>
static void WriteLine (const String &format, Args &&... args)
 
static void Write (const char *)=delete
 
static void WriteLine (const char *)=delete
 
static void Beep ()
 
static ASPOSECPP_SHARED_API SharedPtr< System::IO::TextWriter > & get_Out ()
 Returns a shared pointer pointing to the object that represents the standard output stream. More...
 
static ASPOSECPP_SHARED_API SharedPtr< System::IO::TextWriter > & get_Error ()
 Returns a shared pointer pointing to the object that represents the standard error stream. More...
 
static ASPOSECPP_SHARED_API SharedPtr< System::IO::TextReader > & get_In ()
 Returns a shared pointer pointing to the object that represents the standard input stream. More...
 
static ASPOSECPP_SHARED_API void SetOut (const SharedPtr< System::IO::TextWriter > &value)
 
static ASPOSECPP_SHARED_API void SetError (const SharedPtr< System::IO::TextWriter > &value)
 
static ASPOSECPP_SHARED_API void SetIn (const SharedPtr< System::IO::TextReader > &value)
 
static ASPOSECPP_SHARED_API void Mute (bool muted)
 
static ASPOSECPP_SHARED_API void ReadKey ()
 NOT IMPLEMENTED. More...
 

Detailed Description

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.

#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);
}
return 0;
}
/*
* This code example produces the following output:
* Hello, world!
* 1 2 3 4 5
*/

Member Function Documentation

◆ Beep()

static void System::Console::Beep ( )
inlinestatic

NOT IMPLEMENTED.

Exceptions
NotImplementedExceptionAlways

◆ get_Error()

static ASPOSECPP_SHARED_API SharedPtr<System::IO::TextWriter>& System::Console::get_Error ( )
static

Returns a shared pointer pointing to the object that represents the standard error stream.

◆ get_In()

static ASPOSECPP_SHARED_API SharedPtr<System::IO::TextReader>& System::Console::get_In ( )
static

Returns a shared pointer pointing to the object that represents the standard input stream.

◆ get_Out()

static ASPOSECPP_SHARED_API SharedPtr<System::IO::TextWriter>& System::Console::get_Out ( )
static

Returns a shared pointer pointing to the object that represents the standard output stream.

◆ Mute()

static ASPOSECPP_SHARED_API void System::Console::Mute ( bool  muted)
static

Mutes or unmutes the standard output stream.

Parameters
mutedSpecifies if the standard output stream should be muted (true) or unmuted (false)

◆ ReadKey()

static ASPOSECPP_SHARED_API void System::Console::ReadKey ( )
static

NOT IMPLEMENTED.

◆ SetError()

static ASPOSECPP_SHARED_API void System::Console::SetError ( const SharedPtr< System::IO::TextWriter > &  value)
static

Assigns the specified object to the class' Error property.

Parameters
valueThe TextWrite object to assign to the Error property

◆ SetIn()

static ASPOSECPP_SHARED_API void System::Console::SetIn ( const SharedPtr< System::IO::TextReader > &  value)
static

Sets the In property to the specified TextReader object.

Parameters
valueThe TextReader object to assign to the In property

◆ SetOut()

static ASPOSECPP_SHARED_API void System::Console::SetOut ( const SharedPtr< System::IO::TextWriter > &  value)
static

Assigns the specified object to the class' Out property.

Parameters
valueThe TextWrite object to assign to the Out property

◆ Write() [1/17]

template<class T >
static void System::Console::Write ( const SharedPtr< T > &  object)
inlinestatic

Outputs the string representation of the specified object to the standard output stream.

Parameters
objectObject to output
Template Parameters
TType of the object to output

◆ Write() [2/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( bool  value)
static

Outputs the string representation of bool value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [3/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( char_t  value)
static

Outputs the specified character value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [4/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( const ArrayPtr< char_t > &  buffer)
static

Outputs the string representation of the specified character array to the standard output stream.

Parameters
bufferThe array to output

◆ Write() [5/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( const Decimal value)
static

Outputs the string representation of Decimal value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [6/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( double  value)
static

Outputs the string representation of double-precision floating-point value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [7/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( float  value)
static

Outputs the string representation of single-precision floating-point value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [8/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( int32_t  value)
static

Outputs the string representation of 32-bit integer value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [9/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( int64_t  value)
static

Outputs the string representation of 64-bit integer value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [10/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( const String value)
static

Outputs the specified string object to the standard output stream.

Parameters
valueThe string object to output

◆ Write() [11/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( const char_t *  value)
static

Outputs the specified c-string to the standard output stream.

Parameters
valueThe c-string to output

◆ Write() [12/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( const TypeInfo value)
static

Outputs the string representation of TypeInfo value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [13/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( uint32_t  value)
static

Outputs the string representation of unsigned 32-bit integer value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [14/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( uint64_t  value)
static

Outputs the string representation of unsigned 64-bit integer value to the standard output stream.

Parameters
valueThe value to output

◆ Write() [15/17]

static ASPOSECPP_SHARED_API void System::Console::Write ( const ArrayPtr< char_t > &  buffer,
int32_t  index,
int32_t  count 
)
static

Outputs the string representation of the specified range of the specified character array to the standard output stream.

Parameters
bufferThe character array
indexThe index in the array at which the range to output begins
countThe number of elements in the range to output

◆ Write() [16/17]

template<class... Args>
static void System::Console::Write ( const String format,
Args &&...  args 
)
inlinestatic

Outputs the string representation of the specified arguments formatted according to the specified format to the standard output stream.

Parameters
formatThe string format
argsThe values to output
Template Parameters
Thetypes of the values to output

◆ Write() [17/17]

static void System::Console::Write ( const char *  )
staticdelete

◆ WriteLine() [1/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( )
static

Outputs the current line terminator to the standard output stream.

◆ WriteLine() [2/19]

template<class T >
static void System::Console::WriteLine ( const SharedPtr< T > &  object)
inlinestatic

Outputs the string representation of the specified object followed by the current line terminator to the standard output stream.

Parameters
objectObject to output
Template Parameters
TType of the object to output

◆ WriteLine() [3/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( bool  value)
static

Outputs the string representation of bool value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [4/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( char_t  value)
static

Outputs the specified character value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [5/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const ArrayPtr< char_t > &  buffer)
static

Outputs the string representation of the specified character array followed by the current line terminator to the standard output stream.

Parameters
bufferThe array to output

◆ WriteLine() [6/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const Decimal value)
static

Outputs the string representation of Decimal value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [7/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( double  value)
static

Outputs the string representation of double-precision floating-point value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [8/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( float  value)
static

Outputs the string representation of single-precision floating-point value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [9/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( int32_t  value)
static

Outputs the string representation of 32-bit integer value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [10/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( int64_t  value)
static

Outputs the string representation of 64-bit integer value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [11/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const String value)
static

Outputs the specified string object followed by the current line terminator to the standard output stream.

Parameters
valueThe string object to output

◆ WriteLine() [12/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const char_t *  value)
static

Outputs the specified c-string followed by the current line terminator to the standard output stream.

Parameters
valueThe c-string to output

◆ WriteLine() [13/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const TypeInfo value)
static

Outputs the string representation of TypeInfo value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [14/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( uint32_t  value)
static

Outputs the string representation of unsigned 32-bit integer value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [15/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( uint64_t  value)
static

Outputs the string representation of unsigned 64-bit integer value followed by the current line terminator to the standard output stream.

Parameters
valueThe value to output

◆ WriteLine() [16/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const ArrayPtr< char_t > &  buffer,
int  index,
int  count 
)
static

Outputs the string representation of the specified range of the specified character array followed by the current line terminator to the standard output stream.

Parameters
bufferThe character array
indexThe index in the array at which the range to output begins
countThe number of elements in the range to output

◆ WriteLine() [17/19]

static ASPOSECPP_SHARED_API void System::Console::WriteLine ( const Exception e)
static

Outputs the string representation of the specified Exception object followed by the current line terminator to the standard output stream.

Parameters
eThe value to output

◆ WriteLine() [18/19]

template<class... Args>
static void System::Console::WriteLine ( const String format,
Args &&...  args 
)
inlinestatic

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.

Parameters
formatThe string format
argsThe values to output
Template Parameters
Thetypes of the values to output

◆ WriteLine() [19/19]

static void System::Console::WriteLine ( const char *  )
staticdelete