1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include "documenttype.hxx"
24 #include <osl/diagnose.h>
26 #include "entitiesmap.hxx"
27 #include "notationsmap.hxx"
29 using namespace css::uno
;
30 using namespace css::xml::dom
;
35 CDocumentType::CDocumentType(
36 CDocument
const& rDocument
, ::osl::Mutex
const& rMutex
,
38 : CDocumentType_Base(rDocument
, rMutex
,
39 NodeType_DOCUMENT_TYPE_NODE
, reinterpret_cast<xmlNodePtr
>(pDtd
))
45 A NamedNodeMap containing the general entities, both external and
46 internal, declared in the DTD.
48 css::uno::Reference
< XNamedNodeMap
> SAL_CALL
CDocumentType::getEntities()
50 ::osl::MutexGuard
const g(m_rMutex
);
52 css::uno::Reference
< XNamedNodeMap
> aMap
;
53 if (m_aDtdPtr
!= nullptr)
55 aMap
.set(new CEntitiesMap
);
61 The internal subset as a string, or null if there is none.
63 OUString SAL_CALL
CDocumentType::getInternalSubset()
66 "CDocumentType::getInternalSubset: not implemented (#i113683#)");
71 The name of DTD; i.e., the name immediately following the DOCTYPE
74 OUString SAL_CALL
CDocumentType::getName()
76 ::osl::MutexGuard
const g(m_rMutex
);
79 if (m_aDtdPtr
!= nullptr)
81 aName
= OUString(reinterpret_cast<char const *>(m_aDtdPtr
->name
), strlen(reinterpret_cast<char const *>(m_aDtdPtr
->name
)), RTL_TEXTENCODING_UTF8
);
87 A NamedNodeMap containing the notations declared in the DTD.
89 css::uno::Reference
< XNamedNodeMap
> SAL_CALL
CDocumentType::getNotations()
91 ::osl::MutexGuard
const g(m_rMutex
);
93 css::uno::Reference
< XNamedNodeMap
> aMap
;
94 if (m_aDtdPtr
!= nullptr)
96 aMap
.set(new CNotationsMap
);
102 The public identifier of the external subset.
104 OUString SAL_CALL
CDocumentType::getPublicId()
106 ::osl::MutexGuard
const g(m_rMutex
);
109 if (m_aDtdPtr
!= nullptr)
111 aId
= OUString(reinterpret_cast<char const *>(m_aDtdPtr
->name
), strlen(reinterpret_cast<char const *>(m_aDtdPtr
->ExternalID
)), RTL_TEXTENCODING_UTF8
);
117 The system identifier of the external subset.
119 OUString SAL_CALL
CDocumentType::getSystemId()
121 ::osl::MutexGuard
const g(m_rMutex
);
124 if (m_aDtdPtr
!= nullptr)
126 aId
= OUString(reinterpret_cast<char const *>(m_aDtdPtr
->name
), strlen(reinterpret_cast<char const *>(m_aDtdPtr
->SystemID
)), RTL_TEXTENCODING_UTF8
);
131 OUString SAL_CALL
CDocumentType::getNodeName()
136 OUString SAL_CALL
CDocumentType::getNodeValue()
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */