ChaiLove API  0.28.0
Public Member Functions
love::system Class Reference

Provides access to information about the user's system. More...

Public Member Functions

std::string getOS ()
 Gets the current operating system. More...
 
std::vector< int > getVersion ()
 Retreves the running ChaiLove version information. More...
 
std::string getVersionString ()
 Retreves the running ChaiLove version, as a string. More...
 
std::string getUsername ()
 Gets the current user's name, if available. More...
 
bool execute (const std::string &command)
 Execute an operating system shell command. More...
 
std::string getClipboardText ()
 Gets text from the clipboard. More...
 
systemsetClipboardText (const std::string &text)
 Gets text from the clipboard. More...
 

Detailed Description

Provides access to information about the user's system.

Member Function Documentation

◆ execute()

bool love::system::execute ( const std::string &  command)

Execute an operating system shell command.

This is like the C system() function.

Returns
True or False depending on whether or not the command started properly.

◆ getClipboardText()

std::string love::system::getClipboardText ( )

Gets text from the clipboard.

Note: This is emulated, and not the actual system clipboard text.

Returns
The text currently held in the clipboard.
See also
love.system.setClipboardText

◆ getOS()

std::string love::system::getOS ( )

Gets the current operating system.

Returns
The current operating system. "OS X", "Windows", "Linux", "Android" or "iOS".

◆ getUsername()

std::string love::system::getUsername ( )

Gets the current user's name, if available.

When not available, will return an empty string.

Returns
The username of the current user, or an empty string otherwise.

◆ getVersion()

std::vector<int> love::system::getVersion ( )

Retreves the running ChaiLove version information.

Returns
A vector, with the major being the first element, minor being the second, and patch being the third.
See also
love.system.getVersionString

◆ getVersionString()

std::string love::system::getVersionString ( )

Retreves the running ChaiLove version, as a string.

Returns
A string representing ChaiLove's version. Example: 1.3.2
See also
love.system.getVersion

◆ setClipboardText()

system& love::system::setClipboardText ( const std::string &  text)

Gets text from the clipboard.

Parameters
textThe new text to hold in the system's clipboard.
Returns
The system module, for method chaining.
See also
love.system.getClipboardText