1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596 |
- #ifndef RAPIDXML_HPP_INCLUDED
- #define RAPIDXML_HPP_INCLUDED
- #if !defined(RAPIDXML_NO_STDLIB)
- #include <cstdlib>
- #include <cassert>
- #include <new>
- #endif
- #ifdef _MSC_VER
- #pragma warning(push)
- #pragma warning(disable:4127)
- #endif
-
- #if defined(RAPIDXML_NO_EXCEPTIONS)
- #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); }
- namespace rapidxml
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- void parse_error_handler(const char *what, void *where);
- }
- #else
-
- #include <exception>
- #define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where)
- namespace rapidxml
- {
-
-
-
-
-
-
-
-
-
-
-
- class parse_error: public std::exception
- {
-
- public:
-
-
- parse_error(const char *what, void *where)
- : m_what(what)
- , m_where(where)
- {
- }
-
-
- virtual const char *what() const throw()
- {
- return m_what;
- }
-
-
-
- template<class Ch>
- Ch *where() const
- {
- return reinterpret_cast<Ch *>(m_where);
- }
- private:
- const char *m_what;
- void *m_where;
- };
- }
- #endif
- #ifndef RAPIDXML_STATIC_POOL_SIZE
-
-
-
- #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024)
- #endif
- #ifndef RAPIDXML_DYNAMIC_POOL_SIZE
-
-
-
- #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024)
- #endif
- #ifndef RAPIDXML_ALIGNMENT
-
-
-
-
- #define RAPIDXML_ALIGNMENT sizeof(void *)
- #endif
- namespace rapidxml
- {
-
- template<class Ch> class xml_node;
- template<class Ch> class xml_attribute;
- template<class Ch> class xml_document;
-
-
-
- enum node_type
- {
- node_document,
- node_element,
- node_data,
- node_cdata,
- node_comment,
- node_declaration,
- node_doctype,
- node_pi
- };
-
-
-
-
-
-
-
- const int parse_no_data_nodes = 0x1;
-
-
-
-
-
-
-
- const int parse_no_element_values = 0x2;
-
-
-
-
-
-
- const int parse_no_string_terminators = 0x4;
-
-
-
-
-
-
- const int parse_no_entity_translation = 0x8;
-
-
-
-
-
-
- const int parse_no_utf8 = 0x10;
-
-
-
-
-
-
- const int parse_declaration_node = 0x20;
-
-
-
-
-
-
- const int parse_comment_nodes = 0x40;
-
-
-
-
-
-
-
- const int parse_doctype_node = 0x80;
-
-
-
-
-
-
- const int parse_pi_nodes = 0x100;
-
-
-
-
-
-
-
- const int parse_validate_closing_tags = 0x200;
-
-
-
-
-
-
-
- const int parse_trim_whitespace = 0x400;
-
-
-
-
-
-
-
- const int parse_normalize_whitespace = 0x800;
-
-
-
-
-
-
-
-
-
-
- const int parse_default = 0;
-
-
-
-
-
-
-
-
-
- const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation;
-
-
-
-
- const int parse_fastest = parse_non_destructive | parse_no_data_nodes;
-
-
-
-
-
- const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags;
-
-
-
- namespace internal
- {
-
-
- template<int Dummy>
- struct lookup_tables
- {
- static const unsigned char lookup_whitespace[256];
- static const unsigned char lookup_node_name[256];
- static const unsigned char lookup_text[256];
- static const unsigned char lookup_text_pure_no_ws[256];
- static const unsigned char lookup_text_pure_with_ws[256];
- static const unsigned char lookup_attribute_name[256];
- static const unsigned char lookup_attribute_data_1[256];
- static const unsigned char lookup_attribute_data_1_pure[256];
- static const unsigned char lookup_attribute_data_2[256];
- static const unsigned char lookup_attribute_data_2_pure[256];
- static const unsigned char lookup_digits[256];
- static const unsigned char lookup_upcase[256];
- };
-
- template<class Ch>
- inline std::size_t measure(const Ch *p)
- {
- const Ch *tmp = p;
- while (*tmp)
- ++tmp;
- return tmp - p;
- }
-
- template<class Ch>
- inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive)
- {
- if (size1 != size2)
- return false;
- if (case_sensitive)
- {
- for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
- if (*p1 != *p2)
- return false;
- }
- else
- {
- for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
- if (lookup_tables<0>::lookup_upcase[static_cast<unsigned char>(*p1)] != lookup_tables<0>::lookup_upcase[static_cast<unsigned char>(*p2)])
- return false;
- }
- return true;
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<class Ch = char>
- class memory_pool
- {
-
- public:
-
- typedef void *(alloc_func)(std::size_t);
- typedef void (free_func)(void *);
-
-
-
- memory_pool()
- : m_alloc_func(0)
- , m_free_func(0)
- {
- init();
- }
-
-
-
- ~memory_pool()
- {
- clear();
- }
-
-
-
-
-
-
-
-
-
-
- xml_node<Ch> *allocate_node(node_type type,
- const Ch *name = 0, const Ch *value = 0,
- std::size_t name_size = 0, std::size_t value_size = 0)
- {
- void *memory = allocate_aligned(sizeof(xml_node<Ch>));
- xml_node<Ch> *node = new(memory) xml_node<Ch>(type);
- if (name)
- {
- if (name_size > 0)
- node->name(name, name_size);
- else
- node->name(name);
- }
- if (value)
- {
- if (value_size > 0)
- node->value(value, value_size);
- else
- node->value(value);
- }
- return node;
- }
-
-
-
-
-
-
-
-
-
- xml_attribute<Ch> *allocate_attribute(const Ch *name = 0, const Ch *value = 0,
- std::size_t name_size = 0, std::size_t value_size = 0)
- {
- void *memory = allocate_aligned(sizeof(xml_attribute<Ch>));
- xml_attribute<Ch> *attribute = new(memory) xml_attribute<Ch>;
- if (name)
- {
- if (name_size > 0)
- attribute->name(name, name_size);
- else
- attribute->name(name);
- }
- if (value)
- {
- if (value_size > 0)
- attribute->value(value, value_size);
- else
- attribute->value(value);
- }
- return attribute;
- }
-
-
-
-
-
-
-
- Ch *allocate_string(const Ch *source = 0, std::size_t size = 0)
- {
- assert(source || size);
- if (size == 0)
- size = internal::measure(source) + 1;
- Ch *result = static_cast<Ch *>(allocate_aligned(size * sizeof(Ch)));
- if (source)
- for (std::size_t i = 0; i < size; ++i)
- result[i] = source[i];
- return result;
- }
-
-
-
-
-
-
-
-
-
- xml_node<Ch> *clone_node(const xml_node<Ch> *source, xml_node<Ch> *result = 0)
- {
-
- if (result)
- {
- result->remove_all_attributes();
- result->remove_all_nodes();
- result->type(source->type());
- }
- else
- result = allocate_node(source->type());
-
- result->name(source->name(), source->name_size());
- result->value(source->value(), source->value_size());
-
- for (xml_node<Ch> *child = source->first_node(); child; child = child->next_sibling())
- result->append_node(clone_node(child));
- for (xml_attribute<Ch> *attr = source->first_attribute(); attr; attr = attr->next_attribute())
- result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size()));
- return result;
- }
-
-
-
- void clear()
- {
- while (m_begin != m_static_memory)
- {
- char *previous_begin = reinterpret_cast<header *>(align(m_begin))->previous_begin;
- if (m_free_func)
- m_free_func(m_begin);
- else
- delete[] m_begin;
- m_begin = previous_begin;
- }
- init();
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- void set_allocator(alloc_func *af, free_func *ff)
- {
- assert(m_begin == m_static_memory && m_ptr == align(m_begin));
- m_alloc_func = af;
- m_free_func = ff;
- }
- private:
- struct header
- {
- char *previous_begin;
- };
- void init()
- {
- m_begin = m_static_memory;
- m_ptr = align(m_begin);
- m_end = m_static_memory + sizeof(m_static_memory);
- }
-
- char *align(char *ptr)
- {
- std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1));
- return ptr + alignment;
- }
-
- char *allocate_raw(std::size_t size)
- {
-
- void *memory;
- if (m_alloc_func)
- {
- memory = m_alloc_func(size);
- assert(memory);
- }
- else
- {
- memory = new char[size];
- #ifdef RAPIDXML_NO_EXCEPTIONS
- if (!memory)
- RAPIDXML_PARSE_ERROR("out of memory", 0);
- #endif
- }
- return static_cast<char *>(memory);
- }
-
- void *allocate_aligned(std::size_t size)
- {
-
- char *result = align(m_ptr);
-
- if (result + size > m_end)
- {
-
- std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE;
- if (pool_size < size)
- pool_size = size;
-
-
- std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size;
- char *raw_memory = allocate_raw(alloc_size);
-
-
- char *pool = align(raw_memory);
- header *new_header = reinterpret_cast<header *>(pool);
- new_header->previous_begin = m_begin;
- m_begin = raw_memory;
- m_ptr = pool + sizeof(header);
- m_end = raw_memory + alloc_size;
-
- result = align(m_ptr);
- }
-
- m_ptr = result + size;
- return result;
- }
- char *m_begin;
- char *m_ptr;
- char *m_end;
- char m_static_memory[RAPIDXML_STATIC_POOL_SIZE];
- alloc_func *m_alloc_func;
- free_func *m_free_func;
- };
-
-
-
-
-
- template<class Ch = char>
- class xml_base
- {
- public:
-
-
-
-
-
- xml_base()
- : m_name(0)
- , m_value(0)
- , m_parent(0)
- {
- }
-
-
-
-
-
-
-
-
-
- Ch *name() const
- {
- return m_name ? m_name : nullstr();
- }
-
-
-
- std::size_t name_size() const
- {
- return m_name ? m_name_size : 0;
- }
-
-
-
-
-
-
- Ch *value() const
- {
- return m_value ? m_value : nullstr();
- }
-
-
-
- std::size_t value_size() const
- {
- return m_value ? m_value_size : 0;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- void name(const Ch *name, std::size_t size)
- {
- m_name = const_cast<Ch *>(name);
- m_name_size = size;
- }
-
-
-
- void name(const Ch *name)
- {
- this->name(name, internal::measure(name));
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- void value(const Ch *value, std::size_t size)
- {
- m_value = const_cast<Ch *>(value);
- m_value_size = size;
- }
-
-
-
- void value(const Ch *value)
- {
- this->value(value, internal::measure(value));
- }
-
-
-
-
-
- xml_node<Ch> *parent() const
- {
- return m_parent;
- }
- protected:
-
- static Ch *nullstr()
- {
- static Ch zero = Ch('\0');
- return &zero;
- }
- Ch *m_name;
- Ch *m_value;
- std::size_t m_name_size;
- std::size_t m_value_size;
- xml_node<Ch> *m_parent;
- };
-
-
-
-
-
- template<class Ch = char>
- class xml_attribute: public xml_base<Ch>
- {
- friend class xml_node<Ch>;
-
- public:
-
-
-
-
-
- xml_attribute()
- {
- }
-
-
-
-
-
- xml_document<Ch> *document() const
- {
- if (xml_node<Ch> *node = this->parent())
- {
- while (node->parent())
- node = node->parent();
- return node->type() == node_document ? static_cast<xml_document<Ch> *>(node) : 0;
- }
- else
- return 0;
- }
-
-
-
-
-
- xml_attribute<Ch> *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_attribute<Ch> *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute)
- if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
- return attribute;
- return 0;
- }
- else
- return this->m_parent ? m_prev_attribute : 0;
- }
-
-
-
-
-
- xml_attribute<Ch> *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_attribute<Ch> *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
- if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
- return attribute;
- return 0;
- }
- else
- return this->m_parent ? m_next_attribute : 0;
- }
- private:
- xml_attribute<Ch> *m_prev_attribute;
- xml_attribute<Ch> *m_next_attribute;
-
- };
-
-
-
-
-
-
-
-
-
-
- template<class Ch = char>
- class xml_node: public xml_base<Ch>
- {
- public:
-
-
-
-
-
-
- xml_node(node_type type)
- : m_type(type)
- , m_first_node(0)
- , m_first_attribute(0)
- {
- }
-
-
-
-
-
- node_type type() const
- {
- return m_type;
- }
-
-
-
-
-
- xml_document<Ch> *document() const
- {
- xml_node<Ch> *node = const_cast<xml_node<Ch> *>(this);
- while (node->parent())
- node = node->parent();
- return node->type() == node_document ? static_cast<xml_document<Ch> *>(node) : 0;
- }
-
-
-
-
-
- xml_node<Ch> *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_node<Ch> *child = m_first_node; child; child = child->next_sibling())
- if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
- return child;
- return 0;
- }
- else
- return m_first_node;
- }
-
-
-
-
-
-
-
- xml_node<Ch> *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- assert(m_first_node);
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_node<Ch> *child = m_last_node; child; child = child->previous_sibling())
- if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
- return child;
- return 0;
- }
- else
- return m_last_node;
- }
-
-
-
-
-
-
-
- xml_node<Ch> *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- assert(this->m_parent);
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_node<Ch> *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling)
- if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
- return sibling;
- return 0;
- }
- else
- return m_prev_sibling;
- }
-
-
-
-
-
-
-
- xml_node<Ch> *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- assert(this->m_parent);
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
- if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
- return sibling;
- return 0;
- }
- else
- return m_next_sibling;
- }
-
-
-
-
-
- xml_attribute<Ch> *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
- if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
- return attribute;
- return 0;
- }
- else
- return m_first_attribute;
- }
-
-
-
-
-
- xml_attribute<Ch> *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
- {
- if (name)
- {
- if (name_size == 0)
- name_size = internal::measure(name);
- for (xml_attribute<Ch> *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute)
- if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
- return attribute;
- return 0;
- }
- else
- return m_first_attribute ? m_last_attribute : 0;
- }
-
-
-
-
-
- void type(node_type type)
- {
- m_type = type;
- }
-
-
-
-
-
- void prepend_node(xml_node<Ch> *child)
- {
- assert(child && !child->parent() && child->type() != node_document);
- if (first_node())
- {
- child->m_next_sibling = m_first_node;
- m_first_node->m_prev_sibling = child;
- }
- else
- {
- child->m_next_sibling = 0;
- m_last_node = child;
- }
- m_first_node = child;
- child->m_parent = this;
- child->m_prev_sibling = 0;
- }
-
-
-
- void append_node(xml_node<Ch> *child)
- {
- assert(child && !child->parent() && child->type() != node_document);
- if (first_node())
- {
- child->m_prev_sibling = m_last_node;
- m_last_node->m_next_sibling = child;
- }
- else
- {
- child->m_prev_sibling = 0;
- m_first_node = child;
- }
- m_last_node = child;
- child->m_parent = this;
- child->m_next_sibling = 0;
- }
-
-
-
-
- void insert_node(xml_node<Ch> *where, xml_node<Ch> *child)
- {
- assert(!where || where->parent() == this);
- assert(child && !child->parent() && child->type() != node_document);
- if (where == m_first_node)
- prepend_node(child);
- else if (where == 0)
- append_node(child);
- else
- {
- child->m_prev_sibling = where->m_prev_sibling;
- child->m_next_sibling = where;
- where->m_prev_sibling->m_next_sibling = child;
- where->m_prev_sibling = child;
- child->m_parent = this;
- }
- }
-
-
-
- void remove_first_node()
- {
- assert(first_node());
- xml_node<Ch> *child = m_first_node;
- m_first_node = child->m_next_sibling;
- if (child->m_next_sibling)
- child->m_next_sibling->m_prev_sibling = 0;
- else
- m_last_node = 0;
- child->m_parent = 0;
- }
-
-
-
- void remove_last_node()
- {
- assert(first_node());
- xml_node<Ch> *child = m_last_node;
- if (child->m_prev_sibling)
- {
- m_last_node = child->m_prev_sibling;
- child->m_prev_sibling->m_next_sibling = 0;
- }
- else
- m_first_node = 0;
- child->m_parent = 0;
- }
-
-
- void remove_node(xml_node<Ch> *where)
- {
- assert(where && where->parent() == this);
- assert(first_node());
- if (where == m_first_node)
- remove_first_node();
- else if (where == m_last_node)
- remove_last_node();
- else
- {
- where->m_prev_sibling->m_next_sibling = where->m_next_sibling;
- where->m_next_sibling->m_prev_sibling = where->m_prev_sibling;
- where->m_parent = 0;
- }
- }
-
- void remove_all_nodes()
- {
- for (xml_node<Ch> *node = first_node(); node; node = node->m_next_sibling)
- node->m_parent = 0;
- m_first_node = 0;
- }
-
-
- void prepend_attribute(xml_attribute<Ch> *attribute)
- {
- assert(attribute && !attribute->parent());
- if (first_attribute())
- {
- attribute->m_next_attribute = m_first_attribute;
- m_first_attribute->m_prev_attribute = attribute;
- }
- else
- {
- attribute->m_next_attribute = 0;
- m_last_attribute = attribute;
- }
- m_first_attribute = attribute;
- attribute->m_parent = this;
- attribute->m_prev_attribute = 0;
- }
-
-
- void append_attribute(xml_attribute<Ch> *attribute)
- {
- assert(attribute && !attribute->parent());
- if (first_attribute())
- {
- attribute->m_prev_attribute = m_last_attribute;
- m_last_attribute->m_next_attribute = attribute;
- }
- else
- {
- attribute->m_prev_attribute = 0;
- m_first_attribute = attribute;
- }
- m_last_attribute = attribute;
- attribute->m_parent = this;
- attribute->m_next_attribute = 0;
- }
-
-
-
-
- void insert_attribute(xml_attribute<Ch> *where, xml_attribute<Ch> *attribute)
- {
- assert(!where || where->parent() == this);
- assert(attribute && !attribute->parent());
- if (where == m_first_attribute)
- prepend_attribute(attribute);
- else if (where == 0)
- append_attribute(attribute);
- else
- {
- attribute->m_prev_attribute = where->m_prev_attribute;
- attribute->m_next_attribute = where;
- where->m_prev_attribute->m_next_attribute = attribute;
- where->m_prev_attribute = attribute;
- attribute->m_parent = this;
- }
- }
-
-
-
- void remove_first_attribute()
- {
- assert(first_attribute());
- xml_attribute<Ch> *attribute = m_first_attribute;
- if (attribute->m_next_attribute)
- {
- attribute->m_next_attribute->m_prev_attribute = 0;
- }
- else
- m_last_attribute = 0;
- attribute->m_parent = 0;
- m_first_attribute = attribute->m_next_attribute;
- }
-
-
-
- void remove_last_attribute()
- {
- assert(first_attribute());
- xml_attribute<Ch> *attribute = m_last_attribute;
- if (attribute->m_prev_attribute)
- {
- attribute->m_prev_attribute->m_next_attribute = 0;
- m_last_attribute = attribute->m_prev_attribute;
- }
- else
- m_first_attribute = 0;
- attribute->m_parent = 0;
- }
-
-
- void remove_attribute(xml_attribute<Ch> *where)
- {
- assert(first_attribute() && where->parent() == this);
- if (where == m_first_attribute)
- remove_first_attribute();
- else if (where == m_last_attribute)
- remove_last_attribute();
- else
- {
- where->m_prev_attribute->m_next_attribute = where->m_next_attribute;
- where->m_next_attribute->m_prev_attribute = where->m_prev_attribute;
- where->m_parent = 0;
- }
- }
-
- void remove_all_attributes()
- {
- for (xml_attribute<Ch> *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute)
- attribute->m_parent = 0;
- m_first_attribute = 0;
- }
-
- private:
-
-
-
- xml_node(const xml_node &);
- void operator =(const xml_node &);
-
-
-
-
-
-
-
-
-
-
-
-
- node_type m_type;
- xml_node<Ch> *m_first_node;
- xml_node<Ch> *m_last_node;
- xml_attribute<Ch> *m_first_attribute;
- xml_attribute<Ch> *m_last_attribute;
- xml_node<Ch> *m_prev_sibling;
- xml_node<Ch> *m_next_sibling;
- };
-
-
-
-
-
-
-
-
-
-
- template<class Ch = char>
- class xml_document: public xml_node<Ch>, public memory_pool<Ch>
- {
-
- public:
-
- xml_document()
- : xml_node<Ch>(node_document)
- {
- }
-
-
-
-
-
-
-
-
-
-
-
- template<int Flags>
- void parse(Ch *text)
- {
- assert(text);
-
-
- this->remove_all_nodes();
- this->remove_all_attributes();
-
-
- parse_bom<Flags>(text);
-
-
- while (1)
- {
-
- skip<whitespace_pred, Flags>(text);
- if (*text == 0)
- break;
-
- if (*text == Ch('<'))
- {
- ++text;
- if (xml_node<Ch> *node = parse_node<Flags>(text))
- this->append_node(node);
- }
- else
- RAPIDXML_PARSE_ERROR("expected <", text);
- }
- }
-
-
- void clear()
- {
- this->remove_all_nodes();
- this->remove_all_attributes();
- memory_pool<Ch>::clear();
- }
-
- private:
-
-
-
-
- struct whitespace_pred
- {
- static unsigned char test(Ch ch)
- {
- return internal::lookup_tables<0>::lookup_whitespace[static_cast<unsigned char>(ch)];
- }
- };
-
- struct node_name_pred
- {
- static unsigned char test(Ch ch)
- {
- return internal::lookup_tables<0>::lookup_node_name[static_cast<unsigned char>(ch)];
- }
- };
-
- struct attribute_name_pred
- {
- static unsigned char test(Ch ch)
- {
- return internal::lookup_tables<0>::lookup_attribute_name[static_cast<unsigned char>(ch)];
- }
- };
-
- struct text_pred
- {
- static unsigned char test(Ch ch)
- {
- return internal::lookup_tables<0>::lookup_text[static_cast<unsigned char>(ch)];
- }
- };
-
- struct text_pure_no_ws_pred
- {
- static unsigned char test(Ch ch)
- {
- return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast<unsigned char>(ch)];
- }
- };
-
- struct text_pure_with_ws_pred
- {
- static unsigned char test(Ch ch)
- {
- return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast<unsigned char>(ch)];
- }
- };
-
- template<Ch Quote>
- struct attribute_value_pred
- {
- static unsigned char test(Ch ch)
- {
- if (Quote == Ch('\''))
- return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast<unsigned char>(ch)];
- if (Quote == Ch('\"'))
- return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast<unsigned char>(ch)];
- return 0;
- }
- };
-
- template<Ch Quote>
- struct attribute_value_pure_pred
- {
- static unsigned char test(Ch ch)
- {
- if (Quote == Ch('\''))
- return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast<unsigned char>(ch)];
- if (Quote == Ch('\"'))
- return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast<unsigned char>(ch)];
- return 0;
- }
- };
-
- template<int Flags>
- static void insert_coded_character(Ch *&text, unsigned long code)
- {
- if (Flags & parse_no_utf8)
- {
-
-
- text[0] = static_cast<unsigned char>(code);
- text += 1;
- }
- else
- {
-
- if (code < 0x80)
- {
- text[0] = static_cast<unsigned char>(code);
- text += 1;
- }
- else if (code < 0x800)
- {
- text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
- text[0] = static_cast<unsigned char>(code | 0xC0);
- text += 2;
- }
- else if (code < 0x10000)
- {
- text[2] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
- text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
- text[0] = static_cast<unsigned char>(code | 0xE0);
- text += 3;
- }
- else if (code < 0x110000)
- {
- text[3] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
- text[2] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
- text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
- text[0] = static_cast<unsigned char>(code | 0xF0);
- text += 4;
- }
- else
- {
- RAPIDXML_PARSE_ERROR("invalid numeric character entity", text);
- }
- }
- }
-
- template<class StopPred, int Flags>
- static void skip(Ch *&text)
- {
- Ch *tmp = text;
- while (StopPred::test(*tmp))
- ++tmp;
- text = tmp;
- }
-
-
-
- template<class StopPred, class StopPredPure, int Flags>
- static Ch *skip_and_expand_character_refs(Ch *&text)
- {
-
- if (Flags & parse_no_entity_translation &&
- !(Flags & parse_normalize_whitespace) &&
- !(Flags & parse_trim_whitespace))
- {
- skip<StopPred, Flags>(text);
- return text;
- }
-
-
- skip<StopPredPure, Flags>(text);
-
- Ch *src = text;
- Ch *dest = src;
- while (StopPred::test(*src))
- {
-
- if (!(Flags & parse_no_entity_translation))
- {
-
- if (src[0] == Ch('&'))
- {
- switch (src[1])
- {
-
- case Ch('a'):
- if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';'))
- {
- *dest = Ch('&');
- ++dest;
- src += 5;
- continue;
- }
- if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';'))
- {
- *dest = Ch('\'');
- ++dest;
- src += 6;
- continue;
- }
- break;
-
- case Ch('q'):
- if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';'))
- {
- *dest = Ch('"');
- ++dest;
- src += 6;
- continue;
- }
- break;
-
- case Ch('g'):
- if (src[2] == Ch('t') && src[3] == Ch(';'))
- {
- *dest = Ch('>');
- ++dest;
- src += 4;
- continue;
- }
- break;
-
- case Ch('l'):
- if (src[2] == Ch('t') && src[3] == Ch(';'))
- {
- *dest = Ch('<');
- ++dest;
- src += 4;
- continue;
- }
- break;
-
- case Ch('#'):
- if (src[2] == Ch('x'))
- {
- unsigned long code = 0;
- src += 3;
- while (1)
- {
- unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
- if (digit == 0xFF)
- break;
- code = code * 16 + digit;
- ++src;
- }
- insert_coded_character<Flags>(dest, code);
- }
- else
- {
- unsigned long code = 0;
- src += 2;
- while (1)
- {
- unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
- if (digit == 0xFF)
- break;
- code = code * 10 + digit;
- ++src;
- }
- insert_coded_character<Flags>(dest, code);
- }
- if (*src == Ch(';'))
- ++src;
- else
- RAPIDXML_PARSE_ERROR("expected ;", src);
- continue;
-
- default:
-
- break;
- }
- }
- }
-
-
- if (Flags & parse_normalize_whitespace)
- {
-
- if (whitespace_pred::test(*src))
- {
- *dest = Ch(' '); ++dest;
- ++src;
-
- while (whitespace_pred::test(*src))
- ++src;
- continue;
- }
- }
-
- *dest++ = *src++;
- }
-
- text = src;
- return dest;
- }
-
-
-
-
- template<int Flags>
- void parse_bom(Ch *&text)
- {
-
- if (static_cast<unsigned char>(text[0]) == 0xEF &&
- static_cast<unsigned char>(text[1]) == 0xBB &&
- static_cast<unsigned char>(text[2]) == 0xBF)
- {
- text += 3;
- }
- }
-
- template<int Flags>
- xml_node<Ch> *parse_xml_declaration(Ch *&text)
- {
-
- if (!(Flags & parse_declaration_node))
- {
-
- while (text[0] != Ch('?') || text[1] != Ch('>'))
- {
- if (!text[0])
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
- text += 2;
- return 0;
- }
-
- xml_node<Ch> *declaration = this->allocate_node(node_declaration);
-
- skip<whitespace_pred, Flags>(text);
-
- parse_node_attributes<Flags>(text, declaration);
-
-
- if (text[0] != Ch('?') || text[1] != Ch('>'))
- RAPIDXML_PARSE_ERROR("expected ?>", text);
- text += 2;
-
- return declaration;
- }
-
- template<int Flags>
- xml_node<Ch> *parse_comment(Ch *&text)
- {
-
- if (!(Flags & parse_comment_nodes))
- {
-
- while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
- {
- if (!text[0])
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
- text += 3;
- return 0;
- }
-
- Ch *value = text;
-
- while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
- {
- if (!text[0])
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
-
- xml_node<Ch> *comment = this->allocate_node(node_comment);
- comment->value(value, text - value);
-
-
- if (!(Flags & parse_no_string_terminators))
- *text = Ch('\0');
-
- text += 3;
- return comment;
- }
-
- template<int Flags>
- xml_node<Ch> *parse_doctype(Ch *&text)
- {
-
- Ch *value = text;
-
- while (*text != Ch('>'))
- {
-
- switch (*text)
- {
-
-
-
- case Ch('['):
- {
- ++text;
- int depth = 1;
- while (depth > 0)
- {
- switch (*text)
- {
- case Ch('['): ++depth; break;
- case Ch(']'): --depth; break;
- case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- }
- ++text;
- }
- break;
- }
-
-
- case Ch('\0'):
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
-
-
- default:
- ++text;
- }
- }
-
-
- if (Flags & parse_doctype_node)
- {
-
- xml_node<Ch> *doctype = this->allocate_node(node_doctype);
- doctype->value(value, text - value);
-
-
- if (!(Flags & parse_no_string_terminators))
- *text = Ch('\0');
- text += 1;
- return doctype;
- }
- else
- {
- text += 1;
- return 0;
- }
- }
-
- template<int Flags>
- xml_node<Ch> *parse_pi(Ch *&text)
- {
-
- if (Flags & parse_pi_nodes)
- {
-
- xml_node<Ch> *pi = this->allocate_node(node_pi);
-
- Ch *name = text;
- skip<node_name_pred, Flags>(text);
- if (text == name)
- RAPIDXML_PARSE_ERROR("expected PI target", text);
- pi->name(name, text - name);
-
-
- skip<whitespace_pred, Flags>(text);
-
- Ch *value = text;
-
-
- while (text[0] != Ch('?') || text[1] != Ch('>'))
- {
- if (*text == Ch('\0'))
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
-
- pi->value(value, text - value);
-
-
- if (!(Flags & parse_no_string_terminators))
- {
- pi->name()[pi->name_size()] = Ch('\0');
- pi->value()[pi->value_size()] = Ch('\0');
- }
-
- text += 2;
- return pi;
- }
- else
- {
-
- while (text[0] != Ch('?') || text[1] != Ch('>'))
- {
- if (*text == Ch('\0'))
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
- text += 2;
- return 0;
- }
- }
-
-
-
- template<int Flags>
- Ch parse_and_append_data(xml_node<Ch> *node, Ch *&text, Ch *contents_start)
- {
-
- if (!(Flags & parse_trim_whitespace))
- text = contents_start;
-
-
- Ch *value = text, *end;
- if (Flags & parse_normalize_whitespace)
- end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);
- else
- end = skip_and_expand_character_refs<text_pred, text_pure_no_ws_pred, Flags>(text);
-
- if (Flags & parse_trim_whitespace)
- {
- if (Flags & parse_normalize_whitespace)
- {
-
- if (*(end - 1) == Ch(' '))
- --end;
- }
- else
- {
-
- while (whitespace_pred::test(*(end - 1)))
- --end;
- }
- }
-
-
-
- if (!(Flags & parse_no_data_nodes))
- {
- xml_node<Ch> *data = this->allocate_node(node_data);
- data->value(value, end - value);
- node->append_node(data);
- }
-
- if (!(Flags & parse_no_element_values))
- if (*node->value() == Ch('\0'))
- node->value(value, end - value);
-
- if (!(Flags & parse_no_string_terminators))
- {
- Ch ch = *text;
- *end = Ch('\0');
- return ch;
- }
-
- return *text;
- }
-
- template<int Flags>
- xml_node<Ch> *parse_cdata(Ch *&text)
- {
-
- if (Flags & parse_no_data_nodes)
- {
-
- while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
- {
- if (!text[0])
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
- text += 3;
- return 0;
- }
-
- Ch *value = text;
- while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
- {
- if (!text[0])
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
-
- xml_node<Ch> *cdata = this->allocate_node(node_cdata);
- cdata->value(value, text - value);
-
- if (!(Flags & parse_no_string_terminators))
- *text = Ch('\0');
- text += 3;
- return cdata;
- }
-
-
- template<int Flags>
- xml_node<Ch> *parse_element(Ch *&text)
- {
-
- xml_node<Ch> *element = this->allocate_node(node_element);
-
- Ch *name = text;
- skip<node_name_pred, Flags>(text);
- if (text == name)
- RAPIDXML_PARSE_ERROR("expected element name", text);
- element->name(name, text - name);
-
-
- skip<whitespace_pred, Flags>(text);
-
- parse_node_attributes<Flags>(text, element);
-
- if (*text == Ch('>'))
- {
- ++text;
- parse_node_contents<Flags>(text, element);
- }
- else if (*text == Ch('/'))
- {
- ++text;
- if (*text != Ch('>'))
- RAPIDXML_PARSE_ERROR("expected >", text);
- ++text;
- }
- else
- RAPIDXML_PARSE_ERROR("expected >", text);
-
- if (!(Flags & parse_no_string_terminators))
- element->name()[element->name_size()] = Ch('\0');
-
- return element;
- }
-
- template<int Flags>
- xml_node<Ch> *parse_node(Ch *&text)
- {
-
- switch (text[0])
- {
-
- default:
-
- return parse_element<Flags>(text);
-
- case Ch('?'):
- ++text;
- if ((text[0] == Ch('x') || text[0] == Ch('X')) &&
- (text[1] == Ch('m') || text[1] == Ch('M')) &&
- (text[2] == Ch('l') || text[2] == Ch('L')) &&
- whitespace_pred::test(text[3]))
- {
-
- text += 4;
- return parse_xml_declaration<Flags>(text);
- }
- else
- {
-
- return parse_pi<Flags>(text);
- }
-
-
- case Ch('!'):
-
- switch (text[1])
- {
-
-
- case Ch('-'):
- if (text[2] == Ch('-'))
- {
-
- text += 3;
- return parse_comment<Flags>(text);
- }
- break;
-
- case Ch('['):
- if (text[2] == Ch('C') && text[3] == Ch('D') && text[4] == Ch('A') &&
- text[5] == Ch('T') && text[6] == Ch('A') && text[7] == Ch('['))
- {
-
- text += 8;
- return parse_cdata<Flags>(text);
- }
- break;
-
- case Ch('D'):
- if (text[2] == Ch('O') && text[3] == Ch('C') && text[4] == Ch('T') &&
- text[5] == Ch('Y') && text[6] == Ch('P') && text[7] == Ch('E') &&
- whitespace_pred::test(text[8]))
- {
-
- text += 9;
- return parse_doctype<Flags>(text);
- }
- }
-
- ++text;
- while (*text != Ch('>'))
- {
- if (*text == 0)
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
- ++text;
- }
- ++text;
- return 0;
- }
- }
-
- template<int Flags>
- void parse_node_contents(Ch *&text, xml_node<Ch> *node)
- {
-
- while (1)
- {
-
- Ch *contents_start = text;
- skip<whitespace_pred, Flags>(text);
- Ch next_char = *text;
-
-
-
-
- after_data_node:
-
-
- switch (next_char)
- {
-
-
- case Ch('<'):
- if (text[1] == Ch('/'))
- {
-
- text += 2;
- if (Flags & parse_validate_closing_tags)
- {
-
- Ch *closing_name = text;
- skip<node_name_pred, Flags>(text);
- if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true))
- RAPIDXML_PARSE_ERROR("invalid closing tag name", text);
- }
- else
- {
-
- skip<node_name_pred, Flags>(text);
- }
-
- skip<whitespace_pred, Flags>(text);
- if (*text != Ch('>'))
- RAPIDXML_PARSE_ERROR("expected >", text);
- ++text;
- return;
- }
- else
- {
-
- ++text;
- if (xml_node<Ch> *child = parse_node<Flags>(text))
- node->append_node(child);
- }
- break;
-
- case Ch('\0'):
- RAPIDXML_PARSE_ERROR("unexpected end of data", text);
-
- default:
- next_char = parse_and_append_data<Flags>(node, text, contents_start);
- goto after_data_node;
- }
- }
- }
-
-
- template<int Flags>
- void parse_node_attributes(Ch *&text, xml_node<Ch> *node)
- {
-
- while (attribute_name_pred::test(*text))
- {
-
- Ch *name = text;
- ++text;
- skip<attribute_name_pred, Flags>(text);
- if (text == name)
- RAPIDXML_PARSE_ERROR("expected attribute name", name);
-
- xml_attribute<Ch> *attribute = this->allocate_attribute();
- attribute->name(name, text - name);
- node->append_attribute(attribute);
-
- skip<whitespace_pred, Flags>(text);
-
- if (*text != Ch('='))
- RAPIDXML_PARSE_ERROR("expected =", text);
- ++text;
-
- if (!(Flags & parse_no_string_terminators))
- attribute->name()[attribute->name_size()] = 0;
-
- skip<whitespace_pred, Flags>(text);
-
- Ch quote = *text;
- if (quote != Ch('\'') && quote != Ch('"'))
- RAPIDXML_PARSE_ERROR("expected ' or \"", text);
- ++text;
-
- Ch *value = text, *end;
- const int AttFlags = Flags & ~parse_normalize_whitespace;
- if (quote == Ch('\''))
- end = skip_and_expand_character_refs<attribute_value_pred<Ch('\'')>, attribute_value_pure_pred<Ch('\'')>, AttFlags>(text);
- else
- end = skip_and_expand_character_refs<attribute_value_pred<Ch('"')>, attribute_value_pure_pred<Ch('"')>, AttFlags>(text);
-
-
- attribute->value(value, end - value);
-
-
- if (*text != quote)
- RAPIDXML_PARSE_ERROR("expected ' or \"", text);
- ++text;
-
- if (!(Flags & parse_no_string_terminators))
- attribute->value()[attribute->value_size()] = 0;
-
- skip<whitespace_pred, Flags>(text);
- }
- }
- };
-
- namespace internal
- {
-
- template<int Dummy>
- const unsigned char lookup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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
- };
-
- template<int Dummy>
- const unsigned char lookup_tables<Dummy>::lookup_digits[256] =
- {
-
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255,
- 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
- };
-
-
- template<int Dummy>
- const unsigned char lookup_tables<Dummy>::lookup_upcase[256] =
- {
-
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127,
- 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
- 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
- 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
- 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
- 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
- 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
- 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
- 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
- };
- }
-
- }
- #undef RAPIDXML_PARSE_ERROR
- #ifdef _MSC_VER
- #pragma warning(pop)
- #endif
- #endif
|