diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/CMakeLists.txt
--- a/indra/newview/CMakeLists.txt Fri Sep 02 13:48:29 2011 -0400
+++ b/indra/newview/CMakeLists.txt Fri Sep 16 00:38:17 2011 +0300
@@ -237,6 +237,7 @@
llfloatertools.cpp
llfloatertopobjects.cpp
llfloatertos.cpp
+ llfloatertranslationsettings.cpp
llfloateruipreview.cpp
llfloaterurlentry.cpp
llfloatervoiceeffect.cpp
@@ -799,6 +800,7 @@
llfloatertools.h
llfloatertopobjects.h
llfloatertos.h
+ llfloatertranslationsettings.h
llfloateruipreview.h
llfloaterurlentry.h
llfloatervoiceeffect.h
@@ -1983,12 +1985,19 @@
llmediadataclient.cpp
lllogininstance.cpp
llremoteparcelrequest.cpp
+ lltranslate.cpp
llviewerhelputil.cpp
llversioninfo.cpp
llworldmap.cpp
llworldmipmap.cpp
)
+ set_source_files_properties(
+ lltranslate.cpp
+ PROPERTIES
+ LL_TEST_ADDITIONAL_LIBRARIES "${JSONCPP_LIBRARIES}"
+ )
+
##################################################
# DISABLING PRECOMPILED HEADERS USAGE FOR TESTS
##################################################
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/app_settings/settings.xml
--- a/indra/newview/app_settings/settings.xml Fri Sep 02 13:48:29 2011 -0400
+++ b/indra/newview/app_settings/settings.xml Fri Sep 16 00:38:17 2011 +0300
@@ -10922,6 +10922,39 @@
Value
0
+ TranslationService
+
+ GoogleTranslateAPIKey
+
+ BingTranslateAPIKey
+
TutorialURL
", begin);
+ err_msg = body.substr(begin, end-begin);
+ LLStringUtil::replaceString(err_msg, "
", ""); // strip CR
+ return false;
+ }
+
+ // Sample response: Hola
+ size_t begin = body.find(">");
+ if (begin == std::string::npos || begin >= (body.size() - 1))
+ {
+ begin = 0;
+ }
+ else
+ {
+ ++begin;
+ }
+
+ size_t end = body.find("", begin);
+
+ detected_lang = ""; // unsupported by this API
+ translation = body.substr(begin, end-begin);
+ LLStringUtil::replaceString(translation, "
", ""); // strip CR
+ return true;
+}
+
+// static
+std::string LLBingTranslationHandler::getAPIKey()
+{
+ return gSavedSettings.getString("BingTranslateAPIKey");
+}
+
+LLTranslate::TranslationReceiver::TranslationReceiver(const std::string& from_lang, const std::string& to_lang)
+: mFromLang(from_lang)
+, mToLang(to_lang)
+, mHandler(LLTranslate::getPreferredHandler())
+{
+}
+
+// virtual
+void LLTranslate::TranslationReceiver::completedRaw(
+ U32 http_status,
+ const std::string& reason,
+ const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
+{
+ LLBufferStream istr(channels, buffer.get());
+ std::stringstream strstrm;
+ strstrm << istr.rdbuf();
+
+ const std::string body = strstrm.str();
+ std::string translation, detected_lang, err_msg;
+ int status = http_status;
+ LL_DEBUGS("Translate") << "HTTP status: " << status << " " << reason << LL_ENDL;
+ LL_DEBUGS("Translate") << "Response body: " << body << LL_ENDL;
+ if (mHandler.parseResponse(status, body, translation, detected_lang, err_msg))
+ {
+ // Fix up the response
+ LLStringUtil::replaceString(translation, "<", "<");
+ LLStringUtil::replaceString(translation, ">",">");
+ LLStringUtil::replaceString(translation, ""","\"");
+ LLStringUtil::replaceString(translation, "'","'");
+ LLStringUtil::replaceString(translation, "&","&");
+ LLStringUtil::replaceString(translation, "'","'");
+
+ handleResponse(translation, detected_lang);
+ }
+ else
+ {
+ if (err_msg.empty())
+ {
+ err_msg = LLTrans::getString("TranslationResponseParseError");
+ }
+
+ llwarns << "Translation request failed: " << err_msg << llendl;
+ handleFailure(status, err_msg);
+ }
+}
+
+LLTranslate::KeyVerificationReceiver::KeyVerificationReceiver(EService service)
+: mService(service)
+{
+}
+
+LLTranslate::EService LLTranslate::KeyVerificationReceiver::getService() const
+{
+ return mService;
+}
+
+// virtual
+void LLTranslate::KeyVerificationReceiver::completedRaw(
+ U32 http_status,
+ const std::string& reason,
+ const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
+{
+ bool ok = (http_status == 200);
+ setVerificationStatus(ok);
}
//static
-void LLTranslate::getTranslateUrl(std::string &translate_url, const std::string &from_lang, const std::string &to_lang, const std::string &mesg)
+void LLTranslate::translateMessage(
+ TranslationReceiverPtr &receiver,
+ const std::string &from_lang,
+ const std::string &to_lang,
+ const std::string &mesg)
{
- char * curl_str = curl_escape(mesg.c_str(), mesg.size());
- std::string const escaped_mesg(curl_str);
- curl_free(curl_str);
+ std::string url;
+ receiver->mHandler.getTranslateURL(url, from_lang, to_lang, mesg);
- translate_url = m_GoogleURL
- + escaped_mesg + m_GoogleLangSpec
- + from_lang // 'from' language; empty string for auto
- + "%7C" // |
- + to_lang; // 'to' language
+ LL_DEBUGS("Translate") << "Sending translation request: " << url << LL_ENDL;
+ sendRequest(url, receiver);
}
-//static
-bool LLTranslate::parseGoogleTranslate(const std::string& body, std::string &translation, std::string &detected_language)
+// static
+void LLTranslate::verifyKey(
+ KeyVerificationReceiverPtr& receiver,
+ const std::string& key)
{
- Json::Value root;
- Json::Reader reader;
-
- bool success = reader.parse(body, root);
- if (!success)
- {
- LL_WARNS("Translate") << "Non valid response from Google Translate API: '" << reader.getFormatedErrorMessages() << "'" << LL_ENDL;
- return false;
- }
-
- translation = root[m_GoogleData].get(m_GoogleTranslation, "").asString();
- detected_language = root[m_GoogleData].get(m_GoogleLanguage, "").asString();
- return true;
+ std::string url;
+ const LLTranslationAPIHandler& handler = getHandler(receiver->getService());
+ handler.getKeyVerificationURL(url, key);
+
+ LL_DEBUGS("Translate") << "Sending key verification request: " << url << LL_ENDL;
+ sendRequest(url, receiver);
}
//static
@@ -119,3 +331,52 @@
return language;
}
+// static
+const LLTranslationAPIHandler& LLTranslate::getPreferredHandler()
+{
+ EService service = SERVICE_BING;
+
+ std::string service_str = gSavedSettings.getString("TranslationService");
+ if (service_str == "google")
+ {
+ service = SERVICE_GOOGLE;
+ }
+
+ return getHandler(service);
+}
+
+// static
+const LLTranslationAPIHandler& LLTranslate::getHandler(EService service)
+{
+ static LLGoogleTranslationHandler google;
+ static LLBingTranslationHandler bing;
+
+ if (service == SERVICE_GOOGLE)
+ {
+ return google;
+ }
+
+ return bing;
+}
+
+// static
+void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr responder)
+{
+ static const float REQUEST_TIMEOUT = 5;
+ static LLSD sHeader;
+
+ if (!sHeader.size())
+ {
+ std::string user_agent = llformat("%s %d.%d.%d (%d)",
+ LLVersionInfo::getChannel().c_str(),
+ LLVersionInfo::getMajor(),
+ LLVersionInfo::getMinor(),
+ LLVersionInfo::getPatch(),
+ LLVersionInfo::getBuild());
+
+ sHeader.insert("Accept", "text/plain");
+ sHeader.insert("User-Agent", user_agent);
+ }
+
+ LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT);
+}
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/llviewerfloaterreg.cpp
--- a/indra/newview/llviewerfloaterreg.cpp Fri Sep 02 13:48:29 2011 -0400
+++ b/indra/newview/llviewerfloaterreg.cpp Fri Sep 16 00:38:17 2011 +0300
@@ -102,6 +102,7 @@
#include "llfloatertools.h"
#include "llfloatertos.h"
#include "llfloatertopobjects.h"
+#include "llfloatertranslationsettings.h"
#include "llfloateruipreview.h"
#include "llfloatervoiceeffect.h"
#include "llfloaterwhitelistentry.h"
@@ -234,6 +235,7 @@
LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build);
LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build);
LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build);
+ LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build);
LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build);
LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build);
LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "preview");
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/llviewermessage.cpp
--- a/indra/newview/llviewermessage.cpp Fri Sep 02 13:48:29 2011 -0400
+++ b/indra/newview/llviewermessage.cpp Fri Sep 16 00:38:17 2011 +0300
@@ -3138,7 +3138,7 @@
{
// filter out non-interesting responeses
if ( !translation.empty()
- && (m_toLang != detected_language)
+ && (mToLang != detected_language)
&& (LLStringUtil::compareInsensitive(translation, m_origMesg) != 0) )
{
m_chat.mText += " (" + translation + ")";
@@ -3147,10 +3147,11 @@
LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs);
}
- void handleFailure()
- {
- LLTranslate::TranslationReceiver::handleFailure();
- m_chat.mText += " (?)";
+ void handleFailure(int status, const std::string& err_msg)
+ {
+ std::string msg = LLTrans::getString("TranslationFailed", LLSD().with("[REASON]", err_msg));
+ LLStringUtil::replaceString(msg, "\n", " "); // we want one-line error messages
+ m_chat.mText += " (" + msg + ")";
LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs);
}
@@ -3388,7 +3389,7 @@
const std::string from_lang = ""; // leave empty to trigger autodetect
const std::string to_lang = LLTranslate::getTranslateLanguage();
- LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(from_lang, to_lang, mesg, chat, args);
+ LLTranslate::TranslationReceiverPtr result = ChatTranslationReceiver::build(from_lang, to_lang, mesg, chat, args);
LLTranslate::translateMessage(result, from_lang, to_lang, mesg);
}
else
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/skins/default/xui/en/floater_translation_settings.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/indra/newview/skins/default/xui/en/floater_translation_settings.xml Fri Sep 16 00:38:17 2011 +0300
@@ -0,0 +1,244 @@
+
+
+
+ Bing appID not verified. Please try again.
+ Google API key not verified. Please try again.
+
+ Bing appID verified.
+ Google API key verified.
+
+
+
+ Translate chat into:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Choose translation service to use:
+
+
+
+
+
+
+
+
+ Bing [http://www.bing.com/developers/createapp.aspx AppID]:
+
+
+
+
+
+ Google [http://code.google.com/apis/language/translate/v2/getting_started.html#auth API key]:
+
+
+
+
+
+ [http://code.google.com/apis/language/translate/v2/pricing.html Pricing] | [https://code.google.com/apis/console Stats]
+
+
+
+
+
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/skins/default/xui/en/panel_preferences_chat.xml
--- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml Fri Sep 02 13:48:29 2011 -0400
+++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml Fri Sep 16 00:38:17 2011 +0300
@@ -204,119 +204,16 @@
name="nearby_toasts_fadingtime"
top_pad="3"
width="325" />
-
-
-
-
- Use machine translation while chatting (powered by Google)
-
-
- Translate chat into:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/skins/default/xui/en/strings.xml
--- a/indra/newview/skins/default/xui/en/strings.xml Fri Sep 02 13:48:29 2011 -0400
+++ b/indra/newview/skins/default/xui/en/strings.xml Fri Sep 16 00:38:17 2011 +0300
@@ -3502,6 +3502,10 @@
Error parsing the external editor command.
External editor failed to run.
+
+ Translation failed: [REASON]
+ Error parsing translation response.
+
Esc
Space
diff -r 8da01486a36a -r 588d2bf7b6ad indra/newview/tests/lltranslate_test.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/indra/newview/tests/lltranslate_test.cpp Fri Sep 16 00:38:17 2011 +0300
@@ -0,0 +1,345 @@
+/**
+ * @file lltranslate_test.cpp
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "../test/lltut.h"
+#include "../lltranslate.h"
+#include "../llversioninfo.h"
+#include "../llviewercontrol.h"
+
+#include "llbufferstream.h"
+#include "lltrans.h"
+#include "llui.h"
+
+static const std::string GOOGLE_VALID_RESPONSE1 =
+"{\
+ \"data\": {\
+ \"translations\": [\
+ {\
+ \"translatedText\": \"привет\",\
+ \"detectedSourceLanguage\": \"es\"\
+ }\
+ ]\
+ }\
+}";
+
+static const std::string GOOGLE_VALID_RESPONSE2 =
+"{\
+ \"data\": {\
+ \"translations\": [\
+ {\
+ \"translatedText\": \"привет\"\
+ }\
+ ]\
+ }\
+}\
+";
+
+static const std::string GOOGLE_VALID_RESPONSE3 =
+"{\
+ \"error\": {\
+ \"errors\": [\
+ {\
+ \"domain\": \"global\",\
+ \"reason\": \"invalid\",\
+ \"message\": \"Invalid Value\"\
+ }\
+ ],\
+ \"code\": 400,\
+ \"message\": \"Invalid Value\"\
+ }\
+}";
+
+static const std::string BING_VALID_RESPONSE1 =
+"Привет";
+
+static const std::string BING_VALID_RESPONSE2 =
+"Argument Exception
Method: Translate()
Parameter:
\
+Message: 'from' must be a valid language
\
+message id=3743.V2_Rest.Translate.58E8454F
";
+
+static const std::string BING_VALID_RESPONSE3 =
+"Argument Exception
Method: Translate()
\
+Parameter: appId
Message: Invalid appId
\nParameter name: appId
\
+
message id=3737.V2_Rest.Translate.56016759
";
+
+namespace tut
+{
+ class translate_test
+ {
+ protected:
+ void test_translation(
+ LLTranslationAPIHandler& handler,
+ int status, const std::string& resp,
+ const std::string& exp_trans, const std::string& exp_lang, const std::string& exp_err)
+ {
+ std::string translation, detected_lang, err_msg;
+ bool rc = handler.parseResponse(status, resp, translation, detected_lang, err_msg);
+ ensure_equals("rc", rc, (status == 200));
+ ensure_equals("err_msg", err_msg, exp_err);
+ ensure_equals("translation", translation, exp_trans);
+ ensure_equals("detected_lang", detected_lang, exp_lang);
+ }
+
+ LLGoogleTranslationHandler mGoogle;
+ LLBingTranslationHandler mBing;
+ };
+
+ typedef test_group translate_test_group_t;
+ typedef translate_test_group_t::object translate_test_object_t;
+ tut::translate_test_group_t tut_translate("LLTranslate");
+
+ template<> template<>
+ void translate_test_object_t::test<1>()
+ {
+ test_translation(mGoogle, 200, GOOGLE_VALID_RESPONSE1, "привет", "es", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<2>()
+ {
+ test_translation(mGoogle, 200, GOOGLE_VALID_RESPONSE2, "привет", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<3>()
+ {
+ test_translation(mGoogle, 400, GOOGLE_VALID_RESPONSE3, "", "", "Invalid Value");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<4>()
+ {
+ test_translation(mGoogle, 400,
+ "",
+ "", "", "* Line 1, Column 1\n Syntax error: value, object or array expected.\n");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<5>()
+ {
+ test_translation(mGoogle, 400,
+ "[]",
+ "", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<6>()
+ {
+ test_translation(mGoogle, 400,
+ "{\"oops\": \"invalid\"}",
+ "", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<7>()
+ {
+ test_translation(mGoogle, 400,
+ "{\"data\": {}}",
+ "", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<8>()
+ {
+ test_translation(mGoogle, 400,
+ "{\"data\": { \"translations\": [ {} ] }}",
+ "", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<9>()
+ {
+ test_translation(mGoogle, 400,
+ "{\"data\": { \"translations\": [ { \"translatedTextZZZ\": \"привет\", \"detectedSourceLanguageZZZ\": \"es\" } ] }}",
+ "", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<10>()
+ {
+ test_translation(mBing, 200, BING_VALID_RESPONSE1, "Привет", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<11>()
+ {
+ test_translation(mBing, 400, BING_VALID_RESPONSE2, "", "", "'from' must be a valid language");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<12>()
+ {
+ test_translation(mBing, 400, BING_VALID_RESPONSE3, "", "", "Invalid appId\nParameter name: appId");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<13>()
+ {
+ test_translation(mBing, 200,
+ "Привет",
+ "Привет", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<14>()
+ {
+ test_translation(mBing, 200,
+ "Привет",
+ "Привет", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<15>()
+ {
+ test_translation(mBing, 200,
+ "Привет",
+ "Привет", "", "");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<16>()
+ {
+ test_translation(mBing, 400,
+ "Message: some error",
+ "", "", "some error");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<17>()
+ {
+ test_translation(mBing, 400,
+ "Message: some error",
+ "", "", "some error");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<18>()
+ {
+ test_translation(mBing, 400,
+ "some error",
+ "", "", "some error");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<19>()
+ {
+ test_translation(mBing, 400,
+ "some error",
+ "", "", "some error");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<20>()
+ {
+ std::string url;
+ mBing.getTranslateURL(url, "en", "es", "hi");
+ ensure_equals("bing URL", url,
+ "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es&from=en");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<21>()
+ {
+ std::string url;
+ mBing.getTranslateURL(url, "", "es", "hi");
+ ensure_equals("bing URL", url,
+ "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<22>()
+ {
+ std::string url;
+ mGoogle.getTranslateURL(url, "en", "es", "hi");
+ ensure_equals("google URL", url,
+ "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es&source=en");
+ }
+
+ template<> template<>
+ void translate_test_object_t::test<23>()
+ {
+ std::string url;
+ mGoogle.getTranslateURL(url, "", "es", "hi");
+ ensure_equals("google URL", url,
+ "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es");
+ }
+}
+
+//== Misc stubs ===============================================================
+LLControlGroup gSavedSettings("test");
+
+std::string LLUI::getLanguage() { return "en"; }
+std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return "dummy"; }
+
+LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {}
+std::string LLControlGroup::getString(const std::string& name) { return "dummy"; }
+LLControlGroup::~LLControlGroup() {}
+
+namespace boost {
+ void intrusive_ptr_add_ref(LLCurl::Responder*) {}
+ void intrusive_ptr_release(LLCurl::Responder*) {}
+}
+
+LLCurl::Responder::Responder() {}
+void LLCurl::Responder::completedHeader(U32, std::string const&, LLSD const&) {}
+void LLCurl::Responder::completedRaw(U32, const std::string&, const LLChannelDescriptors&, const LLIOPipe::buffer_ptr_t& buffer) {}
+void LLCurl::Responder::completed(U32, std::string const&, LLSD const&) {}
+void LLCurl::Responder::error(U32, std::string const&) {}
+void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) {}
+void LLCurl::Responder::result(LLSD const&) {}
+LLCurl::Responder::~Responder() {}
+
+void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32) {}
+void LLHTTPClient::get(const std::string&, boost::intrusive_ptr, const LLSD&, const F32) {}
+
+LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer)
+: std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {}
+LLBufferStream::~LLBufferStream() {}
+
+LLBufferStreamBuf::LLBufferStreamBuf(const LLChannelDescriptors&, LLBufferArray*) {}
+#if( LL_WINDOWS || __GNUC__ > 2)
+LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff(
+ off_type off,
+ std::ios::seekdir way,
+ std::ios::openmode which)
+#else
+streampos LLBufferStreamBuf::seekoff(
+ streamoff off,
+ std::ios::seekdir way,
+ std::ios::openmode which)
+#endif
+{ return 0; }
+int LLBufferStreamBuf::sync() {return 0;}
+int LLBufferStreamBuf::underflow() {return 0;}
+int LLBufferStreamBuf::overflow(int) {return 0;}
+LLBufferStreamBuf::~LLBufferStreamBuf() {}
+
+S32 LLVersionInfo::getBuild() { return 0; }
+const std::string& LLVersionInfo::getChannel() {static std::string dummy; return dummy;}
+S32 LLVersionInfo::getMajor() { return 0; }
+S32 LLVersionInfo::getMinor() { return 0; }
+S32 LLVersionInfo::getPatch() { return 0; }