Update ooo320-m1
[ooovba.git] / shell / source / all / ooofilereader / basereader.cxx
blobd8d95c3e8948c13132ecc59a863af132ab191e3e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: basereader.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_shell.hxx"
33 #include "internal/basereader.hxx"
35 #ifndef XML_PARSER_HXX_INCLUDED
36 #include "internal/xml_parser.hxx"
37 #endif
39 #include "assert.h"
40 #include <memory>
42 /** constructor of CBaseReader.
44 CBaseReader::CBaseReader(const std::string& DocumentName):
45 m_ZipFile( DocumentName )
49 //------------------------------
51 //------------------------------
53 CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa):
54 m_ZipFile( sw , fa )
58 //------------------------------
60 //------------------------------
62 CBaseReader::~CBaseReader()
66 //------------------------------
68 //------------------------------
70 void CBaseReader::start_document()
74 //------------------------------
76 //------------------------------
78 void CBaseReader::end_document()
82 /** Read interested tag content into respective structure then start parsing process.
83 @param ContentName
84 the xml file name in the zipped document which we interest.
86 void CBaseReader::Initialize( const std::string& ContentName)
88 try
90 if (m_ZipContent.empty())
91 m_ZipFile.GetUncompressedContent( ContentName, m_ZipContent );
93 xml_parser parser;
94 parser.set_document_handler(this); // pass current reader as reader to the sax parser
95 parser.parse(&m_ZipContent[0], m_ZipContent.size());
97 catch(std::exception&
98 #if OSL_DEBUG_LEVEL > 0
100 #endif
103 ENSURE( false, ex.what() );
105 catch(...)
107 ENSURE(false, "Unknown error");