Avoid potential negative array index access to cached text.
[LibreOffice.git] / shell / inc / basereader.hxx
blob1f09f9bc203925b338d32ddb2780ab60b32a2d1d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SHELL_INC_INTERNAL_BASEREADER_HXX
21 #define INCLUDED_SHELL_INC_INTERNAL_BASEREADER_HXX
23 #include "global.hxx"
24 #include "types.hxx"
25 #include "config.hxx"
26 #include "utilities.hxx"
27 #include "i_xml_parser_event_handler.hxx"
29 #include "xml_parser.hxx"
30 #include "zipfile.hxx"
31 #include "filepath.hxx"
33 class CBaseReader : public i_xml_parser_event_handler
35 public:
36 virtual ~CBaseReader() override;
38 protected: // protected because its only an implementation relevant class
39 CBaseReader( const Filepath_t& DocumentName );
41 CBaseReader( StreamInterface *stream );
43 virtual void start_document();
45 virtual void end_document();
47 virtual void start_element(
48 const string_t& raw_name,
49 const string_t& local_name,
50 const xml_tag_attribute_container_t& attributes) override = 0;
52 virtual void end_element(
53 const string_t& raw_name, const string_t& local_name) override = 0;
55 virtual void characters(const string_t& character) override = 0;
57 virtual void ignore_whitespace(const string_t& /*whitespaces*/) override {};
59 virtual void processing_instruction(
60 const std::wstring& /*target*/, const std::wstring& /*data*/){};
62 virtual void comment(const string_t& /*comment*/) override {};
64 void Initialize( const std::string& /*ContentName*/);
66 private:
67 ZipFile m_ZipFile;
68 ZipFile::ZipContentBuffer_t m_ZipContent;
71 #endif
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */