From: <man...@us...> - 2015-01-31 15:58:48
|
Revision: 4742 http://sourceforge.net/p/modplug/code/4742 Author: manxorist Date: 2015-01-31 15:58:28 +0000 (Sat, 31 Jan 2015) Log Message: ----------- [Ref] Convert mpt::String::Split and mpt::String::Combine to mpt::ustring. Modified Paths: -------------- trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/sounddev/SoundDevice.cpp Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2015-01-31 13:03:40 UTC (rev 4741) +++ trunk/OpenMPT/common/misc_util.h 2015-01-31 15:58:28 UTC (rev 4742) @@ -125,17 +125,17 @@ // Combine a vector of values into a string, separated with the given separator. // No escaping is performed. template<typename T> -std::string Combine(const std::vector<T> &vals, const std::string &sep=",") -//------------------------------------------------------------------------- +mpt::ustring Combine(const std::vector<T> &vals, const mpt::ustring &sep=MPT_USTRING(",")) +//---------------------------------------------------------------------------------------- { - std::string str; + mpt::ustring str; for(std::size_t i = 0; i < vals.size(); ++i) { if(i > 0) { str += sep; } - str += mpt::ToString(vals[i]); + str += mpt::ToUString(vals[i]); } return str; } @@ -144,8 +144,8 @@ // An empty string results in an empty vector. // Leading or trailing separators result in a default-constructed element being inserted before or after the other elements. template<typename T> -std::vector<T> Split(const std::string &str, const std::string &sep=",") -//---------------------------------------------------------------------- +std::vector<T> Split(const mpt::ustring &str, const mpt::ustring &sep=MPT_USTRING(",")) +//------------------------------------------------------------------------------------- { std::vector<T> vals; std::size_t pos = 0; Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2015-01-31 13:03:40 UTC (rev 4741) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2015-01-31 15:58:28 UTC (rev 4742) @@ -124,14 +124,14 @@ mpt::ustring ChannelMapping::ToString() const //------------------------------------------- { - return mpt::ToUnicode(mpt::CharsetUTF8, mpt::String::Combine<int32>(ChannelToDeviceChannel)); + return mpt::String::Combine<int32>(ChannelToDeviceChannel); } ChannelMapping ChannelMapping::FromString(const mpt::ustring &str) //---------------------------------------------------------------- { - return SoundDevice::ChannelMapping(mpt::String::Split<int32>(mpt::ToCharset(mpt::CharsetUTF8, str))); + return SoundDevice::ChannelMapping(mpt::String::Split<int32>(str)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |