diff options
author | David Tardon <dtardon@redhat.com> | 2017-04-07 15:54:10 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2017-04-07 15:56:20 +0200 |
commit | c41531b797af11b52dac75a88445090a8ec86339 (patch) | |
tree | afb3e60b0316671ddcdfa7d4e48951c1c6f719be | |
parent | 9ed04deb8286d87446ee211ee3f3ccd36ec8b874 (diff) |
boost::shared_ptr -> std::shared_ptr
Change-Id: I873a476e8428c8c3ca0a45d721d5ba3b300a33b4
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/lib/VDXParser.cpp | 4 | ||||
-rw-r--r-- | src/lib/VSDXMLHelper.cpp | 4 | ||||
-rw-r--r-- | src/lib/VSDXMLHelper.h | 3 | ||||
-rw-r--r-- | src/lib/VSDXMLParserBase.cpp | 8 | ||||
-rw-r--r-- | src/lib/VSDXMetaData.cpp | 4 | ||||
-rw-r--r-- | src/lib/VSDXParser.cpp | 10 | ||||
-rw-r--r-- | src/lib/VSDXTheme.cpp | 4 | ||||
-rw-r--r-- | src/lib/VisioDocument.cpp | 5 | ||||
-rw-r--r-- | src/lib/libvisio_utils.h | 4 | ||||
-rw-r--r-- | src/lib/libvisio_xml.cpp | 8 | ||||
-rw-r--r-- | src/lib/libvisio_xml.h | 10 |
12 files changed, 33 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac index bb227a1..93bc784 100644 --- a/configure.ac +++ b/configure.ac @@ -86,7 +86,6 @@ AC_CHECK_HEADERS( boost/algorithm/string.hpp \ boost/lexical_cast.hpp \ boost/optional.hpp \ - boost/shared_ptr.hpp \ boost/spirit/include/classic.hpp, [], [AC_MSG_ERROR(Required boost headers not found. install boost >= 1.36)], diff --git a/src/lib/VDXParser.cpp b/src/lib/VDXParser.cpp index e81ef0c..e2f025f 100644 --- a/src/lib/VDXParser.cpp +++ b/src/lib/VDXParser.cpp @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <memory> #include <string.h> #include <libxml/xmlIO.h> #include <libxml/xmlstring.h> #include <librevenge-stream/librevenge-stream.h> #include <boost/algorithm/string.hpp> -#include <boost/shared_ptr.hpp> #include "VDXParser.h" #include "libvisio_utils.h" #include "libvisio_xml.h" @@ -75,7 +75,7 @@ bool libvisio::VDXParser::processXmlDocument(librevenge::RVNGInputStream *input) if (!input) return false; - const boost::shared_ptr<xmlTextReader> reader( + const std::shared_ptr<xmlTextReader> reader( xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), xmlFreeTextReader); if (!reader) diff --git a/src/lib/VSDXMLHelper.cpp b/src/lib/VSDXMLHelper.cpp index 5bd40f0..e212f14 100644 --- a/src/lib/VSDXMLHelper.cpp +++ b/src/lib/VSDXMLHelper.cpp @@ -11,12 +11,12 @@ #define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE 1 #endif +#include <memory> #include <sstream> #include <istream> #include <vector> #include <boost/algorithm/string.hpp> #include <boost/lexical_cast.hpp> -#include <boost/shared_ptr.hpp> #include <librevenge-stream/librevenge-stream.h> #include "VSDXMLHelper.h" #include "libvisio_utils.h" @@ -95,7 +95,7 @@ libvisio::VSDXRelationships::VSDXRelationships(librevenge::RVNGInputStream *inpu { if (input) { - const boost::shared_ptr<xmlTextReader> reader( + const std::shared_ptr<xmlTextReader> reader( xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), xmlFreeTextReader); if (reader) diff --git a/src/lib/VSDXMLHelper.h b/src/lib/VSDXMLHelper.h index 0a46a6a..948db65 100644 --- a/src/lib/VSDXMLHelper.h +++ b/src/lib/VSDXMLHelper.h @@ -11,8 +11,9 @@ #define __VSDXMLHELPER_H__ #include <map> +#include <memory> #include <string> -#include <boost/shared_ptr.hpp> + #include <librevenge-stream/librevenge-stream.h> #include <libxml/xmlreader.h> #include "VSDTypes.h" diff --git a/src/lib/VSDXMLParserBase.cpp b/src/lib/VSDXMLParserBase.cpp index e06e3af..4d534bb 100644 --- a/src/lib/VSDXMLParserBase.cpp +++ b/src/lib/VSDXMLParserBase.cpp @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <memory> #include <string.h> #include <libxml/xmlIO.h> #include <libxml/xmlstring.h> #include <librevenge-stream/librevenge-stream.h> #include <boost/algorithm/string.hpp> -#include <boost/shared_ptr.hpp> #include <boost/spirit/include/classic.hpp> #include "VSDXMLParserBase.h" #include "libvisio_utils.h" @@ -22,7 +22,7 @@ #include "VSDXMLHelper.h" #include "VSDXMLTokenMap.h" -using boost::shared_ptr; +using std::shared_ptr; libvisio::VSDXMLParserBase::VSDXMLParserBase() : m_collector(), m_stencils(), m_currentStencil(0), m_shape(), @@ -2216,7 +2216,7 @@ int libvisio::VSDXMLParserBase::readExtendedColourData(Colour &value, xmlTextRea unsigned libvisio::VSDXMLParserBase::getIX(xmlTextReaderPtr reader) { unsigned ix = MINUS_ONE; - const boost::shared_ptr<xmlChar> ixString(xmlTextReaderGetAttribute(reader, BAD_CAST("IX")), xmlFree); + const std::shared_ptr<xmlChar> ixString(xmlTextReaderGetAttribute(reader, BAD_CAST("IX")), xmlFree); if (ixString) ix = (unsigned)xmlStringToLong(ixString.get()); return ix; @@ -2227,7 +2227,7 @@ void libvisio::VSDXMLParserBase::readTriggerId(unsigned &id, xmlTextReaderPtr re using namespace ::boost::spirit::classic; unsigned triggerId = MINUS_ONE; - const boost::shared_ptr<xmlChar> triggerString(xmlTextReaderGetAttribute(reader, BAD_CAST("F")), xmlFree); + const std::shared_ptr<xmlChar> triggerString(xmlTextReaderGetAttribute(reader, BAD_CAST("F")), xmlFree); if (triggerString) { if (parse((const char *)triggerString.get(), diff --git a/src/lib/VSDXMetaData.cpp b/src/lib/VSDXMetaData.cpp index 2d9a45c..003b37d 100644 --- a/src/lib/VSDXMetaData.cpp +++ b/src/lib/VSDXMetaData.cpp @@ -11,8 +11,8 @@ #include "VSDXMLTokenMap.h" #include "libvisio_utils.h" #include "libvisio_xml.h" +#include <memory> #include <string> -#include <boost/shared_ptr.hpp> libvisio::VSDXMetaData::VSDXMetaData() : m_metaData() @@ -119,7 +119,7 @@ bool libvisio::VSDXMetaData::parse(librevenge::RVNGInputStream *input) XMLErrorWatcher watcher; - const boost::shared_ptr<xmlTextReader> reader( + const std::shared_ptr<xmlTextReader> reader( xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET, &watcher), xmlFreeTextReader); if (!reader) diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp index 36bda6a..817be96 100644 --- a/src/lib/VSDXParser.cpp +++ b/src/lib/VSDXParser.cpp @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <memory> #include <string.h> #include <libxml/xmlIO.h> #include <libxml/xmlstring.h> #include <librevenge-stream/librevenge-stream.h> #include <boost/algorithm/string.hpp> -#include <boost/shared_ptr.hpp> #include "VSDXParser.h" #include "libvisio_utils.h" #include "libvisio_xml.h" @@ -304,7 +304,7 @@ void libvisio::VSDXParser::processXmlDocument(librevenge::RVNGInputStream *input XMLErrorWatcher watcher; - const boost::shared_ptr<xmlTextReader> reader( + const std::shared_ptr<xmlTextReader> reader( xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET, &watcher), xmlFreeTextReader); if (!reader) @@ -326,7 +326,7 @@ void libvisio::VSDXParser::processXmlDocument(librevenge::RVNGInputStream *input case XML_REL: if (XML_READER_TYPE_ELEMENT == tokenType) { - boost::shared_ptr<xmlChar> id(xmlTextReaderGetAttribute(reader.get(), BAD_CAST("r:id")), xmlFree); + std::shared_ptr<xmlChar> id(xmlTextReaderGetAttribute(reader.get(), BAD_CAST("r:id")), xmlFree); if (id) { const VSDXRelationship *rel = rels.getRelationshipById((char *)id.get()); @@ -1402,7 +1402,7 @@ void libvisio::VSDXParser::readTabRow(xmlTextReaderPtr reader) case XML_POSITION: if (XML_READER_TYPE_ELEMENT == tokenType) { - const boost::shared_ptr<xmlChar> stringValue(xmlTextReaderGetAttribute(reader, BAD_CAST("N")), xmlFree); + const std::shared_ptr<xmlChar> stringValue(xmlTextReaderGetAttribute(reader, BAD_CAST("N")), xmlFree); if (stringValue) { unsigned idx = xmlStringToLong(stringValue.get()+8); @@ -1413,7 +1413,7 @@ void libvisio::VSDXParser::readTabRow(xmlTextReaderPtr reader) case XML_ALIGNMENT: if (XML_READER_TYPE_ELEMENT == tokenType) { - const boost::shared_ptr<xmlChar> stringValue(xmlTextReaderGetAttribute(reader, BAD_CAST("N")), xmlFree); + const std::shared_ptr<xmlChar> stringValue(xmlTextReaderGetAttribute(reader, BAD_CAST("N")), xmlFree); if (stringValue) { unsigned idx = xmlStringToLong(stringValue.get()+9); diff --git a/src/lib/VSDXTheme.cpp b/src/lib/VSDXTheme.cpp index a05484b..ccfb2ac 100644 --- a/src/lib/VSDXTheme.cpp +++ b/src/lib/VSDXTheme.cpp @@ -9,13 +9,13 @@ #include "VSDXTheme.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include "VSDXMLTokenMap.h" #include "libvisio_utils.h" #include "libvisio_xml.h" -using boost::shared_ptr; +using std::shared_ptr; libvisio::VSDXVariationClrScheme::VSDXVariationClrScheme() : m_varColor1() diff --git a/src/lib/VisioDocument.cpp b/src/lib/VisioDocument.cpp index b8099e5..ec8fcd7 100644 --- a/src/lib/VisioDocument.cpp +++ b/src/lib/VisioDocument.cpp @@ -7,8 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <memory> #include <string> -#include <boost/shared_ptr.hpp> + #include <librevenge/librevenge.h> #include <libvisio/libvisio.h> #include "libvisio_utils.h" @@ -250,7 +251,7 @@ static bool isXmlVisioDocument(librevenge::RVNGInputStream *input) try { input->seek(0, librevenge::RVNG_SEEK_SET); - const boost::shared_ptr<xmlTextReader> reader( + const std::shared_ptr<xmlTextReader> reader( libvisio::xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), xmlFreeTextReader); if (!reader) diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h index ea63867..7857068 100644 --- a/src/lib/libvisio_utils.h +++ b/src/lib/libvisio_utils.h @@ -10,7 +10,7 @@ #ifndef __LIBVISIO_UTILS_H__ #define __LIBVISIO_UTILS_H__ -#include <boost/shared_ptr.hpp> +#include <memory> #include "VSDTypes.h" @@ -75,7 +75,7 @@ typedef unsigned __int64 uint64_t; namespace libvisio { -typedef boost::shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr_t; +typedef std::shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr_t; uint8_t readU8(librevenge::RVNGInputStream *input); uint16_t readU16(librevenge::RVNGInputStream *input); diff --git a/src/lib/libvisio_xml.cpp b/src/lib/libvisio_xml.cpp index 9941ee9..18214b2 100644 --- a/src/lib/libvisio_xml.cpp +++ b/src/lib/libvisio_xml.cpp @@ -131,7 +131,7 @@ Colour xmlStringToColour(const xmlChar *s) return Colour((val & 0xff0000) >> 16, (val & 0xff00) >> 8, val & 0xff, 0); } -Colour xmlStringToColour(const boost::shared_ptr<xmlChar> &s) +Colour xmlStringToColour(const std::shared_ptr<xmlChar> &s) { return xmlStringToColour(s.get()); } @@ -155,7 +155,7 @@ long xmlStringToLong(const xmlChar *s) return 0; } -long xmlStringToLong(const boost::shared_ptr<xmlChar> &s) +long xmlStringToLong(const std::shared_ptr<xmlChar> &s) { return xmlStringToLong(s.get()); } @@ -173,7 +173,7 @@ catch (const boost::bad_lexical_cast &) throw XmlParserException(); } -double xmlStringToDouble(const boost::shared_ptr<xmlChar> &s) +double xmlStringToDouble(const std::shared_ptr<xmlChar> &s) { return xmlStringToDouble(s.get()); } @@ -197,7 +197,7 @@ bool xmlStringToBool(const xmlChar *s) } -bool xmlStringToBool(const boost::shared_ptr<xmlChar> &s) +bool xmlStringToBool(const std::shared_ptr<xmlChar> &s) { return xmlStringToBool(s.get()); } diff --git a/src/lib/libvisio_xml.h b/src/lib/libvisio_xml.h index 298b739..5875a73 100644 --- a/src/lib/libvisio_xml.h +++ b/src/lib/libvisio_xml.h @@ -10,7 +10,7 @@ #ifndef __LIBVISIO_XML_H__ #define __LIBVISIO_XML_H__ -#include <boost/shared_ptr.hpp> +#include <memory> #include <librevenge-stream/librevenge-stream.h> @@ -47,16 +47,16 @@ xmlTextReaderPtr xmlReaderForStream(librevenge::RVNGInputStream *input, XMLErrorWatcher *watcher = 0); Colour xmlStringToColour(const xmlChar *s); -Colour xmlStringToColour(const boost::shared_ptr<xmlChar> &s); +Colour xmlStringToColour(const std::shared_ptr<xmlChar> &s); long xmlStringToLong(const xmlChar *s); -long xmlStringToLong(const boost::shared_ptr<xmlChar> &s); +long xmlStringToLong(const std::shared_ptr<xmlChar> &s); double xmlStringToDouble(const xmlChar *s); -double xmlStringToDouble(const boost::shared_ptr<xmlChar> &s); +double xmlStringToDouble(const std::shared_ptr<xmlChar> &s); bool xmlStringToBool(const xmlChar *s); -bool xmlStringToBool(const boost::shared_ptr<xmlChar> &s); +bool xmlStringToBool(const std::shared_ptr<xmlChar> &s); } // namespace libvisio |