diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 34c5dd3b39fef0dea742b91a259b36cbd09382bc..838f6f7127b0a763bfb25e2663046b1940204d09 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -41,6 +41,9 @@ #include "llstring.h" #include "llfasttimer.h" +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> + static const F64 DATE_EPOCH = 0.0; static const F64 LL_APR_USEC_PER_SEC = 1000000.0; @@ -182,7 +185,7 @@ bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *se bool LLDate::fromString(const std::string& iso8601_date) { - std::istringstream stream(iso8601_date); + boost::iostreams::stream<boost::iostreams::array_source> stream(iso8601_date.data(), iso8601_date.size()); return fromStream(stream); } diff --git a/indra/llplugin/llpluginmessage.cpp b/indra/llplugin/llpluginmessage.cpp index 03e88e31077516272d29cc2bab8308eb10ea66c2..ea0d1a5a36025394d712ac9ddcf912a5f85b2018 100644 --- a/indra/llplugin/llpluginmessage.cpp +++ b/indra/llplugin/llpluginmessage.cpp @@ -32,6 +32,9 @@ #include "llsdserialize.h" #include "u64.h" +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> + /** * Constructor. * @@ -363,11 +366,10 @@ int LLPluginMessage::parse(const std::string &message) // clear any previous state clear(); + boost::iostreams::stream<boost::iostreams::array_source> input(message.data(), message.size()); #if LL_DEBUG - std::istringstream input(message); S32 parse_result = LLSDSerialize::fromXML(mMessage, input); #else - std::istringstream input(message); S32 parse_result = LLSDSerialize::fromXMLDocument(mMessage, input); #endif diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 24a1be81786776aa8e399784afaa84af93321018..c9978a402c702bf670b5fb4039cdb92afc68b6f6 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -74,6 +74,8 @@ #include <algorithm> #include <boost/algorithm/string/join.hpp> +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> // Increment this if the inventory contents change in a non-backwards-compatible way. // For viewer 2, the addition of link items makes a pre-viewer-2 cache incorrect. @@ -2990,7 +2992,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, while (std::getline(file, line)) { LLSD s_item; - std::istringstream iss(line); + boost::iostreams::stream<boost::iostreams::array_source> iss(line.data(), line.size()); if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) { LL_WARNS(LOG_INV)<< "Parsing inventory cache failed" << LL_ENDL; @@ -4555,7 +4557,6 @@ std::string LLInventoryModel::getFullPath(const LLInventoryObject *obj) const visited[obj->getUUID()] = true; obj = getObject(obj->getParentUUID()); } - std::stringstream s; std::string delim("/"); std::reverse(path_elts.begin(), path_elts.end()); std::string result = "/" + boost::algorithm::join(path_elts, delim); diff --git a/indra/newview/llsearchhistory.cpp b/indra/newview/llsearchhistory.cpp index 449e0080f0e52eea772ec4ea4a36cf4227b4368c..b3de712ab55210df05241300eee07d446d0cca47 100644 --- a/indra/newview/llsearchhistory.cpp +++ b/indra/newview/llsearchhistory.cpp @@ -31,6 +31,9 @@ #include "llsdserialize.h" #include "llxmlnode.h" +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> + std::string LLSearchHistory::SEARCH_QUERY = "search_query"; std::string LLSearchHistory::SEARCH_HISTORY_FILE_NAME = "search_history.txt"; @@ -57,7 +60,7 @@ bool LLSearchHistory::load() while (std::getline(file, line)) { LLSD s_item; - std::istringstream iss(line); + boost::iostreams::stream<boost::iostreams::array_source> iss(line.data(), line.size()); if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) { break; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 06389d9ae133be1dba6a017b12abed6ac0c6b635..404e01a18a1bac253b9abd98d4e86725444c6b61 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -61,6 +61,8 @@ #include "lldrawpoolwater.h" #include <boost/algorithm/string/replace.hpp> +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> #include "llinventoryobserver.h" #include "llinventorydefines.h" @@ -313,7 +315,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(const LLUUID &asset_id, S32 statu { file.close(); - std::stringstream llsdstream(buffer); + boost::iostreams::stream<boost::iostreams::array_source> llsdstream(buffer.data(), buffer.size()); LLSD llsdsettings; if (LLSDSerialize::deserialize(llsdsettings, llsdstream, -1)) diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 3498c1bdcd1850e51f102ed7dc1834768febfec2..2df2a0b6369ac4883ed71164d2c84afe36356ec3 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -44,6 +44,9 @@ #include "rlvactions.h" // [/RLVa:KB] +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> + // Max offset for two global positions to consider them as equal const F64 MAX_GLOBAL_POS_OFFSET = 5.0f; @@ -238,7 +241,7 @@ void LLTeleportHistoryStorage::load() } LLSD s_item; - std::istringstream iss(line); + boost::iostreams::stream<boost::iostreams::array_source> iss(line.data(), line.size()); if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) { LL_INFOS() << "Parsing saved teleport history failed" << LL_ENDL; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 5ff0cb1c478544ddc957b23015638c322b14e2c0..f593809c5c209bc5a6a8e943e32e3f47e6c932b0 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2373,10 +2373,7 @@ void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) const void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) { - std::stringstream str; - - LLSDSerialize::toPrettyXML(sim_features, str); - LL_INFOS() << "region " << getName() << " " << str.str() << LL_ENDL; + LL_INFOS() << "region " << getName() << " " << ll_pretty_print_sd(sim_features) << LL_ENDL; mSimulatorFeatures = sim_features; if (LLGridManager::getInstance()->isInOpenSim()) {