diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 21:50:13 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 21:50:13 +0000 |
commit | e83eedcd41bdebf055f130051d2c84d39f27a466 (patch) | |
tree | 2108eb93717e3629397246e25b98afe3798525c9 /media/tools/media_bench | |
parent | e62dbbfc6f722159733239d396098e2e0407f56f (diff) | |
download | chromium_src-e83eedcd41bdebf055f130051d2c84d39f27a466.zip chromium_src-e83eedcd41bdebf055f130051d2c84d39f27a466.tar.gz chromium_src-e83eedcd41bdebf055f130051d2c84d39f27a466.tar.bz2 |
file_util: deprecate remaining wstring functions
This removes the last wstring-accepting functions from file_util
on non-Windows platforms.
BUG=24672
Review URL: http://codereview.chromium.org/3005005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools/media_bench')
-rw-r--r-- | media/tools/media_bench/media_bench.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/media/tools/media_bench/media_bench.cc b/media/tools/media_bench/media_bench.cc index 926d283..ad6a7c2 100644 --- a/media/tools/media_bench/media_bench.cc +++ b/media/tools/media_bench/media_bench.cc @@ -89,6 +89,9 @@ int main(int argc, const char** argv) { CommandLine::Init(argc, argv); const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + // TODO(evanm): GetLooseValues() should return a + // CommandLine::StringType, which can be converted to FilePaths + // directly. std::vector<std::wstring> filenames(cmd_line->GetLooseValues()); if (filenames.empty()) { std::cerr << "Usage: " << argv[0] << " [OPTIONS] FILE [DUMPFILE]\n" @@ -126,10 +129,11 @@ int main(int argc, const char** argv) { } // Retrieve command line options. - std::string in_path(WideToUTF8(filenames[0])); - std::string out_path; + std::string in_path(WideToASCII(filenames[0])); + FilePath out_path; if (filenames.size() > 1) { - out_path = WideToUTF8(filenames[1]); + // See TODO above the declaration of filenames. + out_path = FilePath::FromWStringHack(filenames[1]); } CodecType target_codec = CODEC_TYPE_UNKNOWN; @@ -246,19 +250,19 @@ int main(int argc, const char** argv) { FILE *output = NULL; if (!out_path.empty()) { // TODO(fbarchard): Add pipe:1 for piping to stderr. - if (!strncmp(out_path.c_str(), "pipe:", 5) || - !strcmp(out_path.c_str(), "-")) { + if (out_path.value().substr(0, 5) == FILE_PATH_LITERAL("pipe:") || + out_path.value() == FILE_PATH_LITERAL("-")) { output = stdout; log_out = &std::cerr; #if defined(OS_WIN) _setmode(_fileno(stdout), _O_BINARY); #endif } else { - output = file_util::OpenFile(out_path.c_str(), "wb"); + output = file_util::OpenFile(out_path, "wb"); } if (!output) { std::cerr << "Error: Could not open output " - << out_path << std::endl; + << out_path.value() << std::endl; return 1; } } |