From b34f57b8798bcda3ca7a4f261633352dff9be007 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sun, 1 Dec 2019 22:12:17 +0800 Subject: [PATCH] Replace std::auto_ptr with boost::scoped_ptr --- src/associatedialog.cpp | 4 +-- src/catalogresolver.cpp | 2 -- src/globalreplacedialog.cpp | 4 +-- src/housestyle.cpp | 2 +- src/housestylereader.h | 5 ++-- src/housestylewriter.h | 5 ++-- src/mp3album.h | 4 +-- src/styledialog.cpp | 4 +-- src/validationthread.cpp | 4 +-- src/wrapdaisy.cpp | 10 +++---- src/wrapxerces.cpp | 7 ++--- src/xmlassociatedtd.h | 4 +-- src/xmlassociatexsd.cpp | 2 +- src/xmlassociatexsd.h | 4 +-- src/xmlassociatexsl.h | 4 +-- src/xmlcopyeditor.cpp | 54 ++++++++++++++++--------------------- src/xmlcopyeditor.h | 10 +++---- src/xmlcopyimg.h | 4 +-- src/xmlencodingspy.h | 4 +-- src/xmlfilterreader.h | 5 ++-- src/xmlparseschemans.h | 4 +-- src/xmlprodnote.h | 4 +-- src/xmlpromptgenerator.cpp | 2 +- src/xmlpromptgenerator.h | 4 +-- src/xmlrulereader.h | 4 +-- src/xmlschemagenerator.cpp | 4 +-- src/xmlschemalocator.h | 4 +-- src/xmlschemaparser.h | 3 ++- src/xmlshallowvalidator.h | 5 ++-- src/xmlsuppressprodnote.h | 4 +-- src/xmlutf8reader.h | 4 +-- src/xmlwordcount.h | 4 +-- src/xsllocator.h | 4 +-- 33 files changed, 90 insertions(+), 102 deletions(-) diff --git a/src/associatedialog.cpp b/src/associatedialog.cpp index 1a86111..f796aa1 100644 --- a/src/associatedialog.cpp +++ b/src/associatedialog.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include "associatedialog.h" #include "wraplibxml.h" @@ -168,7 +168,7 @@ void AssociateDialog::OnBrowse ( wxCommandEvent& e ) wxString dir = fileName.GetPath(); if ( dir.empty() && mLastDir ) dir = *mLastDir; - std::auto_ptr fd ( new wxFileDialog ( + boost::scoped_ptr fd ( new wxFileDialog ( this, _ ( "Select " ) + type, dir, diff --git a/src/catalogresolver.cpp b/src/catalogresolver.cpp index 15c7a29..788547b 100644 --- a/src/catalogresolver.cpp +++ b/src/catalogresolver.cpp @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "catalogresolver.h" CatalogResolver::CatalogResolver() @@ -33,6 +32,5 @@ wxString CatalogResolver::catalogResolve ( const wxString &publicId, const wxString &systemId ) { - //std::auto_ptr libxml ( new WrapLibxml ( false, catalogPath ) ); return WrapLibxml::catalogResolve ( publicId, systemId ); } diff --git a/src/globalreplacedialog.cpp b/src/globalreplacedialog.cpp index 2772f21..2f8962b 100644 --- a/src/globalreplacedialog.cpp +++ b/src/globalreplacedialog.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include "globalreplacedialog.h" #include "wrapregex.h" @@ -115,7 +115,7 @@ void GlobalReplaceDialog::OnOk ( wxCommandEvent& e ) { try { - std::auto_ptr wr ( new WrapRegex ( + boost::scoped_ptr wr ( new WrapRegex ( findUtf8, matchCase, replaceUtf8 ) ); diff --git a/src/housestyle.cpp b/src/housestyle.cpp index 404ecb4..956d22e 100644 --- a/src/housestyle.cpp +++ b/src/housestyle.cpp @@ -137,7 +137,7 @@ void HouseStyle::collectRules ( const std::string& fileName, if ( !ReadFile::run ( filePath, buffer ) ) return; - std::auto_ptr xrr ( new XmlRuleReader ( + boost::scoped_ptr xrr ( new XmlRuleReader ( dictionary, passiveDictionary, ruleVector ) ); diff --git a/src/housestylereader.h b/src/housestylereader.h index 27f1d2b..f472b35 100644 --- a/src/housestylereader.h +++ b/src/housestylereader.h @@ -25,8 +25,7 @@ #include #include #include -#include -#include +#include #include "wrapexpat.h" using namespace std; @@ -50,7 +49,7 @@ class HouseStyleReader : public WrapExpat virtual ~HouseStyleReader(); void getNodeVector ( vector > &v ); private: - std::auto_ptr ud; + boost::scoped_ptr ud; enum { STATE_UNKNOWN, diff --git a/src/housestylewriter.h b/src/housestylewriter.h index db2e192..50755cc 100644 --- a/src/housestylewriter.h +++ b/src/housestylewriter.h @@ -23,8 +23,7 @@ #include #include -#include -#include +#include #include "wrapexpat.h" #include "wrapregex.h" #include "contexthandler.h" @@ -45,7 +44,7 @@ class HouseStyleWriter : public WrapExpat ~HouseStyleWriter(); string getOutput(); private: - std::auto_ptr hswd; + boost::scoped_ptr hswd; enum { STATE_UNKNOWN, diff --git a/src/mp3album.h b/src/mp3album.h index 32b35ef..51ef46d 100644 --- a/src/mp3album.h +++ b/src/mp3album.h @@ -24,8 +24,8 @@ #include #include #include -#include #include +#include #include "wrapexpat.h" struct Mp3AlbumData : public ParserData @@ -44,7 +44,7 @@ class Mp3Album : public WrapExpat void getFileNameVector ( std::vector >& v ); std::string getAlbumTitle(); private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL start ( void *data, const XML_Char *el, const XML_Char **attr ); static void XMLCALL end ( void *data, const XML_Char *el ); static void XMLCALL characterdata ( void *data, const XML_Char *s, int len ); diff --git a/src/styledialog.cpp b/src/styledialog.cpp index f5dcb00..8eca0aa 100644 --- a/src/styledialog.cpp +++ b/src/styledialog.cpp @@ -385,7 +385,7 @@ StyleDialog::~StyleDialog() void StyleDialog::OnColumnClick ( wxListEvent& event ) { - std::auto_ptr data ( new SortData ); + boost::scoped_ptr data ( new SortData ); data->column = event.GetColumn(); data->table = table; table->SortItems ( MyCompareFunction, ( wxIntPtr ) data.get() ); @@ -457,7 +457,7 @@ void StyleDialog::OnReport ( wxCommandEvent& event ) wxString separator = wxFileName::GetPathSeparator(); - std::auto_ptr hs ( new HouseStyle ( + boost::scoped_ptr hs ( new HouseStyle ( (type == ID_TYPE_SPELL) ? HS_TYPE_SPELL : HS_TYPE_STYLE, bufferUtf8, ruleSetDirectory, diff --git a/src/validationthread.cpp b/src/validationthread.cpp index c8f7872..8568627 100644 --- a/src/validationthread.cpp +++ b/src/validationthread.cpp @@ -20,11 +20,11 @@ #include #include +#include #include "xmlctrl.h" #include "validationthread.h" #include "wrapxerces.h" #include -#include #include "threadreaper.h" extern wxCriticalSection xmlcopyeditorCriticalSection; @@ -51,7 +51,7 @@ ValidationThread::ValidationThread ( void *ValidationThread::Entry() { - std::auto_ptr validator ( new WrapXerces() ); + boost::scoped_ptr validator ( new WrapXerces() ); if ( TestDestroy() ) { diff --git a/src/wrapdaisy.cpp b/src/wrapdaisy.cpp index 9c1ce74..6e667da 100644 --- a/src/wrapdaisy.cpp +++ b/src/wrapdaisy.cpp @@ -93,7 +93,7 @@ bool WrapDaisy::run ( fileIn.Replace ( _T("\\"), _T("/") ); stylesheet.Replace ( _T("\\"), _T("/") ); - std::auto_ptr pd ( new wxProgressDialog ( + boost::scoped_ptr pd ( new wxProgressDialog ( _ ( "Export in progress" ), _ ( "Initializing..." ), 100, @@ -186,7 +186,7 @@ bool WrapDaisy::run ( return false; } - auto_ptr xsp ( new XmlSuppressProdnote() ); + boost::scoped_ptr xsp ( new XmlSuppressProdnote() ); if ( !xsp->parse ( output.c_str() ) ) { frame->newDocument ( output ); @@ -212,7 +212,7 @@ bool WrapDaisy::run ( return false; } - auto_ptr xp ( new XmlProdnote() ); + boost::scoped_ptr xp ( new XmlProdnote() ); if ( !xp->parse ( output.c_str() ) ) { frame->newDocument ( output ); @@ -298,7 +298,7 @@ bool WrapDaisy::run ( return false; } - auto_ptr xci ( + boost::scoped_ptr xci ( new XmlCopyImg ( blankImage, imagesDir, mediaDir, path ) ); if ( !xci->parse ( output.c_str() ) ) @@ -744,7 +744,7 @@ bool WrapDaisy::run ( _T("z3986") + wxFileName::GetPathSeparator(); fileWithSmilAttribs = folderWithSmilFile + fn.GetFullName(); - auto_ptr ma ( new Mp3Album() ); + boost::scoped_ptr ma ( new Mp3Album() ); BinaryFile *binaryfile; binaryfile = new BinaryFile ( fileWithSmilAttribs ); diff --git a/src/wrapxerces.cpp b/src/wrapxerces.cpp index 9256d97..757c30c 100644 --- a/src/wrapxerces.cpp +++ b/src/wrapxerces.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include using namespace xercesc; @@ -94,7 +95,7 @@ bool WrapXerces::validateMemory ( const wxChar *messageEOL /*= _T("[br]")*/) { #if 0 // Test DOM parser - std::auto_ptr parser ( new XercesDOMParser() ); + boost::scoped_ptr parser ( new XercesDOMParser() ); parser->setDoNamespaces(true); parser->setExitOnFirstFatalError(true); @@ -105,7 +106,7 @@ bool WrapXerces::validateMemory ( parser->setValidationSchemaFullChecking(true); parser->setCreateCommentNodes(false); #else - std::auto_ptr parser ( XMLReaderFactory::createXMLReader() ); + boost::scoped_ptr parser ( XMLReaderFactory::createXMLReader() ); parser->setFeature ( XMLUni::fgSAX2CoreNameSpaces, true ); parser->setFeature ( XMLUni::fgSAX2CoreValidation, true ); @@ -125,7 +126,7 @@ bool WrapXerces::validateMemory ( mySAX2Handler.setEOL ( messageEOL ); - std::auto_ptr source; + boost::scoped_ptr source; if ( utf8Buffer != NULL ) { source.reset ( new MemBufInputSource ( (XMLByte*) utf8Buffer, len, diff --git a/src/xmlassociatedtd.h b/src/xmlassociatedtd.h index cdb758f..64ecd70 100644 --- a/src/xmlassociatedtd.h +++ b/src/xmlassociatedtd.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "xmltextinfo.h" struct DtdData : public ParserData @@ -49,7 +49,7 @@ class XmlAssociateDtd : public WrapExpat return d->buffer; } private: - std::auto_ptr d; + boost::scoped_ptr d; const XmlTextInfo &mInfo; static void XMLCALL start ( void *data, diff --git a/src/xmlassociatexsd.cpp b/src/xmlassociatexsd.cpp index abe94bc..68bf61e 100644 --- a/src/xmlassociatexsd.cpp +++ b/src/xmlassociatexsd.cpp @@ -42,7 +42,7 @@ XmlAssociateXsd::XmlAssociateXsd ( XML_SetDefaultHandlerExpand ( p, defaulthandler ); XML_SetUserData ( p, this ); - std::auto_ptr parser ( new XmlParseSchemaNs() ); + boost::scoped_ptr parser ( new XmlParseSchemaNs() ); std::string normalisedPath, buffer; normalisedPath = path.mb_str ( wxConvLocal ); if ( !ReadFile::run ( normalisedPath, buffer ) ) diff --git a/src/xmlassociatexsd.h b/src/xmlassociatexsd.h index b4db2f7..528132d 100644 --- a/src/xmlassociatexsd.h +++ b/src/xmlassociatexsd.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "wrapexpat.h" struct AssociateXsdData : public ParserData @@ -50,7 +50,7 @@ class XmlAssociateXsd : public WrapExpat return d->buffer; } private: - std::auto_ptr d; + boost::scoped_ptr d; std::string encoding; std::map namespaceMap; static void XMLCALL start ( diff --git a/src/xmlassociatexsl.h b/src/xmlassociatexsl.h index 71ef88e..5a5c4c0 100644 --- a/src/xmlassociatexsl.h +++ b/src/xmlassociatexsl.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "xmltextinfo.h" struct XslData : public ParserData @@ -49,7 +49,7 @@ class XmlAssociateXsl : public WrapExpat return d->buffer; } private: - std::auto_ptr d; + boost::scoped_ptr d; const XmlTextInfo &mInfo; static void XMLCALL start ( void *data, diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index 6fe1bd8..bba4da8 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -2137,14 +2137,10 @@ void MyFrame::OnFind ( wxCommandEvent& WXUNUSED ( event ) ) return; #endif - if ( findDialog.get() ) - { - findDialog = std::auto_ptr ( 0 ); - } - findDialog = ( std::auto_ptr ( new wxFindReplaceDialog ( + findDialog.reset ( new wxFindReplaceDialog ( this, &findData, - _ ( "Find" ) ) ) ); + _ ( "Find" ) ) ); findDialog->Show(); } @@ -2155,7 +2151,7 @@ void MyFrame::OnImportMSWord ( wxCommandEvent& event ) return; #endif - std::auto_ptr fd ( new wxFileDialog ( + boost::scoped_ptr fd ( new wxFileDialog ( this, _ ( "Import Microsoft Word Document" ), mLastDir, @@ -2192,7 +2188,7 @@ void MyFrame::OnExport ( wxCommandEvent& event ) wxString testDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "daisy" ); bool downloadLink = !wxDirExists ( testDir ); - std::auto_ptr ed ( new ExportDialog ( + boost::scoped_ptr ed ( new ExportDialog ( this, exportStylesheet, exportFolder, @@ -2326,7 +2322,7 @@ void MyFrame::importMSWord ( const wxString& path ) if ( result != 5 ) // Word 2003 or later { - std::auto_ptr prettyPrinter ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr prettyPrinter ( new WrapLibxml ( libxmlNetAccess ) ); prettyPrinter->parse ( tempFileName.wideName(), true ); buffer = prettyPrinter->getOutput(); displayBuffer = wxString ( buffer.c_str(), wxConvUTF8, buffer.size() ); @@ -2386,7 +2382,7 @@ void MyFrame::OnExportMSWord ( wxCommandEvent& event ) return; } - std::auto_ptr fd ( new wxFileDialog ( + boost::scoped_ptr fd ( new wxFileDialog ( this, _ ( "Export Microsoft Word Document" ), _T ( "" ), @@ -2615,7 +2611,7 @@ void MyFrame::OnOptions ( wxCommandEvent& WXUNUSED ( event ) ) #else ( _ ( "Preferences" ) ); #endif - std::auto_ptr mpsd ( new MyPropertySheet ( + boost::scoped_ptr mpsd ( new MyPropertySheet ( this, properties, applicationDir, @@ -2711,11 +2707,7 @@ void MyFrame::OnFindReplace ( wxCommandEvent& WXUNUSED ( event ) ) #endif - if ( findDialog.get() ) - { - findDialog = std::auto_ptr ( 0 ); - } - findDialog = std::auto_ptr ( new wxFindReplaceDialog ( + findDialog.reset ( new wxFindReplaceDialog ( this, &findData, _ ( "Find and Replace" ), @@ -2729,7 +2721,7 @@ void MyFrame::OnGlobalReplace ( wxCommandEvent& event ) return; size_t flags = findData.GetFlags(); - std::auto_ptr grd ( new GlobalReplaceDialog ( + boost::scoped_ptr grd ( new GlobalReplaceDialog ( this, findData.GetFindString(), findData.GetReplaceString(), @@ -2797,7 +2789,7 @@ void MyFrame::OnGlobalReplace ( wxCommandEvent& event ) { try { - std::auto_ptr wr ( new WrapRegex ( + boost::scoped_ptr wr ( new WrapRegex ( ( const char * ) findData.GetFindString().mb_str ( wxConvUTF8 ), flags & wxFR_MATCHCASE, ( const char * ) findData.GetReplaceString().mb_str ( wxConvUTF8 ) ) ); @@ -3271,7 +3263,7 @@ bool MyFrame::openFile ( const wxString &file, bool largeFile ) // NOW parse the document, but don't create a UTF-8 copy statusProgress ( _T ( "Parsing document..." ) ); - std::auto_ptr we ( new WrapExpat() ); + boost::scoped_ptr we ( new WrapExpat() ); // omit XML declaration if ( !isUtf8 && finalBufferLen > 5 && @@ -3449,7 +3441,7 @@ void MyFrame::OnSpelling ( wxCommandEvent& event ) getRawText ( doc, rawBufferUtf8 ); bool success = true; // always true for now: well-formedness not req'd - auto_ptr sd ( new StyleDialog ( + boost::scoped_ptr sd ( new StyleDialog ( this, wxICON ( appicon ), rawBufferUtf8, @@ -3582,7 +3574,7 @@ void MyFrame::saveAs() if ( defaultDir.empty() ) defaultDir = mLastDir; - auto_ptr fd ( new wxFileDialog ( + boost::scoped_ptr fd ( new wxFileDialog ( this, _ ( "Save As" ), defaultDir, @@ -3794,7 +3786,7 @@ void MyFrame::OnValidateDTD ( wxCommandEvent& event ) doc->clearErrorIndicators(); statusProgress ( _ ( "DTD Validation in progress..." ) ); - auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); wxString fname = doc->getFullFileName(); if ( !wl->validate ( doc->myGetTextRaw(), fname ) ) { @@ -3868,7 +3860,7 @@ void MyFrame::validateRelaxNG ( doc->clearErrorIndicators(); statusProgress ( _ ( "RELAX NG validation in progress..." ) ); - auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); if ( !wl->validateRelaxNG ( schemaUrl, doc->myGetTextRaw(), fileName ) ) { wxString wideError = wl->getLastError(); @@ -3936,7 +3928,7 @@ void MyFrame::OnValidateSchema ( wxCommandEvent& event ) wxString fileName = doc->getFullFileName(); std::string utf8Buffer = doc->myGetTextRaw(); - std::auto_ptr validator ( new WrapXerces() ); + boost::scoped_ptr validator ( new WrapXerces() ); int severity; wxString message; if ( validator->validateMemory ( utf8Buffer.c_str(), utf8Buffer.size(), @@ -4040,7 +4032,7 @@ void MyFrame::OnXPath ( wxCommandEvent& event ) if ( ( doc = getActiveDocument() ) == NULL ) return; - auto_ptr dlg ( new wxTextEntryDialog ( + boost::scoped_ptr dlg ( new wxTextEntryDialog ( this, _ ( "Enter XPath:" ), _ ( "Evaluate XPath" ), @@ -4055,7 +4047,7 @@ void MyFrame::OnXPath ( wxCommandEvent& event ) std::string utf8Buffer; getRawText ( doc, utf8Buffer ); - auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); bool success = wl->xpath ( xpathExpression, utf8Buffer, doc->getFullFileName() ); @@ -4182,7 +4174,7 @@ void MyFrame::OnXslt ( wxCommandEvent& event ) } statusProgress ( _ ( "XSL transformation in progress..." ) ); - auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); wxString fileName = doc->getFullFileName(); if ( !wl->xslt ( path, rawBufferUtf8, fileName ) ) { @@ -4222,7 +4214,7 @@ void MyFrame::OnPrettyPrint ( wxCommandEvent& event ) statusProgress ( _ ( "Pretty-printing in progress..." ) ); wxString fileName = doc->getFullFileName(); - auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); for ( int i = 0; i < 2; i++ ) // perform two iterations { @@ -4279,7 +4271,7 @@ void MyFrame::OnEncoding ( wxCommandEvent& event ) int res; wxMemoryBuffer output; - std::auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); res = wl->saveEncoding ( doc->myGetTextRaw(), doc->getFullFileName(), wxEmptyString, &output, scd.GetStringSelection() ); if ( res == -1 ) @@ -4290,7 +4282,7 @@ void MyFrame::OnEncoding ( wxCommandEvent& event ) return; } - std::auto_ptr xur ( new XmlUtf8Reader ( + boost::scoped_ptr xur ( new XmlUtf8Reader ( false, expandInternalEntities, output.GetDataLen() ) ); @@ -4759,7 +4751,7 @@ bool MyFrame::saveFile ( XmlDoc *doc, wxString& fileName, bool checkLastModified } else // all other encodings handled by Libxml { - auto_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); + boost::scoped_ptr wl ( new WrapLibxml ( libxmlNetAccess ) ); int result = wl->saveEncoding ( utf8Buffer, doc->getFullFileName(), fileName, NULL, wideEncoding ); if ( result == -1 ) diff --git a/src/xmlcopyeditor.h b/src/xmlcopyeditor.h index f8abb1c..28e8c4d 100644 --- a/src/xmlcopyeditor.h +++ b/src/xmlcopyeditor.h @@ -51,9 +51,9 @@ #include #include #include -#include #include #include +#include #include "xmldoc.h" #include "myhtmlpane.h" #include "xmlencodinghandler.h" @@ -199,7 +199,7 @@ class MyApp : public wxApp MyServer *server; bool singleInstanceCheck; int lang; - std::auto_ptr config; + boost::scoped_ptr config; }; // forward declarations @@ -374,9 +374,9 @@ class MyFrame : public wxFrame #ifndef __WXDEBUG__ wxLogNull logTarget; #endif - std::auto_ptr htmlPrinting; - std::auto_ptr findDialog; - std::auto_ptr helpController; + boost::scoped_ptr htmlPrinting; + boost::scoped_ptr findDialog; + boost::scoped_ptr helpController; wxBoxSizer *frameSizer; wxMenuBar *menuBar; diff --git a/src/xmlcopyimg.h b/src/xmlcopyimg.h index 7f0e85a..81ea6c3 100644 --- a/src/xmlcopyimg.h +++ b/src/xmlcopyimg.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "wrapexpat.h" struct ImgData : public ParserData @@ -56,7 +56,7 @@ class XmlCopyImg : public WrapExpat return d->encoding; } private: - std::auto_ptr d; + boost::scoped_ptr d; std::string encoding, element, attribute; static void XMLCALL xmldeclhandler ( void *data, diff --git a/src/xmlencodingspy.h b/src/xmlencodingspy.h index 600f6eb..a6e7e96 100644 --- a/src/xmlencodingspy.h +++ b/src/xmlencodingspy.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "wrapexpat.h" struct EncodingData : public ParserData @@ -42,7 +42,7 @@ class XmlEncodingSpy : public WrapExpat return d->encoding; } private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL xmldeclhandler ( void *data, const XML_Char *version, diff --git a/src/xmlfilterreader.h b/src/xmlfilterreader.h index 7215562..78026ee 100644 --- a/src/xmlfilterreader.h +++ b/src/xmlfilterreader.h @@ -25,8 +25,7 @@ #include #include #include -#include -#include +#include #include "wrapexpat.h" using namespace std; @@ -64,7 +63,7 @@ class XmlFilterReader : public WrapExpat void getIncludeVector ( vector &v ); void getFilterMap ( map > > &m ); private: - std::auto_ptr fd; + boost::scoped_ptr fd; static void XMLCALL start ( void *data, const XML_Char *el, const XML_Char **attr ); static void XMLCALL end ( void *data, const XML_Char *el ); static void XMLCALL characterdata ( void *data, const XML_Char *s, int len ); diff --git a/src/xmlparseschemans.h b/src/xmlparseschemans.h index b257b81..d67a402 100644 --- a/src/xmlparseschemans.h +++ b/src/xmlparseschemans.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "wrapexpat.h" struct ParseSchemaNsData : public ParserData @@ -43,7 +43,7 @@ class XmlParseSchemaNs : public WrapExpat return d->attributeVector; } private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL start ( void *data, const XML_Char *el, diff --git a/src/xmlprodnote.h b/src/xmlprodnote.h index 0afe9b1..e39579f 100644 --- a/src/xmlprodnote.h +++ b/src/xmlprodnote.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "wrapexpat.h" struct ProdnoteData : public ParserData @@ -52,7 +52,7 @@ class XmlProdnote : public WrapExpat return d->encoding; } private: - std::auto_ptr d; + boost::scoped_ptr d; std::string encoding, element, attribute; static void XMLCALL xmldeclhandler ( void *data, diff --git a/src/xmlpromptgenerator.cpp b/src/xmlpromptgenerator.cpp index b75520a..bf75b35 100644 --- a/src/xmlpromptgenerator.cpp +++ b/src/xmlpromptgenerator.cpp @@ -307,7 +307,7 @@ int XmlPromptGenerator::parseGrammar Grammar *rootGrammar; try { - std::auto_ptr source ( WrapXerces::resolveEntity + boost::scoped_ptr source ( WrapXerces::resolveEntity ( publicId , systemId , baseFileName ) ); if ( !source.get() ) { diff --git a/src/xmlpromptgenerator.h b/src/xmlpromptgenerator.h index 39435cb..86effb7 100644 --- a/src/xmlpromptgenerator.h +++ b/src/xmlpromptgenerator.h @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include "wrapexpat.h" #include "parserdata.h" #include @@ -102,7 +102,7 @@ class XmlPromptGenerator : public WrapExpat, public wxThread return d->elementStructureMap; } private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL starthandler ( void *data, const XML_Char *el, diff --git a/src/xmlrulereader.h b/src/xmlrulereader.h index bfa1247..6436e6d 100644 --- a/src/xmlrulereader.h +++ b/src/xmlrulereader.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "wrapexpat.h" #include "rule.h" @@ -81,7 +81,7 @@ class XmlRuleReader : public WrapExpat void getExcludeVector ( vector &v ); void getIncludeVector ( vector &v ); private: - std::auto_ptr ud; + boost::scoped_ptr ud; boost::shared_ptr > dictionary, passiveDictionary; boost::shared_ptr > > ruleVector; diff --git a/src/xmlschemagenerator.cpp b/src/xmlschemagenerator.cpp index 73c7a2c..13d9550 100644 --- a/src/xmlschemagenerator.cpp +++ b/src/xmlschemagenerator.cpp @@ -20,8 +20,8 @@ #include "xmlschemagenerator.h" #include "wrapxerces.h" -#include #include +#include #include #include #include @@ -54,7 +54,7 @@ const wxString &XmlSchemaGenerator::generate ( mSchema.Clear(); XercesCatalogResolver catalogResolver; - std::auto_ptr parser ( new XercesDOMParser() ); + boost::scoped_ptr parser ( new XercesDOMParser() ); parser->setDoNamespaces ( true ); parser->setDoSchema ( true ); parser->setValidationSchemaFullChecking ( false ); diff --git a/src/xmlschemalocator.h b/src/xmlschemalocator.h index 95eea53..c424c31 100644 --- a/src/xmlschemalocator.h +++ b/src/xmlschemalocator.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "wrapexpat.h" struct SchemaLocatorData @@ -39,7 +39,7 @@ class XmlSchemaLocator : public WrapExpat virtual ~XmlSchemaLocator(); std::string getSchemaLocation(); private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL starthandler ( void *data, const XML_Char *el, diff --git a/src/xmlschemaparser.h b/src/xmlschemaparser.h index 996ce1b..50a8789 100644 --- a/src/xmlschemaparser.h +++ b/src/xmlschemaparser.h @@ -23,6 +23,7 @@ #include #include +#include #include "wrapexpat.h" #include "xmlpromptgenerator.h" @@ -51,7 +52,7 @@ public: STATE_CHOICE }; private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL starthandler ( void *data, const XML_Char *el, diff --git a/src/xmlshallowvalidator.h b/src/xmlshallowvalidator.h index 98e6aa0..845791d 100644 --- a/src/xmlshallowvalidator.h +++ b/src/xmlshallowvalidator.h @@ -26,8 +26,7 @@ #include #include #include -#include -#include +#include #include "wrapexpat.h" struct XmlShallowValidatorData : public ParserData @@ -67,7 +66,7 @@ class XmlShallowValidator : public WrapExpat std::vector > getPositionVector(); bool getOverrideFailure(); private: - std::auto_ptr vd; + boost::scoped_ptr vd; static void XMLCALL start ( void *data, const XML_Char *el, const XML_Char **attr ); static void XMLCALL end ( void *data, const XML_Char *el ); static void XMLCALL skippedentity ( void *data, const XML_Char *entityName, diff --git a/src/xmlsuppressprodnote.h b/src/xmlsuppressprodnote.h index 4bb913f..4227120 100644 --- a/src/xmlsuppressprodnote.h +++ b/src/xmlsuppressprodnote.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "wrapexpat.h" struct SuppressProdnoteData : public ParserData @@ -53,7 +53,7 @@ class XmlSuppressProdnote : public WrapExpat return d->encoding; } private: - std::auto_ptr d; + boost::scoped_ptr d; std::string encoding, element, attribute; static void XMLCALL xmldeclhandler ( void *data, diff --git a/src/xmlutf8reader.h b/src/xmlutf8reader.h index 48720c2..6c4eacd 100644 --- a/src/xmlutf8reader.h +++ b/src/xmlutf8reader.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "wrapexpat.h" struct UtfData : public ParserData @@ -51,7 +51,7 @@ class XmlUtf8Reader : public WrapExpat return d->encoding; } private: - std::auto_ptr d; + boost::scoped_ptr d; std::string encoding; static void XMLCALL xmldeclhandler ( void *data, diff --git a/src/xmlwordcount.h b/src/xmlwordcount.h index 432cd70..a022ca1 100644 --- a/src/xmlwordcount.h +++ b/src/xmlwordcount.h @@ -22,7 +22,7 @@ #define XML_WORD_COUNT_H #include -#include +#include #include "wrapexpat.h" struct WordCountData : public ParserData @@ -39,7 +39,7 @@ class XmlWordCount : public WrapExpat int getWordCount(); private: - std::auto_ptr wcd; + boost::scoped_ptr wcd; static void XMLCALL characterdata ( void *data, const XML_Char *s, int len ); static void XMLCALL end ( void *data, const XML_Char *el ); }; diff --git a/src/xsllocator.h b/src/xsllocator.h index 055a079..c283096 100644 --- a/src/xsllocator.h +++ b/src/xsllocator.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "wrapexpat.h" struct XslLocatorData : public ParserData @@ -39,7 +39,7 @@ class XslLocator : public WrapExpat virtual ~XslLocator(); std::string getXslLocation(); private: - std::auto_ptr d; + boost::scoped_ptr d; static void XMLCALL starthandler ( void *data, const XML_Char *el,