...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Boost.Nowide
|
args
is a class that temporarily replaces standard main() function arguments with their equal, but UTF-8 encoded values under Microsoft Windows for the lifetime of the instance.
More...
#include <boost/nowide/args.hpp>
Public Member Functions | |
args (int &argc, char **&argv) | |
args (int &argc, char **&argv, char **&env) | |
~args () | |
args
is a class that temporarily replaces standard main() function arguments with their equal, but UTF-8 encoded values under Microsoft Windows for the lifetime of the instance.
The class uses GetCommandLineW()
, CommandLineToArgvW()
and GetEnvironmentStringsW()
in order to obtain Unicode-encoded values. It does not relate to actual values of argc, argv and env under Windows.
It restores the original values in its destructor (usually at the end of the main
function).
If any of the system calls fails, an exception of type std::runtime_error will be thrown and argc, argv, env remain unchanged.
Usage:
|
inline |
Fix command line arguments
|
inline |
Fix command line arguments and environment
|
inline |
Restore original argc, argv, env values, if changed