Skip to content

Commit

Permalink
removed boost lexical_cast dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Purva-Chaudhari committed Sep 9, 2021
1 parent fd2a236 commit 1852c69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions Fireworks/Core/src/FWGeometryTableManagerBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "TVirtualX.h"
#include "TGFrame.h"
#include "TEveUtil.h"
#include "boost/lexical_cast.hpp"

const char* FWGeometryTableManagerBase::NodeInfo::name() const { return m_node->GetName(); }

Expand Down Expand Up @@ -224,18 +223,16 @@ void FWGeometryTableManagerBase::showEditor(int row) {
void FWGeometryTableManagerBase::applyTransparencyFromEditor() {
printf("transparency idx %d opaci %s \n", m_editTransparencyIdx, m_editor->GetText());
if (m_editTransparencyIdx >= 0) {
using boost::bad_lexical_cast;
using boost::lexical_cast;
try {
int t = lexical_cast<int>(m_editor->GetText());
int t = std::stoi(m_editor->GetText());
if (t > 100 || t < 0) {
fwLog(fwlog::kError) << "Transparency must be set in procentage [0-100].";
return;
}
m_entries[m_editTransparencyIdx].m_transparency = 100 - t;
printf("SET !! \n");
cancelEditor(true);
} catch (bad_lexical_cast&) {
} catch (const std::exception&) {
fwLog(fwlog::kError) << "Bad Lexical cast. Transparency must be set in procentage [0-100].";
}
}
Expand Down
6 changes: 2 additions & 4 deletions MagneticField/Engine/test/testMagneticField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include <fstream>
#include <iomanip>
#include <libgen.h>
#include <boost/lexical_cast.hpp>

using namespace edm;
using namespace Geom;
Expand Down Expand Up @@ -272,7 +271,6 @@ void testMagneticField::validate(string filename, string type) {
void testMagneticField::parseTOSCATablePath(string filename, int& volNo, int& sector, string& type) {
// Determine volume number, type, and sector from filename, assumed to be like:
// [path]/s01_1/v-xyz-1156.table
using boost::lexical_cast;

char buf[512];
strcpy(buf, filename.c_str());
Expand All @@ -286,11 +284,11 @@ void testMagneticField::parseTOSCATablePath(string filename, int& volNo, int& se

// Find volume number
string::size_type iext = table.rfind('.'); // last occurence of "."
volNo = boost::lexical_cast<int>(table.substr(iend + 1, iext - iend - 1));
volNo = std::stoi(table.substr(iend + 1, iext - iend - 1));

// Find sector number
if (ssector[0] == 's') {
sector = boost::lexical_cast<int>(ssector.substr(1, 2));
sector = std::stoi(ssector.substr(1, 2));
} else {
cout << "Can not determine sector number, assuming 1" << endl;
sector = 1;
Expand Down
3 changes: 1 addition & 2 deletions MagneticField/GeomBuilder/src/volumeHandle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iterator>
#include <iomanip>
#include <iostream>
#include <boost/lexical_cast.hpp>

using namespace SurfaceOrientation;
using namespace std;
Expand All @@ -48,7 +47,7 @@ MagGeoBuilderFromDDD::volumeHandle::volumeHandle(const DDExpandedView &fv, bool
// ASSUMPTION: volume names ends with "_NUM" where NUM is the volume number
string volName = name;
volName.erase(0, volName.rfind('_') + 1);
volumeno = boost::lexical_cast<unsigned short>(volName);
volumeno = std::stoul(volName);

for (int i = 0; i < 6; ++i) {
isAssigned[i] = false;
Expand Down

0 comments on commit 1852c69

Please sign in to comment.