summaryrefslogtreecommitdiff
path: root/sax/source/fastparser/fastparser.hxx
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2013-10-15 14:43:24 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2013-10-17 21:38:39 +0200
commit7aa35dcb43a8d626873a04196e37391ea8f0a878 (patch)
treed0d42e6ee0cc7f775ed7e1bc67921e4f86e36521 /sax/source/fastparser/fastparser.hxx
parent6f1a110a370967b31f46d0323329dd9b4436ea26 (diff)
fastparser: don't create temporary Events; use references to event list
Change-Id: I1e12fbeeb90d6020d0566d05fc0318082e1da5fc
Diffstat (limited to 'sax/source/fastparser/fastparser.hxx')
-rw-r--r--sax/source/fastparser/fastparser.hxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/sax/source/fastparser/fastparser.hxx b/sax/source/fastparser/fastparser.hxx
index 3f7fb34bec38..f1b625a4d48b 100644
--- a/sax/source/fastparser/fastparser.hxx
+++ b/sax/source/fastparser/fastparser.hxx
@@ -64,20 +64,15 @@ struct NameWithToken
typedef std::vector<Event> EventList;
-enum CallbackType { START_ELEMENT, END_ELEMENT, CHARACTERS, DONE, EXCEPTION };
+enum CallbackType { INVALID, START_ELEMENT, END_ELEMENT, CHARACTERS, DONE, EXCEPTION };
struct Event {
- boost::optional< OUString > msChars;
- boost::optional< sal_Int32 > mnElementToken;
- boost::optional< OUString > maNamespace;
- boost::optional< OUString > maElementName;
- boost::optional< rtl::Reference< FastAttributeList > > mpAttributes;
+ OUString msChars;
+ sal_Int32 mnElementToken;
+ OUString msNamespace;
+ OUString msElementName;
+ rtl::Reference< FastAttributeList > mxAttributes;
CallbackType maType;
- Event(const CallbackType& t);
- Event(const CallbackType& t, const OUString& sChars);
- Event(const CallbackType& t, sal_Int32 nElementToken, const OUString& aNamespace,
- const OUString& aElementName, FastAttributeList *pAttributes);
- ~Event();
};
// --------------------------------------------------------------------
@@ -114,6 +109,8 @@ struct Entity : public ParserData
static const size_t mnEventListSize = 1000;
// unique for each Entity instance:
+ // Number of valid events in mpProducedEvents:
+ size_t mnProducedEventsSize;
EventList *mpProducedEvents;
std::queue< EventList * > maPendingEvents;
std::queue< EventList * > maUsedEvents;
@@ -150,6 +147,7 @@ struct Entity : public ParserData
void characters( const OUString& sChars );
void endElement();
EventList* getEventList();
+ Event& getEvent( CallbackType aType );
};
// --------------------------------------------------------------------
@@ -193,7 +191,7 @@ public:
inline void popEntity() { maEntities.pop(); }
Entity& getEntity() { return maEntities.top(); }
void parse();
- void produce( const Event& );
+ void produce( CallbackType aType );
private:
bool consume(EventList *);