2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Implementation of XML namespace functionality
25 #ifndef SEN_NAME_SPACE_H
26 #define SEN_NAME_SPACE_H
35 * Implementation of XML namespace functionality
36 * All data is in UTF-8 form.
40 class CSenNamespace : public CBase
42 public: // Constructors and destructor
46 * @param aPrefix The prefix for the namespace.
47 * @param aUri The namespace uri for the namespace.
49 IMPORT_C static CSenNamespace* NewL(const TDesC8& aPrefix,
53 * @param aPrefix The prefix for the namespace.
54 * @param aUri The namespace uri for the namespace.
56 IMPORT_C static CSenNamespace* NewLC(const TDesC8& aPrefix,
60 * @param aUri The namespace uri for the namespace.
62 IMPORT_C static CSenNamespace* NewL(const TDesC8& aUri);
66 * @param aUri The namespace uri for the namespace.
68 IMPORT_C static CSenNamespace* NewLC(const TDesC8& aUri);
73 IMPORT_C virtual ~CSenNamespace();
75 public: // New functions
78 * Getter for the URI of the namespace object.
81 IMPORT_C const TDesC8& URI() const;
84 * Getter for the prefix of the namespace object.
87 IMPORT_C const TDesC8& Prefix() const;
90 * Setter for the URI of the namespace object.
91 * @param aUri The URI.
93 IMPORT_C void SetUriL(const TDesC8& aUri);
96 * Setter for the prefix of the namespace object.
97 * @param aPrefix The prefix.
99 IMPORT_C void SetPrefixL(const TDesC8& aPrefix);
102 * Method for comparing the namespace object to other prefix
104 * @param aOtherPrefix The prefix to be compared to
105 * @param aOtherUri The URI to be compared to.
106 * @return ETrue if both of the parameters were matching to the
107 * object's corresponding ones. EFalse otherwise
109 IMPORT_C TBool Compare(const TDesC8& aOtherPrefix,
110 const TDesC8& aOtherUri) const;
113 * Method for comparing the namespace object to other namespace
115 * @param aOtherNamespace The namespace to be compared to.
116 * @return ETrue if the given namespace has same URI and prefix as the
117 * current one. EFalse otherwise.
119 IMPORT_C TBool Compare(const CSenNamespace& aOtherNamespace) const;
122 * Method for comparing the namespace object to other namespace
123 * object. Differs from Compare(...) methods so that this one
124 * compares only URIs.
125 * @return ETrue if the given namespace has the same URI as
126 * the current one. EFalse otherwise.
128 IMPORT_C TBool MatchesL(const CSenNamespace& aOtherNamespace) const;
131 * Method to ask this namespace object to write itself into a
132 * writestream. Doesn't write anything if no URI has been set.
133 * @param aWs The writestream where object should be written.
135 IMPORT_C void InsertL(RBufWriteStream& aWs);
140 * C++ default constructor.
145 * By default Symbian 2nd phase constructor is private.
147 void ConstructL(const TDesC8& aPrefix, const TDesC8& aUri);
154 #endif // SEN_NAME_SPACE_H