Group :: Development/C++
RPM: libdxflib
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: dxflib-Use-std-istream.patch
Download
Download
From e0046e6dbff8148f5d8ef8e3f149ad99384c67a8 Mon Sep 17 00:00:00 2001
From: Andrew Mustun <andrew@qcad.org>
Date: Mon, 29 May 2017 12:07:24 +0200
Subject: [PATCH] cherry picked updates from pull request #15 (jcoffland):
Use std::istream
---
src/3rdparty/dxflib/src/dl_dxf.cpp | 12 ++++++------
src/3rdparty/dxflib/src/dl_dxf.h | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/3rdparty/dxflib/src/dl_dxf.cpp b/src/3rdparty/dxflib/src/dl_dxf.cpp
index 4e74bce80..e6ceb8b08 100644
--- a/src/3rdparty/dxflib/src/dl_dxf.cpp
+++ b/src/3rdparty/dxflib/src/dl_dxf.cpp
@@ -129,14 +129,14 @@ bool DL_Dxf::in(const std::string& file, DL_CreationInterface* creationInterface
/**
* Reads a DXF file from an existing stream.
*
- * @param stream The string stream.
+ * @param stream The input stream.
* @param creationInterface
* Pointer to the class which takes care of the entities in the file.
*
* @retval true If \p file could be opened.
* @retval false If \p file could not be opened.
*/
-bool DL_Dxf::in(std::stringstream& stream,
+bool DL_Dxf::in(std::istream& stream,
DL_CreationInterface* creationInterface) {
if (stream.good()) {
@@ -193,9 +193,9 @@ bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface) {
/**
- * Same as above but for stringstreams.
+ * Same as above but for input streams.
*/
-bool DL_Dxf::readDxfGroups(std::stringstream& stream,
+bool DL_Dxf::readDxfGroups(std::istream& stream,
DL_CreationInterface* creationInterface) {
static int line = 1;
@@ -263,10 +263,10 @@ bool DL_Dxf::getStrippedLine(std::string& s, unsigned int size, FILE *fp, bool s
/**
- * Same as above but for stringstreams.
+ * Same as above but for input streams.
*/
bool DL_Dxf::getStrippedLine(std::string &s, unsigned int size,
- std::stringstream& stream, bool stripSpace) {
+ std::istream& stream, bool stripSpace) {
if (!stream.eof()) {
// Only the useful part of the line
diff --git a/src/3rdparty/dxflib/src/dl_dxf.h b/src/3rdparty/dxflib/src/dl_dxf.h
index 2c8d3a9b8..d3cc4cf1d 100644
--- a/src/3rdparty/dxflib/src/dl_dxf.h
+++ b/src/3rdparty/dxflib/src/dl_dxf.h
@@ -131,12 +131,12 @@ class DXFLIB_EXPORT DL_Dxf {
static bool getStrippedLine(std::string& s, unsigned int size,
FILE* stream, bool stripSpace = true);
- bool readDxfGroups(std::stringstream& stream,
+ bool readDxfGroups(std::istream& stream,
DL_CreationInterface* creationInterface);
- bool in(std::stringstream &stream,
+ bool in(std::istream &stream,
DL_CreationInterface* creationInterface);
static bool getStrippedLine(std::string& s, unsigned int size,
- std::stringstream& stream, bool stripSpace = true);
+ std::istream& stream, bool stripSpace = true);
static bool stripWhiteSpace(char** s, bool stripSpaces = true);