Realize template functions so that we can actually link.
This commit is contained in:
parent
fb289417e5
commit
51a50fdf92
1 changed files with 9 additions and 6 deletions
|
@ -57,7 +57,6 @@
|
||||||
|
|
||||||
namespace mapnik { namespace svg {
|
namespace mapnik { namespace svg {
|
||||||
|
|
||||||
bool parse_reader(svg_parser & parser,xmlTextReaderPtr reader);
|
|
||||||
void process_node(svg_parser & parser,xmlTextReaderPtr reader);
|
void process_node(svg_parser & parser,xmlTextReaderPtr reader);
|
||||||
void start_element(svg_parser & parser,xmlTextReaderPtr reader);
|
void start_element(svg_parser & parser,xmlTextReaderPtr reader);
|
||||||
void end_element(svg_parser & parser,xmlTextReaderPtr reader);
|
void end_element(svg_parser & parser,xmlTextReaderPtr reader);
|
||||||
|
@ -1093,13 +1092,13 @@ void svg_parser::parse_from_string(std::string const& svg)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int xmlInputReadCallback(boost::iostreams::stream<T> * stream, char * buffer, int len) {
|
int _xmlInputReadCallback(boost::iostreams::stream<T> * stream, char * buffer, int len) {
|
||||||
stream->read(buffer,len);
|
stream->read(buffer,len);
|
||||||
return stream->gcount();
|
return stream->gcount();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int xmlInputCloseCallback(boost::iostreams::stream<T> * stream)
|
int _xmlInputCloseCallback(boost::iostreams::stream<T> * stream)
|
||||||
{
|
{
|
||||||
if(stream->close())
|
if(stream->close())
|
||||||
{
|
{
|
||||||
|
@ -1111,9 +1110,9 @@ int xmlInputCloseCallback(boost::iostreams::stream<T> * stream)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void svg_parser::parse_from_stream(boost::iostreams::stream<T> const& svg_stream)
|
void svg_parser::parse_from_stream(boost::iostreams::stream<T> const& svg_stream)
|
||||||
{
|
{
|
||||||
xmlTextReaderPtr reader = xmlReaderForIO(xmlInputReadCallback<T>,
|
xmlTextReaderPtr reader = xmlReaderForIO(_xmlInputReadCallback<T>,
|
||||||
xmlInputCloseCallback<T>
|
_xmlInputCloseCallback<T>,
|
||||||
&svg_stream,
|
reinterpret_cast<const void *>(&svg_stream),
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
(XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOERROR | XML_PARSE_NOWARNING));
|
(XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOERROR | XML_PARSE_NOWARNING));
|
||||||
|
@ -1127,5 +1126,9 @@ void svg_parser::parse_from_stream(boost::iostreams::stream<T> const& svg_stream
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template void svg_parser::parse_from_stream(boost::iostreams::stream<boost::iostreams::file_source> const& svg_stream);
|
||||||
|
template void svg_parser::parse_from_stream(boost::iostreams::stream<boost::iostreams::array_source> const& svg_stream);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in a new issue