LibreOffice Module shell (master) 1
basereader.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <basereader.hxx>
21
22#include <xml_parser.hxx>
23
24#include <assert.h>
25#include <memory>
26
30m_ZipFile( DocumentName )
31{
32}
33
34
36m_ZipFile( sw )
37{
38}
39
40
42{
43}
44
45
47{
48}
49
50
52{
53}
54
59void CBaseReader::Initialize( const std::string& ContentName)
60{
61 try
62 {
63 if (m_ZipContent.empty())
64 m_ZipFile.GetUncompressedContent( ContentName, m_ZipContent );
65
66 if (!m_ZipContent.empty())
67 {
69 parser.set_document_handler(this); // pass current reader as reader to the sax parser
70 parser.parse(m_ZipContent.data(), m_ZipContent.size(), true/*IsFinal*/);
71 }
72 }
73 catch(std::exception&)
74 {
75 // OSL_ENSURE( false, ex.what() );
76 }
77 catch(...)
78 {
79 // OSL_ENSURE(false, "Unknown error");
80 }
81}
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ZipFile m_ZipFile
Definition: basereader.hxx:67
virtual ~CBaseReader() override
Definition: basereader.cxx:41
void Initialize(const std::string &)
Read interested tag content into respective structure then start parsing process.
Definition: basereader.cxx:59
virtual void end_document()
Definition: basereader.cxx:51
CBaseReader(const Filepath_t &DocumentName)
constructor of CBaseReader.
Definition: basereader.cxx:29
virtual void start_document()
Definition: basereader.cxx:46
ZipFile::ZipContentBuffer_t m_ZipContent
Definition: basereader.hxx:68
std::string Filepath_t
Definition: filepath.hxx:22
parser