Commit aec9fd2d authored by Alexey.Musinov's avatar Alexey.Musinov Committed by Alexander Trofimov

выпиливание boost'a

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52942 954022d7-b5bf-4e40-9824-e11837661b57
parent 2f99fb0d
...@@ -47,14 +47,14 @@ namespace XML ...@@ -47,14 +47,14 @@ namespace XML
} }
Element::Element(boost::shared_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space) Element::Element(NSCommon::smart_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space)
: Space(space) : Space(space)
{ {
fromSource(source, ns, Space); fromSource(source, ns, Space);
} }
Element::Element(boost::shared_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space) Element::Element(NSCommon::smart_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space)
: Space(space) : Space(space)
{ {
fromSource(source, ns, Space); fromSource(source, ns, Space);
...@@ -84,7 +84,7 @@ namespace XML ...@@ -84,7 +84,7 @@ namespace XML
} }
void Element::fromSource(boost::shared_ptr<XSingleSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space) void Element::fromSource(NSCommon::smart_ptr<XSingleSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space)
{ {
Space = space; Space = space;
source->skipSpace(); source->skipSpace();
...@@ -179,7 +179,7 @@ namespace XML ...@@ -179,7 +179,7 @@ namespace XML
} }
void Element::fromSource(boost::shared_ptr<XWideSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space) void Element::fromSource(NSCommon::smart_ptr<XWideSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space)
{ {
Space = space; Space = space;
source->skipSpace(); source->skipSpace();
......
...@@ -2,19 +2,18 @@ ...@@ -2,19 +2,18 @@
#ifndef XML_PRIVATE_ELEMENT_INCLUDE_H_ #ifndef XML_PRIVATE_ELEMENT_INCLUDE_H_
#define XML_PRIVATE_XELEMENT_INCLUDE_H_ #define XML_PRIVATE_XELEMENT_INCLUDE_H_
#include <list>
#include <string>
#include "NodeContainer.h" #include "NodeContainer.h"
#include "property.h" #include "property.h"
#include "XAttributeContainer.h" #include "XAttributeContainer.h"
#include "XNamespaceContainer.h" #include "XNamespaceContainer.h"
#include "./../XName.h" #include "./../XName.h"
#include <string>
#include "XString.h" #include "XString.h"
#include "XSpace.h" #include "XSpace.h"
//#include "XSource.h"
#include "XSingleSource.h" #include "XSingleSource.h"
#include "XWideSource.h" #include "XWideSource.h"
#include <list>
namespace XML namespace XML
{ {
...@@ -34,8 +33,8 @@ namespace XML ...@@ -34,8 +33,8 @@ namespace XML
Element(); Element();
Element(const XML::XName& xname); Element(const XML::XName& xname);
Element(const XML::XName& xname, const XList& list); Element(const XML::XName& xname, const XList& list);
Element(boost::shared_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space); Element(NSCommon::smart_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space);
Element(boost::shared_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space); Element(NSCommon::smart_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space);
virtual ~Element(); virtual ~Element();
...@@ -45,8 +44,8 @@ namespace XML ...@@ -45,8 +44,8 @@ namespace XML
virtual const bool isComment() const; virtual const bool isComment() const;
public: public:
void fromSource(boost::shared_ptr<XSingleSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space); void fromSource(NSCommon::smart_ptr<XSingleSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space);
void fromSource(boost::shared_ptr<XWideSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space); void fromSource(NSCommon::smart_ptr<XWideSource> source, const XNamespaceContainer& defineNamespaces, const XSpace& space);
virtual const std::string ToString() const; virtual const std::string ToString() const;
virtual const std::wstring ToWString() const; virtual const std::wstring ToWString() const;
virtual void SaveToStringList(std::list<std::string>& strList)const; virtual void SaveToStringList(std::list<std::string>& strList)const;
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <string> #include <string>
#include <list> #include <list>
namespace XML namespace XML
{ {
namespace Private namespace Private
......
...@@ -93,7 +93,7 @@ namespace XML ...@@ -93,7 +93,7 @@ namespace XML
} }
void NodeContainer::fromSource(boost::shared_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space) void NodeContainer::fromSource(NSCommon::smart_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space)
{ {
if (space.isDefault()) if (space.isDefault())
source->skipSpace(); source->skipSpace();
...@@ -121,7 +121,7 @@ namespace XML ...@@ -121,7 +121,7 @@ namespace XML
} }
void NodeContainer::fromSource(boost::shared_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space) void NodeContainer::fromSource(NSCommon::smart_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space)
{ {
if (space.isDefault()) if (space.isDefault())
source->skipSpace(); source->skipSpace();
...@@ -204,7 +204,7 @@ namespace XML ...@@ -204,7 +204,7 @@ namespace XML
} }
const bool NodeContainer::isComment(boost::shared_ptr<XSingleSource> source) const bool NodeContainer::isComment(NSCommon::smart_ptr<XSingleSource> source)
{ {
if (source->get() == '!') if (source->get() == '!')
{ {
...@@ -223,7 +223,7 @@ namespace XML ...@@ -223,7 +223,7 @@ namespace XML
} }
void NodeContainer::insertComment(boost::shared_ptr<XSingleSource> source) void NodeContainer::insertComment(NSCommon::smart_ptr<XSingleSource> source)
{ {
std::string comment; std::string comment;
while(true) while(true)
...@@ -252,7 +252,7 @@ namespace XML ...@@ -252,7 +252,7 @@ namespace XML
} }
const bool NodeContainer::isComment(boost::shared_ptr<XWideSource> source) const bool NodeContainer::isComment(NSCommon::smart_ptr<XWideSource> source)
{ {
if (source->get() == L'!') if (source->get() == L'!')
{ {
...@@ -271,7 +271,7 @@ namespace XML ...@@ -271,7 +271,7 @@ namespace XML
} }
void NodeContainer::insertComment(boost::shared_ptr<XWideSource> source) void NodeContainer::insertComment(NSCommon::smart_ptr<XWideSource> source)
{ {
std::wstring comment; std::wstring comment;
while(true) while(true)
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
#ifndef XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_ #ifndef XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_
#define XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_ #define XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_
#include "Node.h"
#include <string> #include <string>
#include <list>
#include "Node.h"
#include "XNodeContainer.h" #include "XNodeContainer.h"
#include "XElementContainer.h" #include "XElementContainer.h"
#include "XTextContainer.h" #include "XTextContainer.h"
...@@ -11,7 +13,8 @@ ...@@ -11,7 +13,8 @@
#include "XSpace.h" #include "XSpace.h"
#include "XSingleSource.h" #include "XSingleSource.h"
#include "XWideSource.h" #include "XWideSource.h"
#include <list>
#include "../../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -43,8 +46,8 @@ namespace XML ...@@ -43,8 +46,8 @@ namespace XML
virtual const bool isComment() const; virtual const bool isComment() const;
public: public:
void fromSource(boost::shared_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space); void fromSource(NSCommon::smart_ptr<XSingleSource> source, const XNamespaceContainer& ns, const XSpace& space);
void fromSource(boost::shared_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space); void fromSource(NSCommon::smart_ptr<XWideSource> source, const XNamespaceContainer& ns, const XSpace& space);
virtual const std::string ToString() const; virtual const std::string ToString() const;
virtual const std::wstring ToWString() const; virtual const std::wstring ToWString() const;
virtual void SaveToStringList(std::list<std::string>& strList)const; virtual void SaveToStringList(std::list<std::string>& strList)const;
...@@ -52,10 +55,7 @@ namespace XML ...@@ -52,10 +55,7 @@ namespace XML
public: public:
template<template<typename T, typename A> class C, typename T, typename A> template<template<typename T, typename A> class C, typename T, typename A>
explicit NodeContainer(const C<T, A>& container) explicit NodeContainer(const C<T, A>& container) : Nodes(), Elements(Nodes), Texts(Nodes)
: Nodes(),
Elements(Nodes),
Texts(Nodes)
{ {
for (C<T, A>::const_iterator i = container.begin(); i != container.end(); ++i) for (C<T, A>::const_iterator i = container.begin(); i != container.end(); ++i)
Nodes.push_back(Write(*i)); Nodes.push_back(Write(*i));
...@@ -69,10 +69,10 @@ namespace XML ...@@ -69,10 +69,10 @@ namespace XML
void Add(const XList& list); void Add(const XList& list);
private: private:
const bool isComment(boost::shared_ptr<XSingleSource> source); const bool isComment(NSCommon::smart_ptr<XSingleSource> source);
void insertComment(boost::shared_ptr<XSingleSource> source); void insertComment(NSCommon::smart_ptr<XSingleSource> source);
const bool isComment(boost::shared_ptr<XWideSource> source); const bool isComment(NSCommon::smart_ptr<XWideSource> source);
void insertComment(boost::shared_ptr<XWideSource> source); void insertComment(NSCommon::smart_ptr<XWideSource> source);
public: public:
XNodeContainer Nodes; XNodeContainer Nodes;
......
...@@ -6,21 +6,15 @@ ...@@ -6,21 +6,15 @@
#include "XDeclaration.h" #include "XDeclaration.h"
#include "Encoding.h" #include "Encoding.h"
namespace XML namespace XML
{ {
namespace Private namespace Private
{ {
XDeclaration::XDeclaration() : Version("1.0"), Encoding("UTF-8"), Standalone("yes")
XDeclaration::XDeclaration()
: Version("1.0"),
Encoding("UTF-8"),
Standalone("yes")
{ {
} }
void XDeclaration::fromSource(NSCommon::smart_ptr<XSingleSource> source)
void XDeclaration::fromSource(boost::shared_ptr<XSingleSource> source)
{ {
source->find('?'); source->find('?');
source->next(); source->next();
...@@ -36,8 +30,7 @@ namespace XML ...@@ -36,8 +30,7 @@ namespace XML
source->next(); source->next();
} }
void XDeclaration::fromSource(NSCommon::smart_ptr<XWideSource> source)
void XDeclaration::fromSource(boost::shared_ptr<XWideSource> source)
{ {
source->find(L'?'); source->find(L'?');
source->next(); source->next();
...@@ -53,21 +46,18 @@ namespace XML ...@@ -53,21 +46,18 @@ namespace XML
source->next(); source->next();
} }
const std::string XDeclaration::ToString() const const std::string XDeclaration::ToString() const
{ {
return "<?xml version=\"" + Version.ToString() + "\" encoding=\"" + Encoding.ToString() + return "<?xml version=\"" + Version.ToString() + "\" encoding=\"" + Encoding.ToString() +
(Standalone.is_init() ? ("\" standalone=\"" + Standalone.ToString()) : "") + "\" ?>"; (Standalone.is_init() ? ("\" standalone=\"" + Standalone.ToString()) : "") + "\" ?>";
} }
const std::wstring XDeclaration::ToWString() const const std::wstring XDeclaration::ToWString() const
{ {
return L"<?xml version=\"" + Encoding::utf82unicode(Version.ToString()) + L"\" encoding=\"" + L"Unicode" + return L"<?xml version=\"" + Encoding::utf82unicode(Version.ToString()) + L"\" encoding=\"" + L"Unicode" +
(Standalone.is_init() ? (L"\" standalone=\"" + Encoding::utf82unicode(Standalone.ToString())) : L"") + L"\" ?>"; (Standalone.is_init() ? (L"\" standalone=\"" + Encoding::utf82unicode(Standalone.ToString())) : L"") + L"\" ?>";
} }
void XDeclaration::setValue(const std::string& name, const std::string& value) void XDeclaration::setValue(const std::string& name, const std::string& value)
{ {
if (name == "version") if (name == "version")
......
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
#define XML_XDECLARATION_INCLUDE_H_ #define XML_XDECLARATION_INCLUDE_H_
#include <string> #include <string>
#include "property.h" #include "property.h"
#include "nullable_property.h" #include "nullable_property.h"
#include "./../Limit/Version.h" #include "./../Limit/Version.h"
#include "./../Limit/Encoding.h" #include "./../Limit/Encoding.h"
#include "./../Limit/Standalone.h" #include "./../Limit/Standalone.h"
//#include "XSource.h"
#include "XSingleSource.h" #include "XSingleSource.h"
#include "XWideSource.h" #include "XWideSource.h"
#include "../../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -23,15 +24,15 @@ namespace XML ...@@ -23,15 +24,15 @@ namespace XML
XDeclaration(); XDeclaration();
public: public:
void fromSource(boost::shared_ptr<XSingleSource> source); void fromSource(NSCommon::smart_ptr<XSingleSource> source);
void fromSource(boost::shared_ptr<XWideSource> source); void fromSource(NSCommon::smart_ptr<XWideSource> source);
const std::string ToString() const; const std::string ToString() const;
const std::wstring ToWString() const; const std::wstring ToWString() const;
public: public:
property<std::string, Limit::Version> Version; property<std::string, Limit::Version> Version;
property<std::string, Limit::Encoding> Encoding; property<std::string, Limit::Encoding> Encoding;
nullable_property<std::string, Limit::Standalone> Standalone; nullable_property<std::string, Limit::Standalone> Standalone;
private: private:
void setValue(const std::string& name, const std::string& value); void setValue(const std::string& name, const std::string& value);
......
...@@ -48,14 +48,16 @@ namespace XML ...@@ -48,14 +48,16 @@ namespace XML
const bool XElementContainer::exist(const XName& xname) const const bool XElementContainer::exist(const XName& xname) const
{ {
//for (const_iterator i = begin(); i != end(); ++i) if (m_container.IsInit())
//{
for (std::list<XNode>::iterator i = m_container->begin(); i != m_container->end(); ++i)
{ {
if(i->isElement()) const std::list<XNode>& container = m_container.operator*();
for (std::list<XNode>::const_iterator i = container.begin(); i != container.end(); ++i)
{ {
if (XElement(*i)->XName == xname) if(i->isElement())
return true; {
if (XElement(*i)->XName == xname)
return true;
}
} }
} }
return false; return false;
...@@ -63,8 +65,8 @@ namespace XML ...@@ -63,8 +65,8 @@ namespace XML
XElement XElementContainer::operator[] (const XName& xname) XElement XElementContainer::operator[] (const XName& xname)
{ {
//for (iterator i = begin(); i != end(); ++i) const std::list<XNode>& container = m_container.operator*();
for (std::list<XNode>::iterator i = m_container->begin(); i != m_container->end(); ++i) for (std::list<XNode>::const_iterator i = container.begin(); i != container.end(); ++i)
{ {
if(i->isElement()) if(i->isElement())
{ {
...@@ -72,8 +74,7 @@ namespace XML ...@@ -72,8 +74,7 @@ namespace XML
return *i; return *i;
} }
} }
//for (iterator i = begin(); i != end(); ++i) for (std::list<XNode>::const_iterator i = container.begin(); i != container.end(); ++i)
for (std::list<XNode>::iterator i = m_container->begin(); i != m_container->end(); ++i)
{ {
if(i->isElement()) if(i->isElement())
{ {
...@@ -86,9 +87,8 @@ namespace XML ...@@ -86,9 +87,8 @@ namespace XML
const XElement XElementContainer::operator[] (const XName& xname) const const XElement XElementContainer::operator[] (const XName& xname) const
{ {
//for (const_iterator i = begin(); i != end(); ++i) const std::list<XNode>& container = m_container.operator*();
//{ for (std::list<XNode>::const_iterator i = container.begin(); i != container.end(); ++i)
for (std::list<XNode>::iterator i = m_container->begin(); i != m_container->end(); ++i)
{ {
if(i->isElement()) if(i->isElement())
{ {
...@@ -96,9 +96,8 @@ namespace XML ...@@ -96,9 +96,8 @@ namespace XML
return *i; return *i;
} }
} }
//for (const_iterator i = begin(); i != end(); ++i)
//{ for (std::list<XNode>::const_iterator i = container.begin(); i != container.end(); ++i)
for (std::list<XNode>::iterator i = m_container->begin(); i != m_container->end(); ++i)
{ {
if(i->isElement()) if(i->isElement())
{ {
...@@ -106,6 +105,7 @@ namespace XML ...@@ -106,6 +105,7 @@ namespace XML
return *i; return *i;
} }
} }
return nullXElement; return nullXElement;
} }
......
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
#ifndef XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_ #ifndef XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_
#define XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_ #define XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_
#include <boost/shared_ptr.hpp>
#include <list> #include <list>
#include <boost/iterator/filter_iterator.hpp> #include <boost/iterator/filter_iterator.hpp>
#include "Filter/Element.h" #include "Filter/Element.h"
#include "XNamespaceContainer.h" #include "XNamespaceContainer.h"
#include "../../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -36,7 +37,7 @@ namespace XML ...@@ -36,7 +37,7 @@ namespace XML
public: public:
XElementContainer const* const operator->() const {return this;} XElementContainer const* const operator->() const {return this;}
XElementContainer* operator->() {return this;} XElementContainer* operator->() {return this;}
const bool exist(const XName& xname) const; const bool exist(const XName& xname) const;
XElement operator[] (const XName& xname); XElement operator[] (const XName& xname);
...@@ -54,7 +55,7 @@ namespace XML ...@@ -54,7 +55,7 @@ namespace XML
const_iterator end() const; const_iterator end() const;
private: private:
boost::shared_ptr<std::list<XNode> > m_container; NSCommon::smart_ptr<std::list<XNode> > m_container;
}; };
} // namespace Private } // namespace Private
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
#ifndef XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_ #ifndef XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_
#define XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_ #define XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_
#include "XContainer.h"
#include "./../XNamespace.h"
#include <string> #include <string>
#include "XContainer.h"
#include "./../XNamespace.h"
namespace XML namespace XML
{ {
...@@ -17,7 +17,7 @@ namespace XML ...@@ -17,7 +17,7 @@ namespace XML
const bool exist(const std::string& name) const; const bool exist(const std::string& name) const;
XNamespaceContainer const* const operator->() const {return this;} XNamespaceContainer const* const operator->() const {return this;}
XNamespaceContainer* operator->() {return this;} XNamespaceContainer* operator->() {return this;}
XNamespace& operator[] (const std::string& name); XNamespace& operator[] (const std::string& name);
const XNamespace& operator[] (const std::string& name) const; const XNamespace& operator[] (const std::string& name) const;
......
...@@ -77,7 +77,7 @@ namespace XML ...@@ -77,7 +77,7 @@ namespace XML
} }
} }
const boost::shared_ptr<std::list<XNode> > XNodeContainer::container() const const NSCommon::smart_ptr<std::list<XNode> > XNodeContainer::container() const
{ {
return m_container; return m_container;
} }
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <boost/shared_ptr.hpp>
#include <list> #include <list>
#include "../../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -26,12 +26,9 @@ namespace XML ...@@ -26,12 +26,9 @@ namespace XML
void merge(const XNodeContainer& other); void merge(const XNodeContainer& other);
public: public:
//typedef std::vector<XNode>::iterator iterator;
//typedef std::vector<XNode>::const_iterator const_iterator;
typedef std::list<XNode>::iterator iterator; typedef std::list<XNode>::iterator iterator;
typedef std::list<XNode>::const_iterator const_iterator; typedef std::list<XNode>::const_iterator const_iterator;
public: public:
XNodeContainer const* const operator->() const {return this;} XNodeContainer const* const operator->() const {return this;}
XNodeContainer* operator->() {return this;} XNodeContainer* operator->() {return this;}
...@@ -49,10 +46,10 @@ namespace XML ...@@ -49,10 +46,10 @@ namespace XML
const_iterator end() const {return m_container->end();} const_iterator end() const {return m_container->end();}
public: public:
const boost::shared_ptr<std::list<XNode> > container() const; const NSCommon::smart_ptr<std::list<XNode> > container() const;
private: private:
boost::shared_ptr<std::list<XNode> > m_container; NSCommon::smart_ptr<std::list<XNode> > m_container;
}; };
} // namespace Private } // namespace Private
} // namespace XML } // namespace XML
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#ifndef XML_PRIVATE_XPOINTER_INCLUDE_H_ #ifndef XML_PRIVATE_XPOINTER_INCLUDE_H_
#define XML_PRIVATE_XPOINTER_INCLUDE_H_ #define XML_PRIVATE_XPOINTER_INCLUDE_H_
#include <boost/shared_ptr.hpp> #include "../../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -14,24 +14,27 @@ namespace XML ...@@ -14,24 +14,27 @@ namespace XML
public: public:
XPointer() {} XPointer() {}
XPointer(T* ptr) : m_ptr(ptr) {} XPointer(T* ptr) : m_ptr(ptr) {}
XPointer(const boost::shared_ptr<T>& ptr) : m_ptr(ptr) {} XPointer(const NSCommon::smart_ptr<T>& ptr) : m_ptr(ptr) {}
template<class E> template<class E>
XPointer(const XPointer<E>& rhs) : m_ptr(boost::dynamic_pointer_cast<T>(rhs.get_ptr())) {} XPointer(const XPointer<E>& rhs)
{
m_ptr = rhs.get_ptr().smart_dynamic_cast<T>();
}
boost::shared_ptr<T> get_ptr() const {return m_ptr;} NSCommon::smart_ptr<T> get_ptr() const {return m_ptr;}
public: public:
T const* const operator->() const {return m_ptr.get();} T const* const operator->() const {return m_ptr.operator->();}
T* operator->() {return m_ptr.get();} T* operator->() {return m_ptr.operator->();}
const T& operator*() const {return *m_ptr;} const T& operator*() const {return (m_ptr.operator*());}
T& operator*() {return *m_ptr;} T& operator*() {return (m_ptr.operator*());}
const bool is_init() const {return m_ptr != 0;} const bool is_init() const {return m_ptr.is_init();}
protected: protected:
boost::shared_ptr<T> m_ptr; NSCommon::smart_ptr<T> m_ptr;
protected: protected:
typedef XPointer<T> base; typedef XPointer<T> base;
......
...@@ -2,16 +2,14 @@ ...@@ -2,16 +2,14 @@
#ifndef XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_ #ifndef XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_
#define XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_ #define XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_
//#include "XSource.h"
#include <iterator> #include <iterator>
#include <string> #include <string>
namespace XML namespace XML
{ {
namespace Private namespace Private
{ {
class XSingleSource// : public XSource class XSingleSource
{ {
public: public:
virtual ~XSingleSource(); virtual ~XSingleSource();
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#ifndef XML_PRIVATE_XSPACE_INCLUDE_H_ #ifndef XML_PRIVATE_XSPACE_INCLUDE_H_
#define XML_PRIVATE_XSPACE_INCLUDE_H_ #define XML_PRIVATE_XSPACE_INCLUDE_H_
namespace XML namespace XML
{ {
namespace Private namespace Private
......
...@@ -7,24 +7,19 @@ ...@@ -7,24 +7,19 @@
#include "XNodeContainer.h" #include "XNodeContainer.h"
#include "./../XText.h" #include "./../XText.h"
namespace XML namespace XML
{ {
namespace Private namespace Private
{ {
XTextContainer::XTextContainer(const XNodeContainer& nodes) : m_container(nodes.container())
XTextContainer::XTextContainer(const XNodeContainer& nodes)
: m_container(nodes.container())
{ {
} }
const bool XTextContainer::empty() const const bool XTextContainer::empty() const
{ {
return size() == 0; return size() == 0;
} }
const size_t XTextContainer::size() const const size_t XTextContainer::size() const
{ {
size_t size = 0; size_t size = 0;
...@@ -33,7 +28,6 @@ namespace XML ...@@ -33,7 +28,6 @@ namespace XML
return size; return size;
} }
void XTextContainer::push_back(const XText& text) void XTextContainer::push_back(const XText& text)
{ {
if (text.is_init()) if (text.is_init())
...@@ -42,13 +36,11 @@ namespace XML ...@@ -42,13 +36,11 @@ namespace XML
} }
} }
void XTextContainer::Add(const XML::XText& text) void XTextContainer::Add(const XML::XText& text)
{ {
push_back(text); push_back(text);
} }
const XString XTextContainer::text() const const XString XTextContainer::text() const
{ {
std::string text; std::string text;
...@@ -59,30 +51,25 @@ namespace XML ...@@ -59,30 +51,25 @@ namespace XML
return text.empty() ? XString() : text; return text.empty() ? XString() : text;
} }
XTextContainer::iterator XTextContainer:: begin() XTextContainer::iterator XTextContainer:: begin()
{ {
return iterator(m_container->begin(), m_container->end()); return iterator(m_container->begin(), m_container->end());
} }
XTextContainer::iterator XTextContainer::end() XTextContainer::iterator XTextContainer::end()
{ {
return iterator(m_container->end(), m_container->end()); return iterator(m_container->end(), m_container->end());
} }
XTextContainer::const_iterator XTextContainer::begin() const XTextContainer::const_iterator XTextContainer::begin() const
{ {
return const_iterator(m_container->begin(), m_container->end()); return const_iterator(m_container->begin(), m_container->end());
} }
XTextContainer::const_iterator XTextContainer::end() const XTextContainer::const_iterator XTextContainer::end() const
{ {
return const_iterator(m_container->end(), m_container->end()); return const_iterator(m_container->end(), m_container->end());
} }
} // namespace Private } // namespace Private
} // namespace XML } // namespace XML
\ No newline at end of file
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
#ifndef XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_ #ifndef XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_
#define XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_ #define XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_
#include <boost/shared_ptr.hpp> #include <vector>
//#include <vector>
#include <list> #include <list>
#include <boost/iterator/filter_iterator.hpp> #include <boost/iterator/filter_iterator.hpp>
#include "Filter/Text.h" #include "Filter/Text.h"
#include "XString.h" #include "XString.h"
#include "../../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -44,7 +44,7 @@ namespace XML ...@@ -44,7 +44,7 @@ namespace XML
const_iterator end() const; const_iterator end() const;
private: private:
boost::shared_ptr<std::list<XNode> > m_container; NSCommon::smart_ptr<std::list<XNode> > m_container;
}; };
} // namespace Private } // namespace Private
} // namespace XML } // namespace XML
......
...@@ -2,16 +2,14 @@ ...@@ -2,16 +2,14 @@
#ifndef XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_ #ifndef XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_
#define XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_ #define XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_
//#include "XSource.h"
#include <iterator> #include <iterator>
#include <string> #include <string>
namespace XML namespace XML
{ {
namespace Private namespace Private
{ {
class XWideSource //: public XSource class XWideSource
{ {
public: public:
enum eSourceType {estLittleEndian, estBigEndian, estStringSource}; enum eSourceType {estLittleEndian, estBigEndian, estStringSource};
...@@ -48,7 +46,6 @@ namespace XML ...@@ -48,7 +46,6 @@ namespace XML
protected: protected:
std::istreambuf_iterator<wchar_t> m_iterator; std::istreambuf_iterator<wchar_t> m_iterator;
wchar_t m_current; wchar_t m_current;
//bool m_littleEndian;
eSourceType m_SourceType; eSourceType m_SourceType;
}; };
} // namespace Private } // namespace Private
......
...@@ -5,17 +5,13 @@ ...@@ -5,17 +5,13 @@
#include "XComment.h" #include "XComment.h"
#include "XNode.h" #include "XNode.h"
#include <boost/shared_ptr.hpp>
namespace XML namespace XML
{ {
XComment::XComment(const XNode& xnode) XComment::XComment(const XNode& xnode)
: base(boost::dynamic_pointer_cast<Private::Comment>(xnode.get_ptr())), : base(xnode.get_ptr().smart_dynamic_cast<Private::Comment>()),
Value(m_ptr->Value) Value(m_ptr->Value)
{ {
} }
} // namespace XML } // namespace XML
\ No newline at end of file
...@@ -9,58 +9,48 @@ ...@@ -9,58 +9,48 @@
#include "XText.h" #include "XText.h"
#include "Private/XList.h" #include "Private/XList.h"
namespace XML namespace XML
{ {
XContainer::XContainer() XContainer::XContainer()
: base(new Private::NodeContainer()) : base(new Private::NodeContainer())
{ {
} }
XContainer::XContainer(const XNode& xnode) XContainer::XContainer(const XNode& xnode)
: base(boost::dynamic_pointer_cast<Private::NodeContainer>(xnode.get_ptr())) : base(xnode.get_ptr().smart_dynamic_cast<Private::NodeContainer>())
{ {
} }
XContainer::XContainer(const XElement& element) XContainer::XContainer(const XElement& element)
: base(new Private::NodeContainer(element)) : base(new Private::NodeContainer(element))
{ {
} }
XContainer::XContainer(const XText& text) XContainer::XContainer(const XText& text)
: base(new Private::NodeContainer(text)) : base(new Private::NodeContainer(text))
{ {
} }
XContainer::XContainer(const Private::XList& list) XContainer::XContainer(const Private::XList& list)
: base(new Private::NodeContainer(list)) : base(new Private::NodeContainer(list))
{ {
} }
void XContainer::Add(const XNode& node) void XContainer::Add(const XNode& node)
{ {
m_ptr->Add(node); m_ptr->Add(node);
} }
void XContainer::Add(const XElement& element) void XContainer::Add(const XElement& element)
{ {
m_ptr->Add(element); m_ptr->Add(element);
} }
void XContainer::Add(const XText& text) void XContainer::Add(const XText& text)
{ {
m_ptr->Add(text); m_ptr->Add(text);
} }
void XContainer::Add(const Private::XList& list) void XContainer::Add(const Private::XList& list)
{ {
m_ptr->Add(list); m_ptr->Add(list);
......
...@@ -27,17 +27,17 @@ namespace XML ...@@ -27,17 +27,17 @@ namespace XML
TxtFile text(path); TxtFile text(path);
if(text.isUnicode()) if(text.isUnicode())
{ {
boost::shared_ptr<Private::XWideSource> xsource(new Private::XWFileSource(path, Private::XWideSource::estLittleEndian)); NSCommon::smart_ptr<Private::XWideSource> xsource(new Private::XWFileSource(path, Private::XWideSource::estLittleEndian));
Load(xsource, space); Load(xsource, space);
} }
else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM())) else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM()))
{ {
boost::shared_ptr<Private::XWideSource> xsource(new Private::XWFileSource(path, Private::XWideSource::estBigEndian)); NSCommon::smart_ptr<Private::XWideSource> xsource(new Private::XWFileSource(path, Private::XWideSource::estBigEndian));
Load(xsource, space); Load(xsource, space);
} }
else else
{ {
boost::shared_ptr<Private::XSingleSource> xsource(new Private::XFileSource(path)); NSCommon::smart_ptr<Private::XSingleSource> xsource(new Private::XFileSource(path));
Load(xsource, space); Load(xsource, space);
} }
} }
...@@ -45,14 +45,14 @@ namespace XML ...@@ -45,14 +45,14 @@ namespace XML
XDocument::XDocument(const std::string& source, const bool space) XDocument::XDocument(const std::string& source, const bool space)
{ {
boost::shared_ptr<Private::XSingleSource> xsource(new Private::XStringSource(source)); NSCommon::smart_ptr<Private::XSingleSource> xsource(new Private::XStringSource(source));
Load(xsource, space); Load(xsource, space);
} }
XDocument::XDocument(const std::wstring& source, const bool space) XDocument::XDocument(const std::wstring& source, const bool space)
{ {
boost::shared_ptr<Private::XWideSource> xsource(new Private::XWStringSource(source)); NSCommon::smart_ptr<Private::XWideSource> xsource(new Private::XWStringSource(source));
Load(xsource, space); Load(xsource, space);
} }
...@@ -61,17 +61,17 @@ namespace XML ...@@ -61,17 +61,17 @@ namespace XML
TxtFile text(source); TxtFile text(source);
if(text.isUnicode()) if(text.isUnicode())
{ {
boost::shared_ptr<Private::XWideSource> xsource(new Private::XWFileSource(source, Private::XWideSource::estLittleEndian)); NSCommon::smart_ptr<Private::XWideSource> xsource(new Private::XWFileSource(source, Private::XWideSource::estLittleEndian));
Load(xsource, space); Load(xsource, space);
} }
else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM())) else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM()))
{ {
boost::shared_ptr<Private::XWideSource> xsource(new Private::XWFileSource(source, Private::XWideSource::estBigEndian)); NSCommon::smart_ptr<Private::XWideSource> xsource(new Private::XWFileSource(source, Private::XWideSource::estBigEndian));
Load(xsource, space); Load(xsource, space);
} }
else else
{ {
boost::shared_ptr<Private::XSingleSource> xsource(new Private::XFileSource(source)); NSCommon::smart_ptr<Private::XSingleSource> xsource(new Private::XFileSource(source));
Load(xsource, space); Load(xsource, space);
} }
} }
...@@ -127,7 +127,7 @@ namespace XML ...@@ -127,7 +127,7 @@ namespace XML
} }
void XDocument::Load(boost::shared_ptr<Private::XSingleSource> source, const bool space) void XDocument::Load(NSCommon::smart_ptr<Private::XSingleSource> source, const bool space)
{ {
source->findAndSkip('<'); source->findAndSkip('<');
if (source->get() == '?') if (source->get() == '?')
...@@ -140,7 +140,7 @@ namespace XML ...@@ -140,7 +140,7 @@ namespace XML
} }
void XDocument::Load(boost::shared_ptr<Private::XWideSource> source, const bool space) void XDocument::Load(NSCommon::smart_ptr<Private::XWideSource> source, const bool space)
{ {
source->findAndSkip(L'<'); source->findAndSkip(L'<');
if (source->get() == L'?') if (source->get() == L'?')
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#include "Private/XDeclaration.h" #include "Private/XDeclaration.h"
#include "Private/XSingleSource.h" #include "Private/XSingleSource.h"
#include "Private/XWideSource.h" #include "Private/XWideSource.h"
#include <boost/shared_ptr.hpp>
#include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" #include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
#include "../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -40,8 +40,8 @@ namespace XML ...@@ -40,8 +40,8 @@ namespace XML
XElement Root; XElement Root;
private: private:
void Load(boost::shared_ptr<Private::XSingleSource> source, const bool space = false); void Load(NSCommon::smart_ptr<Private::XSingleSource> source, const bool space = false);
void Load(boost::shared_ptr<Private::XWideSource> source, const bool space = false); void Load(NSCommon::smart_ptr<Private::XWideSource> source, const bool space = false);
}; };
} // namespace XML } // namespace XML
......
...@@ -13,16 +13,13 @@ ...@@ -13,16 +13,13 @@
#include "Private/XElementContainer.h" #include "Private/XElementContainer.h"
#include "XNode.h" #include "XNode.h"
#include "XText.h" #include "XText.h"
#include <boost/shared_ptr.hpp>
#include "Private/NullXElement.h" #include "Private/NullXElement.h"
#include "Private/NullElement.h" #include "Private/NullElement.h"
#include "XAttribute.h" #include "XAttribute.h"
#include "Exception/not_implement.h" #include "Exception/not_implement.h"
namespace XML namespace XML
{ {
XElement::XElement() XElement::XElement()
: base(new Private::Element()), : base(new Private::Element()),
XName(m_ptr->XName), XName(m_ptr->XName),
...@@ -35,7 +32,6 @@ namespace XML ...@@ -35,7 +32,6 @@ namespace XML
{ {
} }
XElement::XElement(const Private::NullXElement&) XElement::XElement(const Private::NullXElement&)
: base(new Private::NullElement()), : base(new Private::NullElement()),
XName(m_ptr->XName), XName(m_ptr->XName),
...@@ -48,7 +44,6 @@ namespace XML ...@@ -48,7 +44,6 @@ namespace XML
{ {
} }
XElement::XElement(const XML::XName& xname) XElement::XElement(const XML::XName& xname)
: base(new Private::Element(xname)), : base(new Private::Element(xname)),
XName(m_ptr->XName), XName(m_ptr->XName),
...@@ -61,7 +56,6 @@ namespace XML ...@@ -61,7 +56,6 @@ namespace XML
{ {
} }
XElement::XElement(const XML::XName& xname, const Private::XList& list) XElement::XElement(const XML::XName& xname, const Private::XList& list)
: base(new Private::Element(xname, list)), : base(new Private::Element(xname, list)),
XName(m_ptr->XName), XName(m_ptr->XName),
...@@ -74,8 +68,7 @@ namespace XML ...@@ -74,8 +68,7 @@ namespace XML
{ {
} }
XElement::XElement(NSCommon::smart_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
XElement::XElement(boost::shared_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
: base(new Private::Element(source, ns, space)), : base(new Private::Element(source, ns, space)),
XName(m_ptr->XName), XName(m_ptr->XName),
Namespaces(m_ptr->Namespaces), Namespaces(m_ptr->Namespaces),
...@@ -87,8 +80,7 @@ namespace XML ...@@ -87,8 +80,7 @@ namespace XML
{ {
} }
XElement::XElement(NSCommon::smart_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
XElement::XElement(boost::shared_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
: base(new Private::Element(source, ns, space)), : base(new Private::Element(source, ns, space)),
XName(m_ptr->XName), XName(m_ptr->XName),
Namespaces(m_ptr->Namespaces), Namespaces(m_ptr->Namespaces),
...@@ -100,7 +92,6 @@ namespace XML ...@@ -100,7 +92,6 @@ namespace XML
{ {
} }
const XElement& XElement::operator =(const XElement& rhs) const XElement& XElement::operator =(const XElement& rhs)
{ {
m_ptr = rhs.m_ptr; m_ptr = rhs.m_ptr;
...@@ -114,17 +105,17 @@ namespace XML ...@@ -114,17 +105,17 @@ namespace XML
return *this; return *this;
} }
XElement::XElement(const XNode& xnode) XElement::XElement(const XNode& xnode)
: base(boost::dynamic_pointer_cast<Private::Element>(xnode.get_ptr())), : base(xnode.get_ptr().smart_dynamic_cast<Private::Element>()),
XName(m_ptr->XName), XName(m_ptr->XName),
Namespaces(m_ptr->Namespaces), Namespaces(m_ptr->Namespaces),
Attributes(m_ptr->Attributes), Attributes(m_ptr->Attributes),
Nodes(m_ptr->Nodes), Nodes(m_ptr->Nodes),
Elements(m_ptr->Elements), Elements(m_ptr->Elements),
Texts(m_ptr->Texts), Texts(m_ptr->Texts),
Space(m_ptr->Space) Space(m_ptr->Space)
{ {
int c = 0;
} }
void XElement::Save(const OOX::CPath& path) const void XElement::Save(const OOX::CPath& path) const
...@@ -132,109 +123,91 @@ namespace XML ...@@ -132,109 +123,91 @@ namespace XML
XDocument(*this).Save(path); XDocument(*this).Save(path);
} }
void XElement::fromSource(NSCommon::smart_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
void XElement::fromSource(boost::shared_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
{ {
m_ptr->fromSource(source, ns, space); m_ptr->fromSource(source, ns, space);
} }
void XElement::fromSource(NSCommon::smart_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
void XElement::fromSource(boost::shared_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space)
{ {
m_ptr->fromSource(source, ns, space); m_ptr->fromSource(source, ns, space);
} }
const std::string XElement::ToString() const const std::string XElement::ToString() const
{ {
return m_ptr->ToString(); return m_ptr->ToString();
} }
const std::wstring XElement::ToWString() const const std::wstring XElement::ToWString() const
{ {
return m_ptr->ToWString(); return m_ptr->ToWString();
} }
void XElement::SaveToStringList(std::list<std::string>& strList)const void XElement::SaveToStringList(std::list<std::string>& strList)const
{ {
m_ptr->SaveToStringList(strList); m_ptr->SaveToStringList(strList);
} }
void XElement::SaveToWStringList(std::list<std::wstring>& strList)const void XElement::SaveToWStringList(std::list<std::wstring>& strList)const
{ {
m_ptr->SaveToWStringList(strList); m_ptr->SaveToWStringList(strList);
} }
const bool XElement::exist() const const bool XElement::exist() const
{ {
return m_ptr->exist(); return m_ptr->exist();
} }
const Private::XNamespaceContainer XElement::usedNamespace() const const Private::XNamespaceContainer XElement::usedNamespace() const
{ {
return m_ptr->usedNamespace(); return m_ptr->usedNamespace();
} }
const Private::XString XElement::text() const const Private::XString XElement::text() const
{ {
return m_ptr->text(); return m_ptr->text();
} }
void XElement::Add(const XAttribute& attribute) void XElement::Add(const XAttribute& attribute)
{ {
m_ptr->Add(attribute); m_ptr->Add(attribute);
} }
void XElement::Add(const XNamespace& ns) void XElement::Add(const XNamespace& ns)
{ {
m_ptr->Add(ns); m_ptr->Add(ns);
} }
void XElement::Add(const XNode& node) void XElement::Add(const XNode& node)
{ {
m_ptr->Add(node); m_ptr->Add(node);
} }
void XElement::Add(const XElement& element) void XElement::Add(const XElement& element)
{ {
m_ptr->Add(element); m_ptr->Add(element);
} }
void XElement::Add(const XText& text) void XElement::Add(const XText& text)
{ {
m_ptr->Add(text); m_ptr->Add(text);
} }
void XElement::Add(const XContainer& container) void XElement::Add(const XContainer& container)
{ {
m_ptr->Add(container); m_ptr->Add(container);
} }
void XElement::Add(const Private::XList& list) void XElement::Add(const Private::XList& list)
{ {
m_ptr->Add(list); m_ptr->Add(list);
} }
XAttribute& XElement::attribute(const XML::XName& xname) XAttribute& XElement::attribute(const XML::XName& xname)
{ {
return m_ptr->attribute(xname); return m_ptr->attribute(xname);
} }
const XAttribute& XElement::attribute(const XML::XName& xname) const const XAttribute& XElement::attribute(const XML::XName& xname) const
{ {
return m_ptr->attribute(xname); return m_ptr->attribute(xname);
...@@ -246,19 +219,16 @@ namespace XML ...@@ -246,19 +219,16 @@ namespace XML
return m_ptr->element(xname); return m_ptr->element(xname);
} }
const XElement XElement::element(const XML::XName& xname) const const XElement XElement::element(const XML::XName& xname) const
{ {
return m_ptr->element(xname); return m_ptr->element(xname);
} }
XElement XElement::element(const XML::XName& xname, const std::string& value) XElement XElement::element(const XML::XName& xname, const std::string& value)
{ {
return m_ptr->element(xname, value); return m_ptr->element(xname, value);
} }
const XElement XElement::element(const XML::XName& xname, const std::string& value) const const XElement XElement::element(const XML::XName& xname, const std::string& value) const
{ {
return m_ptr->element(xname, value); return m_ptr->element(xname, value);
......
...@@ -3,19 +3,20 @@ ...@@ -3,19 +3,20 @@
#define XML_XELEMENT_INCLUDE_H_ #define XML_XELEMENT_INCLUDE_H_
#include <string> #include <string>
#include <list>
#include "Private/XPointer.h" #include "Private/XPointer.h"
#include "Private/Element.h" #include "Private/Element.h"
#include "property.h" #include "property.h"
#include "setter.h" #include "setter.h"
#include "getter.h" #include "getter.h"
#include <boost/shared_ptr.hpp>
#include "Private/XString.h" #include "Private/XString.h"
#include "Private/XNamespaceContainer.h" #include "Private/XNamespaceContainer.h"
#include "Private/XSpace.h" #include "Private/XSpace.h"
#include "Private/XSingleSource.h" #include "Private/XSingleSource.h"
#include "Private/XWideSource.h" #include "Private/XWideSource.h"
#include <list>
#include "../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
namespace XML namespace XML
{ {
...@@ -44,8 +45,8 @@ namespace XML ...@@ -44,8 +45,8 @@ namespace XML
XElement(const Private::NullXElement&); XElement(const Private::NullXElement&);
explicit XElement(const XName& xname); explicit XElement(const XName& xname);
XElement(const XName& xname, const Private::XList& list); XElement(const XName& xname, const Private::XList& list);
XElement(boost::shared_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); XElement(NSCommon::smart_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space);
XElement(boost::shared_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); XElement(NSCommon::smart_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space);
const XElement& operator= (const XElement& rhs); const XElement& operator= (const XElement& rhs);
XElement(const XNode& xnode); XElement(const XNode& xnode);
...@@ -80,8 +81,8 @@ namespace XML ...@@ -80,8 +81,8 @@ namespace XML
void Save(const OOX::CPath& path) const; void Save(const OOX::CPath& path) const;
public: public:
void fromSource(boost::shared_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); void fromSource(NSCommon::smart_ptr<Private::XSingleSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space);
void fromSource(boost::shared_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); void fromSource(NSCommon::smart_ptr<Private::XWideSource> source, const Private::XNamespaceContainer& ns, const Private::XSpace& space);
const std::string ToString() const; const std::string ToString() const;
const std::wstring ToWString() const; const std::wstring ToWString() const;
virtual void SaveToStringList(std::list<std::string>& strList)const; virtual void SaveToStringList(std::list<std::string>& strList)const;
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <string> #include <string>
#include <boost/shared_ptr.hpp>
#include "property.h" #include "property.h"
#include "nullable_property.h" #include "nullable_property.h"
#include "XNamespace.h" #include "XNamespace.h"
......
...@@ -5,17 +5,13 @@ ...@@ -5,17 +5,13 @@
#include "XText.h" #include "XText.h"
#include "XNode.h" #include "XNode.h"
#include <boost/shared_ptr.hpp>
namespace XML namespace XML
{ {
XText::XText(const XNode& xnode) XText::XText(const XNode& xnode)
: base(boost::dynamic_pointer_cast<Private::Text>(xnode.get_ptr())), : base(xnode.get_ptr().smart_dynamic_cast<Private::Text>()),
Value(m_ptr->Value) Value(m_ptr->Value)
{ {
} }
} // namespace XML } // namespace XML
\ No newline at end of file
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
#include <sstream> #include <sstream>
#include <iterator> #include <iterator>
#include <boost/shared_ptr.hpp>
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/call_traits.hpp> #include <boost/call_traits.hpp>
#include "../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
#include "setter.h" #include "setter.h"
#include "getter.h" #include "getter.h"
#include "nullable.h" #include "nullable.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment