LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
SBowDocumentWriter.cpp
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#include "SBowDocumentWriter.h"
15
16namespace Lima
17{
18
19namespace LinguisticProcessing
20{
21
26
27void SBowDocumentWriter::setOut( std::ostream* out )
28{
29 m_out = out;
32}
33
36
43
47
51
54{
56 LDEBUG << "SBowDocumentWriter::endDocument()";
57 m_out->flush();
58}
59
61void SBowDocumentWriter::handle(const char* buf,int length)
62{
64 LDEBUG << "SBowDocumentWriter::handle()";
65 m_out->write(buf,length);
66}
67
68void SBowDocumentWriter::startNode( const std::string& elementName, bool forIndexing )
69{
71 LDEBUG << "SBowDocumentWriter::startNode(" << elementName << "," << forIndexing << ")";
72 if( forIndexing )
74 else
76 Lima::Common::Misc::writeStringField(*m_out, elementName);
77}
78
89
90}
91
92}
#define LDEBUG
Definition LimaCommon.h:157
#define LPCLIENTSBOWHANDLERLOGINIT
void writeHeader(std::ostream &file, BoWFileType type) const
void endAnalysis() override
notify the end of an analysis content
virtual void setOut(std::ostream *out) override
set the output stream.
void handle(const char *buf, int length) override
gives content.
void startAnalysis() override
notify the start of an analysis content
void endNode(const Common::Misc::GenericDocumentProperties &props) override
notify the end of a hierarchyNode
void endDocument() override
notify the end of the document
void startNode(const std::string &elementName, bool forIndexing) override
notify the start of a new hierarchyNode
void startDocument(const Common::Misc::GenericDocumentProperties &props) override
notify the start of a new document
void writeOneByteInt(std::ostream &file, const uint8_t number)
write a integer coded on one byte format in a file
void writeStringField(ostream &file, const string &s)
NAUTITIA.