|
Bond 0.9
C++ Bond Runtime Library API Documentation
|
Provides a program's command line arguments encoded in UTF-8. More...
#include <bond/tools/commandline.h>
Public Member Functions | |
| CommandLineArgs (Allocator &allocator, int argc, const char *argv[]) | |
| Constructs a CommandLineArgs object. | |
| CommandLineArgs (const CommandLineArgs &other)=delete | |
| CommandLineArgs & | operator= (const CommandLineArgs &other)=delete |
| int | GetArgc () const |
| Returns the number of arguments, including the program name. | |
| const char ** | GetArgv () const |
| Returns the UTF-8 encoded, null-terminated argument vector. It remains valid for the lifetime of this object. | |
Provides a program's command line arguments encoded in UTF-8.
On Windows, the narrow argv passed to main is encoded in the ANSI code page, so non-ASCII arguments are altered or lost. CommandLineArgs retrieves the UTF-16 command line from the operating system and converts each argument to UTF-8. If that fails, it falls back to the given argv. On other platforms, argv is already UTF-8 and is returned unchanged.
| Bond::CommandLineArgs::CommandLineArgs | ( | Allocator & | allocator, |
| int | argc, | ||
| const char * | argv[] ) |
Constructs a CommandLineArgs object.
| allocator | Allocator used for the converted arguments. It must outlive this object. |
| argc | The argument count passed to main. |
| argv | The argument vector passed to main. |
|
delete |
|
inline |
Returns the number of arguments, including the program name.
|
inline |
Returns the UTF-8 encoded, null-terminated argument vector. It remains valid for the lifetime of this object.
|
delete |