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 #ifndef ARY_QUALINAME_HXX
21 #define ARY_QUALINAME_HXX
29 #include <cosv/tpl/tpltools.hxx>
38 typedef StringVector::const_iterator namespace_iterator
;
46 const char * i_sSeparator
);
49 QualifiedName
& operator+=(
50 const String
& i_sNamespaceName
)
51 { if (i_sNamespaceName
.length() > 0)
52 aNamespace
.push_back(i_sNamespaceName
);
54 /// @precond i_nIndex < NamespaceDepth().
57 { csv_assert(i_nIndex
< aNamespace
.size());
58 return aNamespace
[i_nIndex
]; }
61 { Empty(); bIsAbsolute
= i_bAbsolute
; }
62 /** Reads a qualified name from a string.
63 If the last two characters are "()", the inquiry IsFunction() will return
68 const char * i_sSeparator
);
70 const String
& i_sLocalName
)
71 { sLocalName
= i_sLocalName
; }
72 void Empty() { csv::erase_container(aNamespace
); sLocalName
.clear(); bIsAbsolute
= false; }
74 const String
& LocalName() const { return sLocalName
; }
75 namespace_iterator
first_namespace() const { return aNamespace
.begin(); }
76 namespace_iterator
end_namespace() const { return aNamespace
.end(); }
77 uintt
NamespaceDepth() const { return aNamespace
.size(); }
79 bool IsAbsolute() const { return bIsAbsolute
; }
80 bool IsQualified() const { return aNamespace
.size() > 0; }
81 bool IsFunction() const { return bIsFunction
; }
85 StringVector aNamespace
;
87 bool bIsAbsolute
; /// true := beginning with "::".
88 bool bIsFunction
; /// true := ending with "()"
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */