fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / inc / ary / qualiname.hxx
blob862516151f3b4c326a4f33e546277d15c0dce2ae
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
25 // USED SERVICES
26 // BASE CLASSES
27 // COMPONENTS
28 // PARAMETERS
29 #include <cosv/tpl/tpltools.hxx>
32 namespace ary
35 class QualifiedName
37 public:
38 typedef StringVector::const_iterator namespace_iterator;
40 QualifiedName(
41 uintt i_nSize = 0);
43 /// @see AssignText()
44 QualifiedName(
45 const char * i_sText,
46 const char * i_sSeparator );
47 ~QualifiedName();
49 QualifiedName & operator+=(
50 const String & i_sNamespaceName )
51 { if (i_sNamespaceName.length() > 0)
52 aNamespace.push_back(i_sNamespaceName);
53 return *this; }
54 /// @precond i_nIndex < NamespaceDepth().
55 String & operator[](
56 uintt i_nIndex )
57 { csv_assert(i_nIndex < aNamespace.size());
58 return aNamespace[i_nIndex]; }
59 void Init(
60 bool i_bAbsolute )
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
64 true.
66 void AssignText(
67 const char * i_sText,
68 const char * i_sSeparator );
69 void SetLocalName(
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; }
83 private:
84 // DATA
85 StringVector aNamespace;
86 String sLocalName;
87 bool bIsAbsolute; /// true := beginning with "::".
88 bool bIsFunction; /// true := ending with "()"
94 } // namespace ary
95 #endif
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */