diff options
Diffstat (limited to '')
-rw-r--r-- | src/utils/locale_independent_float.cpp | 18 | ||||
-rw-r--r-- | src/utils/locale_independent_float.hpp | 8 | ||||
-rw-r--r-- | src/utils/text_file.cpp (renamed from src/utils/unicode_file.cpp) | 12 | ||||
-rw-r--r-- | src/utils/text_file.hpp (renamed from src/utils/unicode_file.hpp) | 16 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/utils/locale_independent_float.cpp b/src/utils/locale_independent_float.cpp index 606ec998..e0015cee 100644 --- a/src/utils/locale_independent_float.cpp +++ b/src/utils/locale_independent_float.cpp @@ -38,7 +38,7 @@ namespace usdx { } - LocaleIndependentFloat::LocaleIndependentFloat(std::wstring& value) + LocaleIndependentFloat::LocaleIndependentFloat(std::string& value) { this->operator=(value); } @@ -65,27 +65,27 @@ namespace usdx return *this; } - LocaleIndependentFloat& LocaleIndependentFloat::operator= (std::wstring& value) + LocaleIndependentFloat& LocaleIndependentFloat::operator= (std::string& value) { - std::size_t found = value.find(L','); - if (found != std::wstring::npos) { - value[found] = L'.'; + std::size_t found = value.find(','); + if (found != std::string::npos) { + value[found] = '.'; } - std::wistringstream str(value); + std::istringstream str(value); str >> this->value; return *this; } - std::wistream& operator>> (std::wistream& is, LocaleIndependentFloat& float_value) + std::istream& operator>> (std::istream& is, LocaleIndependentFloat& float_value) { return is >> &float_value; } - std::wistream& operator>> (std::wistream& is, LocaleIndependentFloat* float_value) + std::istream& operator>> (std::istream& is, LocaleIndependentFloat* float_value) { - std::wstring str_value; + std::string str_value; is >> str_value; *float_value = str_value; diff --git a/src/utils/locale_independent_float.hpp b/src/utils/locale_independent_float.hpp index f3674695..82801868 100644 --- a/src/utils/locale_independent_float.hpp +++ b/src/utils/locale_independent_float.hpp @@ -37,7 +37,7 @@ namespace usdx float value; public: LocaleIndependentFloat(); - LocaleIndependentFloat(std::wstring& value); + LocaleIndependentFloat(std::string& value); virtual ~LocaleIndependentFloat(); @@ -46,11 +46,11 @@ namespace usdx LocaleIndependentFloat& operator= (const LocaleIndependentFloat& value); LocaleIndependentFloat& operator= (const float& vaule); - LocaleIndependentFloat& operator= (std::wstring& vaule); + LocaleIndependentFloat& operator= (std::string& vaule); }; - std::wistream& operator>> (std::wistream& is, LocaleIndependentFloat& float_value); - std::wistream& operator>> (std::wistream& is, LocaleIndependentFloat* float_value); + std::istream& operator>> (std::istream& is, LocaleIndependentFloat& float_value); + std::istream& operator>> (std::istream& is, LocaleIndependentFloat* float_value); }; diff --git a/src/utils/unicode_file.cpp b/src/utils/text_file.cpp index c47bfd36..b84c667f 100644 --- a/src/utils/unicode_file.cpp +++ b/src/utils/text_file.cpp @@ -24,7 +24,7 @@ * $Id$ */ -#include "unicode_file.hpp" +#include "text_file.hpp" #include <string> #include <locale> @@ -32,31 +32,31 @@ namespace usdx { - UnicodeFile::UnicodeFile(const std::string& filename) : file(filename.c_str(), std::wifstream::in) + TextFile::TextFile(const std::string& filename) : file(filename.c_str(), std::ifstream::in) { std::locale global_loc = std::locale(); std::locale loc(global_loc, new boost::program_options::detail::utf8_codecvt_facet()); file.imbue(loc); } - UnicodeFile::UnicodeFile(const boost::filesystem::wpath& path) : file(path, std::wifstream::in) + TextFile::TextFile(const boost::filesystem::wpath& path) : file(path, std::wifstream::in) { std::locale global_loc = std::locale(); std::locale loc(global_loc, new boost::program_options::detail::utf8_codecvt_facet()); file.imbue(loc); } - UnicodeFile::~UnicodeFile(void) + TextFile::~TextFile(void) { file.close(); } - boost::filesystem::wifstream &UnicodeFile::stream(void) + boost::filesystem::ifstream &TextFile::stream(void) { return file; } - const std::streamsize UnicodeFile::get_filesize(void) + const std::streamsize TextFile::get_filesize(void) { std::streampos position = stream().tellg(); diff --git a/src/utils/unicode_file.hpp b/src/utils/text_file.hpp index d135d796..b5249035 100644 --- a/src/utils/unicode_file.hpp +++ b/src/utils/text_file.hpp @@ -24,8 +24,8 @@ * $Id$ */ -#ifndef UNICODE_FILE_HPP -#define UNICODE_FILE_HPP +#ifndef TEXT_FILE_HPP +#define TEXT_FILE_HPP #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> @@ -33,17 +33,17 @@ namespace usdx { - class UnicodeFile : public File + class TextFile : public File { private: - boost::filesystem::wifstream file; + boost::filesystem::ifstream file; public: - UnicodeFile(const std::string& filename); - UnicodeFile(const boost::filesystem::wpath& path); - virtual ~UnicodeFile(void); + TextFile(const std::string& filename); + TextFile(const boost::filesystem::wpath& path); + virtual ~TextFile(void); - boost::filesystem::wifstream &stream(void); + boost::filesystem::ifstream &stream(void); const std::streamsize get_filesize(void); }; }; |