Using std::string instead of std::wstring for command-line args

Turns out that even if I manage to get Unicode command line args,
there still is no portable way of opening a file from a Unicode path.
This commit is contained in:
Daniel Wolf
2015-11-25 22:04:48 +01:00
parent 27ba3ef357
commit 7b282ce50f
3 changed files with 2 additions and 28 deletions

View File

@@ -9,7 +9,6 @@
using std::exception;
using std::string;
using std::wstring;
using std::unique_ptr;
using std::map;
using std::chrono::duration;
@@ -70,11 +69,10 @@ ptree createXmlTree(const path& filePath, const map<centiseconds, Phone>& phones
int main(int argc, char *argv[]) {
try {
// Get sound file name
std::vector<wstring> commandLineArgs = getCommandLineArgs(argc, argv);
if (commandLineArgs.size() != 2) {
if (argc != 2) {
throw std::runtime_error("Invalid command line arguments. Call with sound file name as sole argument.");
}
wstring soundFileName = commandLineArgs[1];
string soundFileName = argv[1];
// Create audio streams
unique_ptr<AudioStream> audioStream = createAudioStream(soundFileName);