Replace std::auto_ptr with boost::scoped_ptr

This commit is contained in:
Zane U. Ji 2019-12-01 22:12:17 +08:00
parent cf4066b9ef
commit b34f57b879
33 changed files with 90 additions and 102 deletions

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <memory>
#include <boost/scoped_ptr.hpp>
#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<wxFileDialog> fd ( new wxFileDialog (
boost::scoped_ptr<wxFileDialog> fd ( new wxFileDialog (
this,
_ ( "Select " ) + type,
dir,

View File

@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <memory>
#include "catalogresolver.h"
CatalogResolver::CatalogResolver()
@ -33,6 +32,5 @@ wxString CatalogResolver::catalogResolve (
const wxString &publicId,
const wxString &systemId )
{
//std::auto_ptr<WrapLibxml> libxml ( new WrapLibxml ( false, catalogPath ) );
return WrapLibxml::catalogResolve ( publicId, systemId );
}

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "globalreplacedialog.h"
#include "wrapregex.h"
@ -115,7 +115,7 @@ void GlobalReplaceDialog::OnOk ( wxCommandEvent& e )
{
try
{
std::auto_ptr<WrapRegex> wr ( new WrapRegex (
boost::scoped_ptr<WrapRegex> wr ( new WrapRegex (
findUtf8,
matchCase,
replaceUtf8 ) );

View File

@ -137,7 +137,7 @@ void HouseStyle::collectRules ( const std::string& fileName,
if ( !ReadFile::run ( filePath, buffer ) )
return;
std::auto_ptr<XmlRuleReader> xrr ( new XmlRuleReader (
boost::scoped_ptr<XmlRuleReader> xrr ( new XmlRuleReader (
dictionary,
passiveDictionary,
ruleVector ) );

View File

@ -25,8 +25,7 @@
#include <map>
#include <set>
#include <vector>
#include <memory>
#include <expat.h>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
using namespace std;
@ -50,7 +49,7 @@ class HouseStyleReader : public WrapExpat
virtual ~HouseStyleReader();
void getNodeVector ( vector<pair<string, unsigned> > &v );
private:
std::auto_ptr<HouseStyleReaderData> ud;
boost::scoped_ptr<HouseStyleReaderData> ud;
enum
{
STATE_UNKNOWN,

View File

@ -23,8 +23,7 @@
#include <set>
#include <string>
#include <memory>
#include <expat.h>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
#include "wrapregex.h"
#include "contexthandler.h"
@ -45,7 +44,7 @@ class HouseStyleWriter : public WrapExpat
~HouseStyleWriter();
string getOutput();
private:
std::auto_ptr<HouseStyleWriterData> hswd;
boost::scoped_ptr<HouseStyleWriterData> hswd;
enum
{
STATE_UNKNOWN,

View File

@ -24,8 +24,8 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <utility>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct Mp3AlbumData : public ParserData
@ -44,7 +44,7 @@ class Mp3Album : public WrapExpat
void getFileNameVector ( std::vector<std::pair<std::string, std::string> >& v );
std::string getAlbumTitle();
private:
std::auto_ptr<Mp3AlbumData> d;
boost::scoped_ptr<Mp3AlbumData> 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 );

View File

@ -385,7 +385,7 @@ StyleDialog::~StyleDialog()
void StyleDialog::OnColumnClick ( wxListEvent& event )
{
std::auto_ptr<SortData> data ( new SortData );
boost::scoped_ptr<SortData> 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<HouseStyle> hs ( new HouseStyle (
boost::scoped_ptr<HouseStyle> hs ( new HouseStyle (
(type == ID_TYPE_SPELL) ? HS_TYPE_SPELL : HS_TYPE_STYLE,
bufferUtf8,
ruleSetDirectory,

View File

@ -20,11 +20,11 @@
#include <wx/wx.h>
#include <wx/textbuf.h>
#include <boost/scoped_ptr.hpp>
#include "xmlctrl.h"
#include "validationthread.h"
#include "wrapxerces.h"
#include <stdexcept>
#include <memory>
#include "threadreaper.h"
extern wxCriticalSection xmlcopyeditorCriticalSection;
@ -51,7 +51,7 @@ ValidationThread::ValidationThread (
void *ValidationThread::Entry()
{
std::auto_ptr<WrapXerces> validator ( new WrapXerces() );
boost::scoped_ptr<WrapXerces> validator ( new WrapXerces() );
if ( TestDestroy() )
{

View File

@ -93,7 +93,7 @@ bool WrapDaisy::run (
fileIn.Replace ( _T("\\"), _T("/") );
stylesheet.Replace ( _T("\\"), _T("/") );
std::auto_ptr<wxProgressDialog> pd ( new wxProgressDialog (
boost::scoped_ptr<wxProgressDialog> pd ( new wxProgressDialog (
_ ( "Export in progress" ),
_ ( "Initializing..." ),
100,
@ -186,7 +186,7 @@ bool WrapDaisy::run (
return false;
}
auto_ptr<XmlSuppressProdnote> xsp ( new XmlSuppressProdnote() );
boost::scoped_ptr<XmlSuppressProdnote> xsp ( new XmlSuppressProdnote() );
if ( !xsp->parse ( output.c_str() ) )
{
frame->newDocument ( output );
@ -212,7 +212,7 @@ bool WrapDaisy::run (
return false;
}
auto_ptr<XmlProdnote> xp ( new XmlProdnote() );
boost::scoped_ptr<XmlProdnote> xp ( new XmlProdnote() );
if ( !xp->parse ( output.c_str() ) )
{
frame->newDocument ( output );
@ -298,7 +298,7 @@ bool WrapDaisy::run (
return false;
}
auto_ptr<XmlCopyImg> xci (
boost::scoped_ptr<XmlCopyImg> 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<Mp3Album> ma ( new Mp3Album() );
boost::scoped_ptr<Mp3Album> ma ( new Mp3Album() );
BinaryFile *binaryfile;
binaryfile = new BinaryFile ( fileWithSmilAttribs );

View File

@ -33,6 +33,7 @@
#include <sstream>
#include <utility>
#include <stdexcept>
#include <boost/scoped_ptr.hpp>
#include <boost/static_assert.hpp>
using namespace xercesc;
@ -94,7 +95,7 @@ bool WrapXerces::validateMemory (
const wxChar *messageEOL /*= _T("[br]")*/)
{
#if 0 // Test DOM parser
std::auto_ptr<XercesDOMParser> parser ( new XercesDOMParser() );
boost::scoped_ptr<XercesDOMParser> 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<SAX2XMLReader> parser ( XMLReaderFactory::createXMLReader() );
boost::scoped_ptr<SAX2XMLReader> 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<InputSource> source;
boost::scoped_ptr<InputSource> source;
if ( utf8Buffer != NULL )
{
source.reset ( new MemBufInputSource ( (XMLByte*) utf8Buffer, len,

View File

@ -24,7 +24,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "xmltextinfo.h"
struct DtdData : public ParserData
@ -49,7 +49,7 @@ class XmlAssociateDtd : public WrapExpat
return d->buffer;
}
private:
std::auto_ptr<DtdData> d;
boost::scoped_ptr<DtdData> d;
const XmlTextInfo &mInfo;
static void XMLCALL start (
void *data,

View File

@ -42,7 +42,7 @@ XmlAssociateXsd::XmlAssociateXsd (
XML_SetDefaultHandlerExpand ( p, defaulthandler );
XML_SetUserData ( p, this );
std::auto_ptr<XmlParseSchemaNs> parser ( new XmlParseSchemaNs() );
boost::scoped_ptr<XmlParseSchemaNs> parser ( new XmlParseSchemaNs() );
std::string normalisedPath, buffer;
normalisedPath = path.mb_str ( wxConvLocal );
if ( !ReadFile::run ( normalisedPath, buffer ) )

View File

@ -26,7 +26,7 @@
#include <expat.h>
#include <string>
#include <map>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct AssociateXsdData : public ParserData
@ -50,7 +50,7 @@ class XmlAssociateXsd : public WrapExpat
return d->buffer;
}
private:
std::auto_ptr<AssociateXsdData> d;
boost::scoped_ptr<AssociateXsdData> d;
std::string encoding;
std::map<std::string, std::string> namespaceMap;
static void XMLCALL start (

View File

@ -25,7 +25,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "xmltextinfo.h"
struct XslData : public ParserData
@ -49,7 +49,7 @@ class XmlAssociateXsl : public WrapExpat
return d->buffer;
}
private:
std::auto_ptr<XslData> d;
boost::scoped_ptr<XslData> d;
const XmlTextInfo &mInfo;
static void XMLCALL start (
void *data,

View File

@ -2137,14 +2137,10 @@ void MyFrame::OnFind ( wxCommandEvent& WXUNUSED ( event ) )
return;
#endif
if ( findDialog.get() )
{
findDialog = std::auto_ptr<wxFindReplaceDialog> ( 0 );
}
findDialog = ( std::auto_ptr<wxFindReplaceDialog> ( 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<wxFileDialog> fd ( new wxFileDialog (
boost::scoped_ptr<wxFileDialog> 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<ExportDialog> ed ( new ExportDialog (
boost::scoped_ptr<ExportDialog> 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<WrapLibxml> prettyPrinter ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<wxFileDialog> fd ( new wxFileDialog (
boost::scoped_ptr<wxFileDialog> 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<MyPropertySheet> mpsd ( new MyPropertySheet (
boost::scoped_ptr<MyPropertySheet> mpsd ( new MyPropertySheet (
this,
properties,
applicationDir,
@ -2711,11 +2707,7 @@ void MyFrame::OnFindReplace ( wxCommandEvent& WXUNUSED ( event ) )
#endif
if ( findDialog.get() )
{
findDialog = std::auto_ptr<wxFindReplaceDialog> ( 0 );
}
findDialog = std::auto_ptr<wxFindReplaceDialog> ( 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<GlobalReplaceDialog> grd ( new GlobalReplaceDialog (
boost::scoped_ptr<GlobalReplaceDialog> grd ( new GlobalReplaceDialog (
this,
findData.GetFindString(),
findData.GetReplaceString(),
@ -2797,7 +2789,7 @@ void MyFrame::OnGlobalReplace ( wxCommandEvent& event )
{
try
{
std::auto_ptr<WrapRegex> wr ( new WrapRegex (
boost::scoped_ptr<WrapRegex> 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<WrapExpat> we ( new WrapExpat() );
boost::scoped_ptr<WrapExpat> 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<StyleDialog> sd ( new StyleDialog (
boost::scoped_ptr<StyleDialog> sd ( new StyleDialog (
this,
wxICON ( appicon ),
rawBufferUtf8,
@ -3582,7 +3574,7 @@ void MyFrame::saveAs()
if ( defaultDir.empty() )
defaultDir = mLastDir;
auto_ptr<wxFileDialog> fd ( new wxFileDialog (
boost::scoped_ptr<wxFileDialog> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<WrapXerces> validator ( new WrapXerces() );
boost::scoped_ptr<WrapXerces> 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<wxTextEntryDialog> dlg ( new wxTextEntryDialog (
boost::scoped_ptr<wxTextEntryDialog> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> 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<XmlUtf8Reader> xur ( new XmlUtf8Reader (
boost::scoped_ptr<XmlUtf8Reader> 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<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
boost::scoped_ptr<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
int result = wl->saveEncoding ( utf8Buffer,
doc->getFullFileName(), fileName, NULL, wideEncoding );
if ( result == -1 )

View File

@ -51,9 +51,9 @@
#include <string>
#include <set>
#include <map>
#include <memory>
#include <vector>
#include <stdexcept>
#include <boost/scoped_ptr.hpp>
#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<wxFileConfig> config;
boost::scoped_ptr<wxFileConfig> config;
};
// forward declarations
@ -374,9 +374,9 @@ class MyFrame : public wxFrame
#ifndef __WXDEBUG__
wxLogNull logTarget;
#endif
std::auto_ptr<wxHtmlEasyPrinting> htmlPrinting;
std::auto_ptr<wxFindReplaceDialog> findDialog;
std::auto_ptr<wxHtmlHelpController> helpController;
boost::scoped_ptr<wxHtmlEasyPrinting> htmlPrinting;
boost::scoped_ptr<wxFindReplaceDialog> findDialog;
boost::scoped_ptr<wxHtmlHelpController> helpController;
wxBoxSizer *frameSizer;
wxMenuBar *menuBar;

View File

@ -24,7 +24,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct ImgData : public ParserData
@ -56,7 +56,7 @@ class XmlCopyImg : public WrapExpat
return d->encoding;
}
private:
std::auto_ptr<ImgData> d;
boost::scoped_ptr<ImgData> d;
std::string encoding, element, attribute;
static void XMLCALL xmldeclhandler (
void *data,

View File

@ -23,7 +23,7 @@
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct EncodingData : public ParserData
@ -42,7 +42,7 @@ class XmlEncodingSpy : public WrapExpat
return d->encoding;
}
private:
std::auto_ptr<EncodingData> d;
boost::scoped_ptr<EncodingData> d;
static void XMLCALL xmldeclhandler (
void *data,
const XML_Char *version,

View File

@ -25,8 +25,7 @@
#include <vector>
#include <map>
#include <set>
#include <memory>
#include <expat.h>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
using namespace std;
@ -64,7 +63,7 @@ class XmlFilterReader : public WrapExpat
void getIncludeVector ( vector<string> &v );
void getFilterMap ( map<string, map<string, set<string> > > &m );
private:
std::auto_ptr<FilterData> fd;
boost::scoped_ptr<FilterData> 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 );

View File

@ -24,7 +24,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct ParseSchemaNsData : public ParserData
@ -43,7 +43,7 @@ class XmlParseSchemaNs : public WrapExpat
return d->attributeVector;
}
private:
std::auto_ptr<ParseSchemaNsData> d;
boost::scoped_ptr<ParseSchemaNsData> d;
static void XMLCALL start (
void *data,
const XML_Char *el,

View File

@ -25,7 +25,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct ProdnoteData : public ParserData
@ -52,7 +52,7 @@ class XmlProdnote : public WrapExpat
return d->encoding;
}
private:
std::auto_ptr<ProdnoteData> d;
boost::scoped_ptr<ProdnoteData> d;
std::string encoding, element, attribute;
static void XMLCALL xmldeclhandler (
void *data,

View File

@ -307,7 +307,7 @@ int XmlPromptGenerator::parseGrammar
Grammar *rootGrammar;
try {
std::auto_ptr<InputSource> source ( WrapXerces::resolveEntity
boost::scoped_ptr<InputSource> source ( WrapXerces::resolveEntity
( publicId , systemId , baseFileName ) );
if ( !source.get() )
{

View File

@ -26,8 +26,8 @@
#include <wx/event.h>
#include <map>
#include <set>
#include <memory>
#include <string>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
#include "parserdata.h"
#include <xercesc/validators/common/ContentSpecNode.hpp>
@ -102,7 +102,7 @@ class XmlPromptGenerator : public WrapExpat, public wxThread
return d->elementStructureMap;
}
private:
std::auto_ptr<PromptGeneratorData> d;
boost::scoped_ptr<PromptGeneratorData> d;
static void XMLCALL starthandler (
void *data,
const XML_Char *el,

View File

@ -24,7 +24,7 @@
#include <set>
#include <string>
#include <vector>
#include <expat.h>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include "wrapexpat.h"
#include "rule.h"
@ -81,7 +81,7 @@ class XmlRuleReader : public WrapExpat
void getExcludeVector ( vector<string> &v );
void getIncludeVector ( vector<string> &v );
private:
std::auto_ptr<RuleData> ud;
boost::scoped_ptr<RuleData> ud;
boost::shared_ptr<StringSet<char> > dictionary, passiveDictionary;
boost::shared_ptr<vector<boost::shared_ptr<Rule> > > ruleVector;

View File

@ -20,8 +20,8 @@
#include "xmlschemagenerator.h"
#include "wrapxerces.h"
#include <memory>
#include <algorithm>
#include <boost/scoped_ptr.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/dom/DOMNamedNodeMap.hpp>
@ -54,7 +54,7 @@ const wxString &XmlSchemaGenerator::generate (
mSchema.Clear();
XercesCatalogResolver catalogResolver;
std::auto_ptr<XercesDOMParser> parser ( new XercesDOMParser() );
boost::scoped_ptr<XercesDOMParser> parser ( new XercesDOMParser() );
parser->setDoNamespaces ( true );
parser->setDoSchema ( true );
parser->setValidationSchemaFullChecking ( false );

View File

@ -23,7 +23,7 @@
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct SchemaLocatorData
@ -39,7 +39,7 @@ class XmlSchemaLocator : public WrapExpat
virtual ~XmlSchemaLocator();
std::string getSchemaLocation();
private:
std::auto_ptr<SchemaLocatorData> d;
boost::scoped_ptr<SchemaLocatorData> d;
static void XMLCALL starthandler (
void *data,
const XML_Char *el,

View File

@ -23,6 +23,7 @@
#include <expat.h>
#include <string>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
#include "xmlpromptgenerator.h"
@ -51,7 +52,7 @@ public:
STATE_CHOICE
};
private:
std::auto_ptr<SchemaParserData> d;
boost::scoped_ptr<SchemaParserData> d;
static void XMLCALL starthandler (
void *data,
const XML_Char *el,

View File

@ -26,8 +26,7 @@
#include <set>
#include <vector>
#include <utility>
#include <memory>
#include <expat.h>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct XmlShallowValidatorData : public ParserData
@ -67,7 +66,7 @@ class XmlShallowValidator : public WrapExpat
std::vector<std::pair<int, int> > getPositionVector();
bool getOverrideFailure();
private:
std::auto_ptr<XmlShallowValidatorData> vd;
boost::scoped_ptr<XmlShallowValidatorData> 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,

View File

@ -25,7 +25,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct SuppressProdnoteData : public ParserData
@ -53,7 +53,7 @@ class XmlSuppressProdnote : public WrapExpat
return d->encoding;
}
private:
std::auto_ptr<SuppressProdnoteData> d;
boost::scoped_ptr<SuppressProdnoteData> d;
std::string encoding, element, attribute;
static void XMLCALL xmldeclhandler (
void *data,

View File

@ -24,7 +24,7 @@
#include <vector>
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct UtfData : public ParserData
@ -51,7 +51,7 @@ class XmlUtf8Reader : public WrapExpat
return d->encoding;
}
private:
std::auto_ptr<UtfData> d;
boost::scoped_ptr<UtfData> d;
std::string encoding;
static void XMLCALL xmldeclhandler (
void *data,

View File

@ -22,7 +22,7 @@
#define XML_WORD_COUNT_H
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct WordCountData : public ParserData
@ -39,7 +39,7 @@ class XmlWordCount : public WrapExpat
int getWordCount();
private:
std::auto_ptr<WordCountData> wcd;
boost::scoped_ptr<WordCountData> wcd;
static void XMLCALL characterdata ( void *data, const XML_Char *s, int len );
static void XMLCALL end ( void *data, const XML_Char *el );
};

View File

@ -23,7 +23,7 @@
#include <expat.h>
#include <string>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include "wrapexpat.h"
struct XslLocatorData : public ParserData
@ -39,7 +39,7 @@ class XslLocator : public WrapExpat
virtual ~XslLocator();
std::string getXslLocation();
private:
std::auto_ptr<XslLocatorData> d;
boost::scoped_ptr<XslLocatorData> d;
static void XMLCALL starthandler (
void *data,
const XML_Char *el,