Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A small class to interface the C++/C console IO functions into Objective-C for console apps
Objective-C++ Objective-C
Branch: master
Pull request Compare This branch is even with Linux-cpp-lisp:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LCTerminal.h
LCTerminal.mm
README.md
example.mm

README.md

LCTerminal

A small class to interface the C++/C console IO functions into Objective-C for console apps. Written in Objective-C++.

Example

[LCTerminal printString:@"Hello, world"];
[LCTerminal printString:[LCTerminal readString]];
[LCTerminal printStringWithFormat:@"Hello, %@", @"John"];
[LCTerminal printStringWithFormat:@"Your Number: %i", [LCTerminal readInt]];
[LCTerminal printStringWithFormat:@"Your Float: %f", [LCTerminal readFloat]];

Documentation

Class LCTerminal

+(void)printStringWithFormat:(NSString*)format,...;

Prints the string format formatted with the other arguments by using [NSString stringWithFormat], followed by a newline.

+(void)printStringWithoutNewlineWithFormat:(NSString*)format,...;

Same as printStringWithFormat, except without a trailing newline.

+(void)printString:(NSString*)str;

Prints string str to the console, followed by a newline.

+(void)printStringWithoutNewline:(NSString *)str;

Same as printString, but without the trailing newline.

+(int)readInt;

Inputs an integer from the terminal.

+(float)readFloat;

Inputs a float from the terminal.

+(NSString*)readString;

Inputs a string from the terminal.

+(NSURL*)readURL;

Inputs a URL from the terminal.

Licence

This code is released under the LGPLv3 licence.

Something went wrong with that request. Please try again.