1
0
Fork 0

Replace boost::lexical_cast by std::ostringstream and std:stof/stoi/stod

This commit is contained in:
gallaert 2020-04-20 19:45:11 +01:00 committed by James Turner
parent c6124b5c5a
commit 4854607382
4 changed files with 19 additions and 21 deletions

View file

@ -3,8 +3,6 @@
#include <windows.h>
#include <cstring>
#include <boost/lexical_cast.hpp>
#include <osgViewer/Viewer>
#include <osgViewer/GraphicsWindow>
#include <osgViewer/api/Win32/GraphicsWindowWin32>

View file

@ -36,7 +36,6 @@
#include <Viewer/renderer.hxx>
#include <queue>
#include <boost/lexical_cast.hpp>
using std::string;
using std::vector;
@ -526,11 +525,11 @@ bool ScreenshotUriHandler::poll(Connection * connection)
SG_LOG(SG_NETWORK, SG_DEBUG, "Screenshot is ready, size=" << screenshot.size());
if (screenshotRequest->isStream()) {
string s( BOUNDARY "\r\nContent-Type: image/");
s.append(screenshotRequest->getType()).append("\r\nContent-Length:");
s += boost::lexical_cast<string>(screenshot.size());
s += "\r\n\r\n";
connection->write(s.c_str(), s.length());
std::ostringstream ss;
ss << BOUNDARY << "\r\nContent-Type: image/";
ss << screenshotRequest->getType() << "\r\nContent-Length:";
ss << screenshot.size() << "\r\n\r\n";
connection->write(ss.str().c_str(), ss.str().length());
}
connection->write(screenshot.data(), screenshot.size());
@ -566,11 +565,11 @@ bool ScreenshotUriHandler::poll(Connection * connection)
SG_LOG(SG_NETWORK, SG_DEBUG, "CanvasImage is ready, size=" << canvasimage.size());
if (canvasimageRequest->isStream()) {
string s(BOUNDARY "\r\nContent-Type: image/");
s.append(canvasimageRequest->getType()).append("\r\nContent-Length:");
s += boost::lexical_cast<string>(canvasimage.size());
s += "\r\n\r\n";
connection->write(s.c_str(), s.length());
std::ostringstream ss;
ss << BOUNDARY << "\r\nContent-Type: image/";
ss << canvasimageRequest->getType() << "\r\nContent-Length:";
ss << canvasimage.size() << "\r\n\r\n";
connection->write(ss.str().c_str(), ss.str().length());
}
connection->write(canvasimage.data(), canvasimage.size());
if (canvasimageRequest->isStream()) {
@ -587,4 +586,3 @@ bool ScreenshotUriHandler::poll(Connection * connection)
} // namespace http
} // namespace flightgear

View file

@ -26,8 +26,6 @@
#ifdef ENABLE_GDAL
#include <boost/lexical_cast.hpp>
#include <simgear/scene/material/mat.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
@ -84,9 +82,15 @@ void FGPgtTerrain::init( osg::Group* terrain ) {
options->setPluginStringData("SimGear::FG_ROOT", globals->get_fg_root().utf8Str());
options->setPluginStringData("SimGear::BARE_LOD_RANGE", fgGetString("/sim/rendering/static-lod/bare-delta", boost::lexical_cast<string>(SG_OBJECT_RANGE_BARE)));
options->setPluginStringData("SimGear::ROUGH_LOD_RANGE", fgGetString("/sim/rendering/static-lod/rough-delta", boost::lexical_cast<string>(SG_OBJECT_RANGE_ROUGH)));
options->setPluginStringData("SimGear::ROUGH_LOD_DETAILED", fgGetString("/sim/rendering/static-lod/detailed", boost::lexical_cast<string>(SG_OBJECT_RANGE_DETAILED)));
options->setPluginStringData("SimGear::BARE_LOD_RANGE",
fgGetString("/sim/rendering/static-lod/bare-delta",
std::to_string(SG_OBJECT_RANGE_BARE)));
options->setPluginStringData("SimGear::ROUGH_LOD_RANGE",
fgGetString("/sim/rendering/static-lod/rough-delta",
std::to_string(SG_OBJECT_RANGE_ROUGH)));
options->setPluginStringData("SimGear::ROUGH_LOD_DETAILED",
fgGetString("/sim/rendering/static-lod/detailed",
std::to_string(SG_OBJECT_RANGE_DETAILED)));
options->setPluginStringData("SimGear::RENDER_BUILDING_MESH", fgGetBool("/sim/rendering/building-mesh", false) ? "true" : "false");
options->setPluginStringData("SimGear::FG_EARTH", "ON");

View file

@ -28,8 +28,6 @@
#include <algorithm>
#include <functional>
#include <boost/lexical_cast.hpp>
#include <osgViewer/Viewer>
#include <osgDB/Registry>