From 63597e4ebc117bb561b93f4d775d787120e6728a Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 8 Jul 2010 17:49:05 +0000 Subject: Deprecate most of the remaining wstring file_util functions. These still exist on Windows due to being used by the installer, but by moving them into the Windows-only block we prevent them from being used in new code. (I am already finding new code using some of these! I am glad to be rid of them.) BUG=24672 Review URL: http://codereview.chromium.org/2850042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51862 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/tools/convert_dict/aff_reader.cc | 3 ++- chrome/tools/convert_dict/dic_reader.cc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'chrome/tools') diff --git a/chrome/tools/convert_dict/aff_reader.cc b/chrome/tools/convert_dict/aff_reader.cc index ea7e2a8..767ba92 100644 --- a/chrome/tools/convert_dict/aff_reader.cc +++ b/chrome/tools/convert_dict/aff_reader.cc @@ -48,7 +48,8 @@ void CollapseDuplicateSpaces(std::string* str) { AffReader::AffReader(const std::string& filename) : has_indexed_affixes_(false) { - file_ = file_util::OpenFile(filename, "r"); + FilePath path = FilePath::FromWStringHack(ASCIIToWide(filename)); + file_ = file_util::OpenFile(path, "r"); // Default to Latin1 in case the file doesn't specify it. encoding_ = "ISO8859-1"; diff --git a/chrome/tools/convert_dict/dic_reader.cc b/chrome/tools/convert_dict/dic_reader.cc index 2233d04..bac3162 100644 --- a/chrome/tools/convert_dict/dic_reader.cc +++ b/chrome/tools/convert_dict/dic_reader.cc @@ -129,8 +129,10 @@ bool PopulateWordSet(WordSet* word_set, FILE* file, AffReader* aff_reader, } // namespace DicReader::DicReader(const std::string& filename) { - file_ = file_util::OpenFile(filename, "r"); - additional_words_file_ = file_util::OpenFile(filename + "_delta", "r"); + FilePath path = FilePath::FromWStringHack(ASCIIToWide(filename)); + file_ = file_util::OpenFile(path, "r"); + additional_words_file_ = + file_util::OpenFile(FilePath(path.InsertBeforeExtension("_delta")), "r"); } DicReader::~DicReader() { -- cgit v1.1