2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 21:00:32 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2009-08-07 10:25:27 +02:00
|
|
|
|
2009-09-08 14:59:07 +02:00
|
|
|
#ifndef INCLUDED_CONFIGMGR_SOURCE_XCDPARSER_HXX
|
|
|
|
#define INCLUDED_CONFIGMGR_SOURCE_XCDPARSER_HXX
|
2009-08-07 10:25:27 +02:00
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <sal/config.h>
|
2009-08-07 10:25:27 +02:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <rtl/ref.hxx>
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <xmlreader/xmlreader.hxx>
|
2009-08-07 10:25:27 +02:00
|
|
|
|
2009-09-08 14:59:07 +02:00
|
|
|
#include "parser.hxx"
|
2010-09-10 13:09:38 +02:00
|
|
|
|
|
|
|
namespace xmlreader { struct Span; }
|
2009-08-23 23:18:01 +02:00
|
|
|
|
2009-08-07 10:25:27 +02:00
|
|
|
namespace configmgr {
|
|
|
|
|
|
|
|
struct Data;
|
|
|
|
|
2009-08-18 10:00:07 +02:00
|
|
|
class XcdParser: public Parser {
|
|
|
|
public:
|
2012-11-29 11:23:09 +01:00
|
|
|
XcdParser(
|
|
|
|
int layer, std::set< OUString > const & processedDependencies,
|
|
|
|
Data & data);
|
2009-08-18 10:00:07 +02:00
|
|
|
|
|
|
|
private:
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~XcdParser() override;
|
2009-08-18 10:00:07 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual xmlreader::XmlReader::Text getTextMode() override;
|
2009-08-31 16:22:09 +02:00
|
|
|
|
2009-08-18 10:00:07 +02:00
|
|
|
virtual bool startElement(
|
2012-11-29 11:23:09 +01:00
|
|
|
xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name,
|
2015-10-12 16:04:04 +02:00
|
|
|
std::set< OUString > const * existingDependencies) override;
|
2009-08-18 10:00:07 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void endElement(xmlreader::XmlReader const & reader) override;
|
2009-08-18 10:00:07 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void characters(xmlreader::Span const & text) override;
|
2009-08-18 10:00:07 +02:00
|
|
|
|
|
|
|
enum State {
|
|
|
|
STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };
|
|
|
|
|
|
|
|
int layer_;
|
2012-11-29 11:23:09 +01:00
|
|
|
std::set< OUString > const & processedDependencies_;
|
2010-03-26 11:06:19 +01:00
|
|
|
Data & data_;
|
2009-08-18 10:00:07 +02:00
|
|
|
State state_;
|
2012-12-10 23:06:10 +02:00
|
|
|
OUString dependencyFile_;
|
2012-11-29 11:23:09 +01:00
|
|
|
bool dependencyOptional_;
|
2009-08-18 10:00:07 +02:00
|
|
|
rtl::Reference< Parser > nestedParser_;
|
|
|
|
long nesting_;
|
2009-08-07 10:25:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|