X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=411691%2Fid_manager.i.5;fp=411691%2Fid_manager.i.5;h=1cef647e93d0428e64ec85045113f0da51e5c87c;hp=0000000000000000000000000000000000000000;hb=bd3239d2bbe0de3a200b266503e3330b1e391489;hpb=dbff64cb4b7530861c2309c794efdd4e0cf47a23 diff --git a/411691/id_manager.i.5 b/411691/id_manager.i.5 new file mode 100644 index 0000000..1cef647 --- /dev/null +++ b/411691/id_manager.i.5 @@ -0,0 +1,209 @@ + int __exchange_and_add_dispatch(int * __mem); + + template < typename _Tp > class new_allocator { + public: + typedef _Tp & reference; + }; + +namespace std { + template < typename _CharT > struct char_traits; + class exception {}; + class bad_cast: + public +exception {} +; + template < typename _Tp > class allocator:public new_allocator < _Tp > + { + public:template < typename _Tp1 > struct rebind { + typedef allocator < _Tp1 > other; + }; + }; + template < typename _CharT, typename _Traits = + char_traits < _CharT >, typename _Alloc = + allocator < _CharT > >class basic_string; + typedef basic_string < char >string; + template < typename _CharT, typename _Traits, + typename _Alloc > class basic_string { + typedef typename _Alloc::template rebind < + _CharT >::other _CharT_alloc_type; + typedef _Alloc allocator_type; + typedef typename _CharT_alloc_type::reference reference; + private:struct _Rep_base { + int _M_refcount; + }; + struct _Rep:_Rep_base { + _CharT *_M_refdata() throw() { + return 0; + } +void _M_dispose(const _Alloc & __a) { + if (this != &_S_empty_rep()) +{ + if ( __exchange_and_add_dispatch(&this-> _M_refcount)) +{ + _M_destroy(__a); + } + } + } + void _M_destroy(const _Alloc &) throw(); + }; + struct _Alloc_hider:_Alloc { + _Alloc_hider(_CharT * __dat, + const _Alloc & __a):_Alloc(__a), + _M_p(__dat) { + } _CharT *_M_p; + }; + public: + private:mutable _Alloc_hider _M_dataplus; + _Rep *_M_rep() const { + } static _Rep & _S_empty_rep() { + } + public: basic_string(): +_M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { } + ~basic_string() { + _M_rep()->_M_dispose(this->get_allocator()); + } + basic_string & erase() {} + allocator_type get_allocator() const { + }}; + template < typename _Tp, typename _Ref, typename _Ptr > struct _Deque_iterator { + }; + template < typename _Tp, typename _Alloc > class _Deque_base { + public:typedef _Alloc allocator_type; + typedef _Deque_iterator < _Tp, _Tp &, _Tp * >iterator; + _Deque_base():_M_impl() { + _M_initialize_map(0); + } + typedef typename _Alloc::template rebind < + _Tp >::other _Tp_alloc_type; + struct _Deque_impl:public _Tp_alloc_type { + _Tp **_M_map; + long unsigned int _M_map_size; + iterator _M_start; + iterator _M_finish; + _Deque_impl():_Tp_alloc_type(), _M_map(0), + _M_map_size(0), _M_start(), _M_finish() { + }}; + protected:void _M_initialize_map(long unsigned int); + _Deque_impl _M_impl; + }; + template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class deque:protected _Deque_base < _Tp, + _Alloc > + { + }; + namespace numeric { + class bad_numeric_cast: + public std::bad_cast { }; + class negative_overflow: + public bad_numeric_cast { + void operator() (int) { throw negative_overflow(); } + }; + } +} + +namespace boost { + template < class T > class scoped_ptr { + private:T * px; + public:typedef T element_type; + explicit scoped_ptr(T * p = 0):px(p) { + }}; + template < class T > class intrusive_ptr { + private:typedef intrusive_ptr this_type; + public:typedef T element_type; + intrusive_ptr():px(0) { + } + intrusive_ptr(T * p, bool add_ref = true):px(p) { + } + ~intrusive_ptr() { + intrusive_ptr_release(px); + } + T *operator->() const { + return px; + } typedef T *this_type::*unspecified_bool_type; + operator unspecified_bool_type() const { + } private: T * px; + }; + struct section_info; + template < typename T > struct intrusive_base { + intrusive_base():ref_count_(0) { + } ~intrusive_base() { + } + friend void intrusive_ptr_release(T * ptr) { + delete ptr; + } + private: +unsigned ref_count_; + }; + struct id_category { + enum categories { + default_category = + 0, numbered, generated, generated_heading, + generated_section, generated_doc, explicit_id, + explicit_section_id, explicit_anchor_id + }; + categories c; + }; + struct id_placeholder; + struct file_info; + struct doc_info; + struct id_state { + boost::intrusive_ptr < file_info > current_file; + std::deque < id_placeholder > placeholders; + private:id_placeholder * add_id_to_section(std::string const &id, + id_category category, + boost::intrusive_ptr < + section_info > + const §ion); + }; + struct id_manager { + id_manager(); + private:boost::scoped_ptr < id_state > state; + }; + struct file_info:intrusive_base < file_info > { + boost::intrusive_ptr < file_info > parent; + boost::intrusive_ptr < doc_info > document; + bool document_root; + unsigned compatibility_version; + boost::intrusive_ptr < section_info > switched_section; + id_placeholder *original_placeholder; + file_info(boost::intrusive_ptr < file_info > const &parent, + unsigned compatibility_version):parent(parent), + document(parent->document), document_root(false), + compatibility_version(compatibility_version), + switched_section(), original_placeholder() { + }}; + struct doc_info:intrusive_base < doc_info > { + boost::intrusive_ptr < section_info > current_section; + }; + struct section_info:intrusive_base < section_info > { + boost::intrusive_ptr < section_info > parent; + unsigned compatibility_version; + unsigned level; + std::string id_1_1; + id_placeholder *placeholder_1_6; + section_info(boost::intrusive_ptr < section_info > + const &parent, unsigned compatibility_version, + std::string const &id):parent(parent), + compatibility_version(compatibility_version), + level(1) +, id_1_1(), + placeholder_1_6(0) {} +}; + id_manager::id_manager():state() { } + namespace { + std::string normalize_id( +std::string +) { + std::string id; + id.erase(); + } + } + id_placeholder *id_state::add_id_to_section(std::string const &id, + id_category category, + boost::intrusive_ptr < + section_info > + const §ion) { + std::string id_part = id; +normalize_id(id); + boost::intrusive_ptr < section_info > parent; + }; +}