#if !defined(__xmltooling_namespace_h__)\r
#define __xmltooling_namespace_h__\r
\r
-#include <string>\r
-#include <xmltooling/Namespace.h>\r
+#include <xmltooling/unicode.h>\r
\r
namespace xmltooling {\r
\r
{\r
public:\r
/**\r
- * Default constructor\r
+ * Constructor\r
+ * @param uri namespace URI\r
+ * @param prefix namespace prefix (without the colon)\r
+ * @param alwaysDeclare true iff the namespace should always be declared regardless of in-scope declarations\r
*/\r
- Namespace();\r
- \r
- /**\r
- * Constructor that takes an existing declaration\r
- * @param uri namespace URI\r
- * @param prefix namespace prefix (without the colon)\r
- */\r
- Namespace(const XMLCh* uri, const XMLCh* prefix);\r
+ Namespace(const XMLCh* uri=NULL, const XMLCh* prefix=NULL, bool alwaysDeclare=false);\r
\r
~Namespace();\r
#ifndef HAVE_GOOD_STL\r
/**\r
* Deep copy constructor\r
*/\r
- Namespace(const Namespace&);\r
+ Namespace(const Namespace& src);\r
\r
/**\r
* Deep assignment operator\r
*/\r
- Namespace& operator=(const Namespace&);\r
+ Namespace& operator=(const Namespace& src);\r
#endif\r
\r
#ifdef HAVE_GOOD_STL\r
#endif\r
\r
/**\r
+ * Returns true iff the namespace should always be declared regardless of in-scope declarations\r
+ * @return the alwaysDeclared setting\r
+ */\r
+ const bool alwaysDeclare() const { return m_pinned; } \r
+\r
+ /**\r
* Sets the namespace prefix\r
* @param prefix Null-terminated Unicode string containing the prefix, without the colon\r
*/\r
* @param uri Null-terminated Unicode string containing the URI\r
*/\r
void setNamespaceURI(const XMLCh* uri);\r
+\r
+ /**\r
+ * Sets the alwaysDeclared property\r
+ * @param alwaysDeclare true iff the namespace should always be declared regardless of in-scope declarations\r
+ */\r
+ void setAlwaysDeclare(bool alwaysDeclare) { m_pinned = alwaysDeclare; } \r
\r
private:\r
+ bool m_pinned;\r
#ifdef HAVE_GOOD_STL\r
xstring m_uri;\r
xstring m_prefix;\r