X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2FNamespace.h;h=0e97bbea467c74b0285a50db621ebc801b92b474;hb=6648b103b2a2513c4df5cfa8027047da92cda506;hp=8ac6382f5d4e8b483c8e0637405bc8ef1f78e939;hpb=ce200eaef5c771e132b64437d78540bfd4683572;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/Namespace.h b/xmltooling/Namespace.h index 8ac6382..0e97bbe 100644 --- a/xmltooling/Namespace.h +++ b/xmltooling/Namespace.h @@ -1,23 +1,27 @@ -/* - * Copyright 2001-2010 Internet2 - * - * Licensed 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 +/** + * Licensed to the University Corporation for Advanced Internet + * Development, Inc. (UCAID) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + * + * UCAID 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 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. */ /** * @file xmltooling/Namespace.h * - * Representing XML namespace attributes + * Representing XML namespace attributes. */ #if !defined(__xmltooling_namespace_h__) @@ -33,19 +37,28 @@ namespace xmltooling { #endif /** - * A data structure for encapsulating XML Namespace attributes + * A data structure for encapsulating XML Namespace attributes. */ class XMLTOOL_API Namespace { public: /** + * Tri-state indicator of namespace usage. + */ + enum namespace_usage_t { + Indeterminate, + NonVisiblyUsed, + VisiblyUsed + }; + + /** * Constructor * @param uri namespace URI * @param prefix namespace prefix (without the colon) * @param alwaysDeclare true iff the namespace should always be declared regardless of in-scope declarations - * @param visiblyUsed true iff the namespace is visibly used by an XMLObject its attached to + * @param usage indicates usage of namespace in the context of an XMLObject */ - Namespace(const XMLCh* uri=NULL, const XMLCh* prefix=NULL, bool alwaysDeclare=false, bool visiblyUsed=true); + Namespace(const XMLCh* uri=nullptr, const XMLCh* prefix=nullptr, bool alwaysDeclare=false, namespace_usage_t usage=Indeterminate); ~Namespace(); @@ -68,10 +81,10 @@ namespace xmltooling { const bool alwaysDeclare() const { return m_pinned; } /** - * Returns true iff the namespace is visibly used by an XMLObject its attached to - * @return the visiblyUsed setting + * Returns the usage of the namespace by an XMLObject + * @return the usage setting */ - const bool visiblyUsed() const { return m_visiblyUsed; } + const namespace_usage_t usage() const { return m_usage; } /** * Sets the namespace prefix @@ -92,13 +105,14 @@ namespace xmltooling { void setAlwaysDeclare(bool alwaysDeclare) { m_pinned = alwaysDeclare; } /** - * Sets the visiblyUsed property - * @param visiblyUsed true iff the namespace is visibly used by an XMLObject its attached to + * Sets the usage property + * @param usage usage of the namespace by an XMLObject */ - void setVisiblyUsed(bool visiblyUsed) { m_visiblyUsed = visiblyUsed; } + void setUsage(namespace_usage_t usage) { m_usage = usage; } private: - bool m_pinned,m_visiblyUsed; + bool m_pinned; + namespace_usage_t m_usage; xstring m_uri; xstring m_prefix; };