Commit 924248d9 authored by Bill Lorensen's avatar Bill Lorensen

STYLE: Replace vtksys_stl and vtksys_ios:: with std::

In the early days of VTK, support for stl was not portable. vtksys_stl
and vtksys_ios provided a portable implementation of the stl. Now, all
of the VTK supported compilers have portable stl implementations.

This patch:
  1) Replaces the vtksys_ios:: with std::.
  2) Replaces the vtksys_stl:: with std::.
  3) Removes "using" statements for stl
parent 426987d9
......@@ -29,7 +29,7 @@
#include "vtkStdString.h"
#include "vtkAxisExtended.h"
#include "vtksys/ios/sstream"
#include "sstream"
#include "vtkObjectFactory.h"
#include <algorithm>
......@@ -1133,7 +1133,7 @@ void vtkAxis::GenerateTickLabels(double min, double max)
// Now create a label for the tick position
if (this->TickLabelAlgorithm == vtkAxis::TICK_SIMPLE)
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
if (this->Notation > 0)
{
......@@ -1142,7 +1142,7 @@ void vtkAxis::GenerateTickLabels(double min, double max)
if (this->Notation == 1)
{
// Scientific notation
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
}
else if (this->Notation == 2)
{
......@@ -1174,7 +1174,7 @@ void vtkAxis::GenerateTickLabels()
value = pow(double(10.0), double(value));
}
// Now create a label for the tick position
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
if (this->Notation > 0)
{
......@@ -1182,7 +1182,7 @@ void vtkAxis::GenerateTickLabels()
}
if (this->Notation == SCIENTIFIC_NOTATION)
{
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
}
else if (this->Notation == FIXED_NOTATION)
{
......@@ -1206,7 +1206,7 @@ void vtkAxis::GenerateTickLabels()
// 8 - Factored Scientific 5 (10^6)
void vtkAxis::GenerateLabelFormat(int notation, double n)
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
switch(notation)
......@@ -1214,7 +1214,7 @@ void vtkAxis::GenerateLabelFormat(int notation, double n)
case 1:
ostr << n;
ostr.precision(this->Precision);
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
this->TickLabels->InsertNextValue(ostr.str());
break;
case 2:
......@@ -1289,7 +1289,7 @@ void vtkAxis::GenerateLabelFormat(int notation, double n)
break;
case 8:
ostr.precision(this->Precision);
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
ostr << n/1000.0 ;
if(!TitleAppended)
{
......@@ -1516,7 +1516,7 @@ void vtkAxis::GenerateLogSpacedLinearTicks(int order, double min, double max)
this->TickPositions->InsertNextValue(log10(value));
// Now create a label for the tick position
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
if (this->Notation > 0)
{
......@@ -1524,7 +1524,7 @@ void vtkAxis::GenerateLogSpacedLinearTicks(int order, double min, double max)
}
if (this->Notation == SCIENTIFIC_NOTATION)
{
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
}
else if (this->Notation == FIXED_NOTATION)
{
......@@ -1590,7 +1590,7 @@ void vtkAxis::GenerateLogScaleTickMarks(int order,
if (niceTickMark)
{
// Now create a label for the tick position
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
if (this->Notation > 0)
{
......@@ -1598,7 +1598,7 @@ void vtkAxis::GenerateLogScaleTickMarks(int order,
}
if (this->Notation == SCIENTIFIC_NOTATION)
{
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
}
else if (this->Notation == FIXED_NOTATION)
{
......
......@@ -19,7 +19,7 @@
#include "vtkStdString.h"
#include "vtkObjectFactory.h"
#include <vtksys/ios/sstream>
#include <sstream>
#include <cmath>
#include <algorithm>
......@@ -197,7 +197,7 @@ double vtkAxisExtended::FormatLegibilityScore(double n, int format)
// This method returns the length of the label given the format
int vtkAxisExtended::FormatStringLength(int format, double n, int precision)
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
int numSize(0);
......@@ -205,7 +205,7 @@ int vtkAxisExtended::FormatStringLength(int format, double n, int precision)
{
case 1:
ostr.precision(precision);
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
ostr<<n;
numSize = (int) ostr.str().length();
return numSize;
......@@ -266,7 +266,7 @@ int vtkAxisExtended::FormatStringLength(int format, double n, int precision)
return numSize; // Three 0's get reduced
case 8:
ostr.precision(precision);
ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
ostr.setf(std::ios::scientific, std::ios::floatfield);
ostr<<n/1000;
numSize = (int) ostr.str().length();
return numSize;
......
......@@ -28,7 +28,7 @@
#include "vtkChartLegend.h"
#include "vtkTooltipItem.h"
#include "vtksys/ios/sstream"
#include "sstream"
class vtkChartPiePrivate
{
......@@ -272,7 +272,7 @@ bool vtkChartPie::LocatePointInPlots(const vtkContextMouseEvent &mouse)
if (labelIndex >= 0)
{
const char *label = this->Private->Plot->GetLabel(labelIndex);
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr << label << ": " << plotPos.GetY();
this->Tooltip->SetText(ostr.str().c_str());
this->Tooltip->SetPosition(mouse.GetScreenPos()[0] + 2,
......
......@@ -25,7 +25,7 @@
#include "vtkObjectFactory.h"
#include "vtkStringArray.h"
#include "vtkNew.h"
#include "vtksys/ios/sstream"
#include "sstream"
vtkCxxSetObjectMacro(vtkPlot, XAxis, vtkAxis);
vtkCxxSetObjectMacro(vtkPlot, YAxis, vtkAxis);
......@@ -144,7 +144,7 @@ vtkStdString vtkPlot::GetTooltipLabel(const vtkVector2d &plotPos,
vtkStdString vtkPlot::GetNumber(double position, vtkAxis *axis)
{
// Determine and format the X and Y position in the chart
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
ostr.precision(this->GetTooltipPrecision());
......
......@@ -31,7 +31,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -30,7 +30,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -30,7 +30,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -31,7 +31,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -31,7 +31,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -26,22 +26,22 @@
#define VTK_CREATE(type,name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
#include <vtksys/stl/vector>
#include <vtksys/stl/algorithm>
#include <vtksys/stl/utility>
#include <vtksys/stl/map>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
struct NodeCompare
{
bool operator()(const vtksys_stl::pair<int, vtkIdType>& a, const vtksys_stl::pair<int, vtkIdType>& b) const
bool operator()(const std::pair<int, vtkIdType>& a, const std::pair<int, vtkIdType>& b) const
{
return a.first < b.first;
}
};
vtkIdType LookupValue(vtksys_stl::multimap<int, vtkIdType>& lookup, int value)
vtkIdType LookupValue(std::multimap<int, vtkIdType>& lookup, int value)
{
vtksys_stl::pair<const int, vtkIdType> found = *lookup.lower_bound(value);
std::pair<const int, vtkIdType> found = *lookup.lower_bound(value);
if (found.first == value)
{
return found.second;
......@@ -49,12 +49,12 @@ vtkIdType LookupValue(vtksys_stl::multimap<int, vtkIdType>& lookup, int value)
return -1;
}
vtkIdType LookupValue(vtksys_stl::vector<vtksys_stl::pair<int, vtkIdType> >& lookup, int value)
vtkIdType LookupValue(std::vector<std::pair<int, vtkIdType> >& lookup, int value)
{
NodeCompare comp;
vtksys_stl::pair<int, vtkIdType> val(value, 0);
vtksys_stl::pair<int, vtkIdType> found =
*vtksys_stl::lower_bound(lookup.begin(), lookup.end(), val, comp);
std::pair<int, vtkIdType> val(value, 0);
std::pair<int, vtkIdType> found =
*std::lower_bound(lookup.begin(), lookup.end(), val, comp);
if (found.first == value)
{
return found.second;
......@@ -65,7 +65,7 @@ vtkIdType LookupValue(vtksys_stl::vector<vtksys_stl::pair<int, vtkIdType> >& loo
vtkIdType LookupValue(vtkIntArray* lookup, vtkIdTypeArray* index, int value)
{
int* ptr = lookup->GetPointer(0);
vtkIdType place = static_cast<vtkIdType>(vtksys_stl::lower_bound(ptr, ptr + lookup->GetNumberOfTuples(), value) - ptr);
vtkIdType place = static_cast<vtkIdType>(std::lower_bound(ptr, ptr + lookup->GetNumberOfTuples(), value) - ptr);
if (place < lookup->GetNumberOfTuples() && ptr[place] == value)
{
return index->GetValue(place);
......@@ -463,7 +463,7 @@ int TestArrayLookupInt(vtkIdType numVal, bool runComparison)
// Time the lookup creation
timer->StartTimer();
int* ptr = arr->GetPointer(0);
vtksys_stl::multimap<int, vtkIdType> map;
std::multimap<int, vtkIdType> map;
for (vtkIdType i = 0; i < arrSize; ++i, ++ptr)
{
map.insert(std::pair<const int, vtkIdType>(*ptr, i));
......@@ -505,13 +505,13 @@ int TestArrayLookupInt(vtkIdType numVal, bool runComparison)
// Time lookup creation
timer->StartTimer();
ptr = arr->GetPointer(0);
vtksys_stl::vector<vtksys_stl::pair<int, vtkIdType> > vec(arrSize);
std::vector<std::pair<int, vtkIdType> > vec(arrSize);
for (vtkIdType i = 0; i < arrSize; ++i, ++ptr)
{
vec[i] = vtksys_stl::pair<int, vtkIdType>(*ptr, i);
vec[i] = std::pair<int, vtkIdType>(*ptr, i);
}
NodeCompare comp;
vtksys_stl::sort(vec.begin(), vec.end(), comp);
std::sort(vec.begin(), vec.end(), comp);
timer->StopTimer();
cerr << "," << timer->GetElapsedTime();
......
......@@ -31,7 +31,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -30,7 +30,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -30,7 +30,7 @@
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -37,7 +37,7 @@ static int TestErrorsAndWarnings();
{ \
if(!(expression)) \
{ \
vtksys_ios::ostringstream buffer; \
std::ostringstream buffer; \
buffer << "Expression failed at line " << __LINE__ << ": " << #expression; \
throw std::runtime_error(buffer.str()); \
} \
......
......@@ -16,7 +16,7 @@
#include "vtkVariant.h"
#include "vtkObject.h"
#include <vtksys/stl/map>
#include <map>
#include <cstdio>
int
......@@ -243,7 +243,7 @@ TestVariantComparison(int, char *[])
cerr << "Testing vtkVariant as STL map key... ";
vtksys_stl::map<vtkVariant, vtkStdString> TestMap;
std::map<vtkVariant, vtkStdString> TestMap;
TestMap[vtkVariant(s)] = "short";
TestMap[vtkVariant(i)] = "int";
......@@ -272,7 +272,7 @@ TestVariantComparison(int, char *[])
// This one should treat variants containing different types as
// unequal.
vtksys_stl::map<vtkVariant, vtkStdString, vtkVariantStrictWeakOrder> TestMap2;
std::map<vtkVariant, vtkStdString, vtkVariantStrictWeakOrder> TestMap2;
TestMap2[vtkVariant()] = "invalid";
TestMap2[vtkVariant(s)] = "short";
TestMap2[vtkVariant(i)] = "int";
......
......@@ -26,7 +26,7 @@
#include "vtkDoubleArray.h"
#include "vtkIdTypeArray.h"
#include <vtksys/ios/sstream>
#include <sstream>
#define SIZE 1000
......@@ -668,7 +668,7 @@ int otherArraysTest(ostream& strm)
int otherArrays(int, char *[])
{
vtksys_ios::ostringstream vtkmsg_with_warning_C4701;
std::ostringstream vtkmsg_with_warning_C4701;
// return otherArraysTest(vtkmsg_with_warning_C4701);
return otherArraysTest(cerr);
......
......@@ -20,7 +20,7 @@
#include "vtkByteSwap.h"
#include "vtkDebugLeaks.h"
#include <vtksys/ios/sstream>
#include <sstream>
int TestByteSwap(ostream& strm)
{
......@@ -156,6 +156,6 @@ int TestByteSwap(ostream& strm)
int otherByteSwap(int,char *[])
{
vtksys_ios::ostringstream vtkmsg_with_warning_C4701;
std::ostringstream vtkmsg_with_warning_C4701;
return TestByteSwap(vtkmsg_with_warning_C4701);
}
......@@ -19,7 +19,7 @@
#include "vtkStringArray.h"
#include "vtkIdList.h"
#include <vtksys/ios/sstream>
#include <sstream>
#define SIZE 1000
......@@ -201,7 +201,7 @@ int otherStringArrayTest(ostream& strm)
int otherStringArray(int, char *[])
{
vtksys_ios::ostringstream vtkmsg_with_warning_C4701;
std::ostringstream vtkmsg_with_warning_C4701;
// return otherArraysTest(vtkmsg_with_warning_C4701);
return otherStringArrayTest(cerr);
......
......@@ -41,7 +41,7 @@ void vtkAndroidOutputWindow::DisplayErrorText(const char* someText)
return;
}
vtksys_ios::istringstream stream(someText);
std::istringstream stream(someText);
std::string line;
while (std::getline(stream, line))
{
......@@ -58,7 +58,7 @@ void vtkAndroidOutputWindow::DisplayWarningText(const char* someText)
return;
}
vtksys_ios::istringstream stream(someText);
std::istringstream stream(someText);
std::string line;
while (std::getline(stream, line))
{
......@@ -75,7 +75,7 @@ void vtkAndroidOutputWindow::DisplayGenericWarningText(const char* someText)
return;
}
vtksys_ios::istringstream stream(someText);
std::istringstream stream(someText);
std::string line;
while (std::getline(stream, line))
{
......@@ -91,7 +91,7 @@ void vtkAndroidOutputWindow::DisplayDebugText(const char* someText)
return;
}
vtksys_ios::istringstream stream(someText);
std::istringstream stream(someText);
std::string line;
while (std::getline(stream, line))
{
......@@ -107,7 +107,7 @@ void vtkAndroidOutputWindow::DisplayText(const char* someText)
return;
}
vtksys_ios::istringstream stream(someText);
std::istringstream stream(someText);
std::string line;
while (std::getline(stream, line))
{
......
......@@ -22,8 +22,8 @@
#include "vtkArrayCoordinates.h"
#include "vtkArrayExtents.h"
#include <vtksys/stl/functional>
#include <vtksys/stl/numeric>
#include <functional>
#include <numeric>
vtkArrayExtents::vtkArrayExtents()
{
......@@ -77,7 +77,7 @@ const vtkArrayExtents vtkArrayExtents::Uniform(DimensionT n, CoordinateT m)
// IA64 HP-UX doesn't seem to have the vector<T> vector1(n, value)
// overload nor the assign(n, value) method, so we use the single
// argument constructor and initialize the values manually.
// result.Storage = vtksys_stl::vector<vtkIdType>(n, m);
// result.Storage = std::vector<vtkIdType>(n, m);
result.Storage = std::vector<vtkArrayRange>(n);
for(DimensionT i = 0; i < n; i++)
......
......@@ -613,7 +613,7 @@ void vtkGarbageCollectorImpl::Report(vtkObjectBase* obj, void* ptr,
if(this->Debug && vtkObject::GetGlobalWarningDisplay())
{
vtkObjectBase* current = this->Current->Object;
vtksys_ios::ostringstream msg;
std::ostringstream msg;
msg << "Report: "
<< current->GetClassName() << "(" << current << ") "
<< (desc?desc:"")
......@@ -709,7 +709,7 @@ void vtkGarbageCollectorImpl::PrintComponent(ComponentType* c)
{
if(this->Debug && vtkObject::GetGlobalWarningDisplay())
{
vtksys_ios::ostringstream msg;
std::ostringstream msg;
msg << "Identified strongly connected component "
<< c->Identifier << " with net reference count "
<< c->NetCount << ":";
......
......@@ -28,7 +28,7 @@
#ifdef VTK_INFORMATION_USE_HASH_MAP
# include <vtksys/hash_map.hxx>
#else
# include <vtksys/stl/map>
# include <map>
#endif
//----------------------------------------------------------------------------
......@@ -47,7 +47,7 @@ public:
};
typedef vtksys::hash_map<KeyType, DataType, HashFun> MapType;
#else
typedef vtksys_stl::map<KeyType, DataType> MapType;
typedef std::map<KeyType, DataType> MapType;
#endif
MapType Map;
......
......@@ -362,7 +362,7 @@ const char* vtkTimePointUtility::TimePointToISO8601(vtkTypeUInt64 time, int form
int year, month, day, hour, minute, second, msec;
GetDateTime(time, year, month, day, hour, minute, second, msec);
vtksys_ios::ostringstream oss;
std::ostringstream oss;
oss.imbue(std::locale::classic());
oss.fill('0');
if (format == ISO8601_DATETIME)
......
......@@ -744,7 +744,7 @@ template <typename iterT>
vtkStdString vtkVariantArrayToString(iterT* it)
{
vtkIdType maxInd = it->GetNumberOfValues();
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
for (vtkIdType i = 0; i < maxInd; i++)
{
if (i > 0)
......@@ -772,72 +772,72 @@ vtkStdString vtkVariant::ToString() const
}
if (this->IsFloat())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
ostr << this->Data.Float;
return vtkStdString(ostr.str());
}
if (this->IsDouble())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
ostr << this->Data.Double;
return vtkStdString(ostr.str());
}
if (this->IsChar())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr << this->Data.Char;
return vtkStdString(ostr.str());
}
if (this->IsUnsignedChar())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr << static_cast<unsigned int>(this->Data.UnsignedChar);
return vtkStdString(ostr.str());
}
if (this->IsSignedChar())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr << this->Data.SignedChar;
return vtkStdString(ostr.str());
}
if (this->IsShort())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr << this->Data.Short;
return vtkStdString(ostr.str());
}
if (this->IsUnsignedShort())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr << this->Data.UnsignedShort;
return vtkStdString(ostr.str());
}
if (this->IsInt())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
ostr << this->Data.Int;
return vtkStdString(ostr.str());
}
if (this->IsUnsignedInt())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
ostr << this->Data.UnsignedInt;
return vtkStdString(ostr.str());
}
if (this->IsLong())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());
ostr << this->Data.Long;
return vtkStdString(ostr.str());
}
if (this->IsUnsignedLong())
{
vtksys_ios::ostringstream ostr;
std::ostringstream ostr;
ostr.imbue(std::locale::classic());