Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37919038
en ru br
ALT Linux repos
S:3.26.4-alt1

Group :: Development/C++
RPM: libdxflib

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: dxflib-Use-std-istream.patch
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);
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin