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 <entitiesmap.hxx>
25 #include <notationsmap.hxx>
31 CDocumentType::CDocumentType(
32 CDocument
const& rDocument
, ::osl::Mutex
const& rMutex
,
34 : CDocumentType_Base(rDocument
, rMutex
,
35 NodeType_DOCUMENT_TYPE_NODE
, reinterpret_cast<xmlNodePtr
>(pDtd
))
41 A NamedNodeMap containing the general entities, both external and
42 internal, declared in the DTD.
44 Reference
< XNamedNodeMap
> SAL_CALL
CDocumentType::getEntities() throw (RuntimeException
)
46 ::osl::MutexGuard
const g(m_rMutex
);
48 Reference
< XNamedNodeMap
> aMap
;
49 if (m_aDtdPtr
!= NULL
)
51 aMap
.set(new CEntitiesMap(this));
57 The internal subset as a string, or null if there is none.
59 OUString SAL_CALL
CDocumentType::getInternalSubset() throw (RuntimeException
)
62 "CDocumentType::getInternalSubset: not implemented (#i113683#)");
67 The name of DTD; i.e., the name immediately following the DOCTYPE
70 OUString SAL_CALL
CDocumentType::getName() throw (RuntimeException
)
72 ::osl::MutexGuard
const g(m_rMutex
);
75 if (m_aDtdPtr
!= NULL
)
77 aName
= OUString((sal_Char
*)m_aDtdPtr
->name
, strlen((char*)m_aDtdPtr
->name
), RTL_TEXTENCODING_UTF8
);
83 A NamedNodeMap containing the notations declared in the DTD.
85 Reference
< XNamedNodeMap
> SAL_CALL
CDocumentType::getNotations() throw (RuntimeException
)
87 ::osl::MutexGuard
const g(m_rMutex
);
89 Reference
< XNamedNodeMap
> aMap
;
90 if (m_aDtdPtr
!= NULL
)
92 aMap
.set(new CNotationsMap(this));
98 The public identifier of the external subset.
100 OUString SAL_CALL
CDocumentType::getPublicId() throw (RuntimeException
)
102 ::osl::MutexGuard
const g(m_rMutex
);
105 if (m_aDtdPtr
!= NULL
)
107 aId
= OUString((sal_Char
*)m_aDtdPtr
->name
, strlen((char*)m_aDtdPtr
->ExternalID
), RTL_TEXTENCODING_UTF8
);
113 The system identifier of the external subset.
115 OUString SAL_CALL
CDocumentType::getSystemId() throw (RuntimeException
)
117 ::osl::MutexGuard
const g(m_rMutex
);
120 if (m_aDtdPtr
!= NULL
)
122 aId
= OUString((sal_Char
*)m_aDtdPtr
->name
, strlen((char*)m_aDtdPtr
->SystemID
), RTL_TEXTENCODING_UTF8
);
127 OUString SAL_CALL
CDocumentType::getNodeName()throw (RuntimeException
)
132 OUString SAL_CALL
CDocumentType::getNodeValue() throw (RuntimeException
)
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */