Replace std::stringstream with llvm::raw_svector_ostream (#345)

A few locations were changed to use std::ostringstream.
This commit is contained in:
Tyler Veness
2017-05-15 23:10:40 -07:00
committed by Peter Johnson
parent 7006672b06
commit b433d98c02
39 changed files with 242 additions and 174 deletions

View File

@@ -7,10 +7,10 @@
#include "Solenoid.h"
#include <sstream>
#include "LiveWindow/LiveWindow.h"
#include "WPIErrors.h"
#include "llvm/SmallString.h"
#include "llvm/raw_ostream.h"
#include "simulation/simTime.h"
using namespace frc;
@@ -29,9 +29,10 @@ Solenoid::Solenoid(int channel) : Solenoid(1, channel) {}
* @param channel The channel on the solenoid module to control (1..8).
*/
Solenoid::Solenoid(int moduleNumber, int channel) {
std::stringstream ss;
ss << "pneumatic/" << moduleNumber << "/" << channel;
m_impl = new SimContinuousOutput(ss.str());
llvm::SmallString<32> buf;
llvm::raw_svector_ostream oss(buf);
oss << "pneumatic/" << moduleNumber << "/" << channel;
m_impl = new SimContinuousOutput(oss.str());
LiveWindow::GetInstance()->AddActuator("Solenoid", moduleNumber, channel,
this);