LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
EventHandler.h
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/***************************************************************************
7 * Copyright (C) 2004-2012 by CEA LIST *
8 * *
9 ***************************************************************************/
10#ifndef LIMA_LINGUISTICPROCESSING_EVENTHANDLER_H
11#define LIMA_LINGUISTICPROCESSING_EVENTHANDLER_H
12
13#include "EventAnalysisExport.h"
15#include "Events.h"
18
19#include <ostream>
20
21namespace Lima
22{
23
24namespace LinguisticProcessing
25{
26
27namespace EventAnalysis
28{
29
34{
35 Q_OBJECT
36public:
37 EventHandler(std::ostream* out);
38
40
41 virtual ~EventHandler();
42
44 void startDocument(const Common::Misc::GenericDocumentProperties& props) override;
45
47 void endDocument() override;
48
49 void endAnalysis() override;
50
51 void startAnalysis() override;
52
53 Events& getEvents();
54
55
57 void handle(const char* buf,int length) override ;
58
60 void startNode( const std::string& elementName, bool forIndexing ) override;
61
63 void endNode( const Common::Misc::GenericDocumentProperties& props ) override;
64
66 virtual void setOut( std::ostream* out ) override;
67
68private:
69 std::ostringstream* m_stream;
70 std::ostream* m_out;
72 Events m_events;
73
74};
75
76} // closing namespace EventAnalysis
77
78} // closing namespace LinguisticProcessing
79
80} // closing namespace Lima
81
82#endif //LIMA_LINGUISTICPROCESSING_EVENTHANDLER_H
#define LIMA_EVENTANALISYS_EXPORT
NAUTITIA.