Kaydet (Commit) 5b57402a authored tarafından Matúš Kukan's avatar Matúš Kukan

sax: avoid pointless linking expwrap against sax

..only to share one class with fastsax in sax, where it's not used.
The link dependency is ugly, mostly for libmerged.
Use static library.
Another option would be to link fastsax against expwrap.

Change-Id: Ia85b01150959e2472d1ac04013b8b9a27232a070
üst 06f61121
......@@ -648,6 +648,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
ssleay32 \
ooopathutils \
sample \
sax_shared \
simplemapi \
shell_xmlparser \
shell_xmlparser_x64 \
......
......@@ -11,6 +11,10 @@ $(eval $(call gb_Library_Library,expwrap))
$(eval $(call gb_Library_set_componentfile,expwrap,sax/source/expatwrap/expwrap))
$(eval $(call gb_Library_set_include,expwrap,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_sdk_api,expwrap))
......@@ -22,20 +26,17 @@ $(eval $(call gb_Library_use_libraries,expwrap,\
cppu \
cppuhelper \
sal \
sax \
$(gb_STDLIBS) \
))
$(eval $(call gb_Library_set_include,expwrap,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
$(eval $(call gb_Library_use_static_libraries,expwrap,\
sax_shared \
))
$(eval $(call gb_Library_add_exception_objects,expwrap,\
sax/source/expatwrap/attrlistimpl \
sax/source/expatwrap/sax_expat \
sax/source/expatwrap/saxwriter \
sax/source/expatwrap/attrlistimpl \
sax/source/expatwrap/sax_expat \
sax/source/expatwrap/saxwriter \
))
# vim: set noet sw=4 ts=4:
......@@ -11,10 +11,15 @@ $(eval $(call gb_Library_Library,fastsax))
$(eval $(call gb_Library_set_componentfile,fastsax,sax/source/fastparser/fastsax))
$(eval $(call gb_Library_set_include,fastsax,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_sdk_api,fastsax))
$(eval $(call gb_Library_use_externals,fastsax,\
expat_utf8 \
expat_utf8 \
zlib \
))
......@@ -22,18 +27,17 @@ $(eval $(call gb_Library_use_libraries,fastsax,\
cppu \
cppuhelper \
sal \
sax \
sax \
$(gb_STDLIBS) \
))
$(eval $(call gb_Library_set_include,fastsax,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
$(eval $(call gb_Library_use_static_libraries,fastsax,\
sax_shared \
))
$(eval $(call gb_Library_add_exception_objects,fastsax,\
sax/source/fastparser/facreg \
sax/source/fastparser/fastparser \
sax/source/fastparser/facreg \
sax/source/fastparser/fastparser \
))
# vim: set noet sw=4 ts=4:
......@@ -13,6 +13,11 @@ $(eval $(call gb_Library_use_package,sax,\
sax_inc \
))
$(eval $(call gb_Library_set_include,sax,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_sdk_api,sax))
$(eval $(call gb_Library_use_libraries,sax,\
......@@ -23,20 +28,14 @@ $(eval $(call gb_Library_use_libraries,sax,\
$(gb_STDLIBS) \
))
$(eval $(call gb_Library_set_include,sax,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
))
$(eval $(call gb_Library_add_defs,sax,\
-DSAX_DLLIMPLEMENTATION \
))
$(eval $(call gb_Library_add_exception_objects,sax,\
sax/source/expatwrap/xml2utf \
sax/source/tools/converter \
sax/source/tools/fastattribs \
sax/source/tools/fastserializer \
sax/source/tools/fastserializer \
sax/source/tools/fshelper \
))
......
......@@ -14,6 +14,7 @@ $(eval $(call gb_Module_add_targets,sax,\
Library_fastsax \
Library_sax \
Package_inc \
StaticLibrary_sax_shared \
))
$(eval $(call gb_Module_add_check_targets,sax,\
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_StaticLibrary_StaticLibrary,sax_shared))
$(eval $(call gb_StaticLibrary_set_include,sax_shared,\
-I$(SRCDIR)/sax/inc \
$$(INCLUDE) \
))
$(eval $(call gb_StaticLibrary_use_sdk_api,sax_shared))
$(eval $(call gb_StaticLibrary_add_exception_objects,sax_shared,\
sax/source/expatwrap/xml2utf \
))
# vim: set noet sw=4 ts=4:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _SAX_ATTRIBUTEMAP_HXX_
#define _SAX_ATTRIBUTEMAP_HXX_
#include <map>
#include "sax/tools/tokenmap.hxx"
namespace sax
{
class SaxTokenMap;
typedef std::map< sal_uInt32, rtl::OString > AttributeMapBase;
/** a map for a set of xml attributes, identified with integer tokens.
Attribute values are stored in utf-8 encoding. */
class SAX_DLLPUBLIC AttributeMap : public AttributeMapBase
{
public:
AttributeMap( const SaxTokenMap& rTokenMap );
~AttributeMap();
/** returns a unicode string, if the token does not exists the string is empty */
::rtl::OUString getString( SaxToken nToken ) const;
/** returns true if the attribute with the token nToken is part of this map */
bool has( SaxToken nToken ) const;
/** converts the attribute with the token nToken to sal_Int32 or returns
nDefault if this attribute does not exists */
sal_Int32 getInt32( SaxToken nToken, sal_Int32 nDefault = 0 ) const;
/** converts the attribute with the token nToken to a token or returns
nDefault if this attribute does not exists */
sal_uInt32 getToken( SaxToken nToken, SaxToken nDefault ) const;
private:
const SaxTokenMap& mrTokenMap;
};
}
#endif // _SAX_ATTRIBUTEMAP_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _SAX_OBJECT_HXX_
#define _SAX_OBJECT_HXX_
#include <sal/types.h>
#include "sax/saxdllapi.h"
namespace sax
{
/** simple base class to allow refcounting with rtl::Reference or css::uno::Reference */
class SAX_DLLPUBLIC SaxObject
{
public:
SaxObject();
virtual ~SaxObject();
virtual void SAL_CALL acquire() throw ();
virtual void SAL_CALL release() throw ();
private:
sal_uInt32 mnRefCount;
};
}
#endif // _SAX_OBJECT_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _SAX_TOKENMAP_HXX_
#define _SAX_TOKENMAP_HXX_
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include "sax/tools/saxobject.hxx"
namespace sax
{
/** type for a token identifier */
typedef sal_uInt32 SaxToken;
/** this class maps a set of ascii/utf-8 strings to token identifier */
class SAX_DLLPUBLIC SaxTokenMap : public SaxObject
{
public:
/** constant do indicate an unknown token */
const static SaxToken InvalidToken = (SaxToken)-1;
/** returns the token identifier for the given ascii string or SaxTokenMap::InvalidToken */
virtual SaxToken GetToken( const sal_Char* pChar, sal_uInt32 nLength = 0 ) const = 0;
/** returns the token identifier for the given unicode string or SaxTokenMap::InvalidToken */
virtual SaxToken GetToken( const ::rtl::OUString& rToken ) const = 0;
/** returns the unicode string for the given token identifier */
virtual const ::rtl::OUString& GetToken( SaxToken nToken ) const = 0;
/** returns if the given unicode string equals the given token identifier */
bool IsToken( const ::rtl::OUString& rToken, SaxToken nToken ) const { return GetToken( rToken ) == nToken; }
};
/** reference type to a SaxTokenMap */
typedef rtl::Reference< SaxTokenMap > SaxTokenMapRef;
}
#endif // _SAX_TOKENMAP_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -17,17 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sax/saxdllapi.h>
#include <sal/types.h>
/*
*
* Text2UnicodeConverter
*
**/
namespace sax_expatwrap {
class SAX_DLLPUBLIC Text2UnicodeConverter
class Text2UnicodeConverter
{
public:
......@@ -53,7 +47,7 @@ private:
* Unicode2TextConverter
*
**-----------------------------------------*/
class SAX_DLLPUBLIC Unicode2TextConverter
class Unicode2TextConverter
{
public:
Unicode2TextConverter( rtl_TextEncoding encoding );
......@@ -84,7 +78,7 @@ private:
* XMLFile2UTFConverter
*
**-----------------------------------------*/
class SAX_DLLPUBLIC XMLFile2UTFConverter
class XMLFile2UTFConverter
{
public:
XMLFile2UTFConverter( ):
......
......@@ -32,7 +32,7 @@ namespace sax_expatwrap
struct AttributeList_impl;
//FIXME
class /*SAX_DLLPUBLIC*/ AttributeList :
class AttributeList :
public ::cppu::WeakImplHelper2<
::com::sun::star::xml::sax::XAttributeList,
::com::sun::star::util::XCloneable >
......
......@@ -21,7 +21,7 @@
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase2.hxx>
#include "../tools/fastserializer.hxx"
#include <fastserializer.hxx>
#include "fastparser.hxx"
using namespace sax_fastparser;
......
......@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "fastserializer.hxx"
#include <fastserializer.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/sequenceasvector.hxx>
......
......@@ -18,7 +18,7 @@
*/
#include <sax/fshelper.hxx>
#include "fastserializer.hxx"
#include <fastserializer.hxx>
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
#include <comphelper/processfactory.hxx>
#include <rtl/ustrbuf.hxx>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment