LibreOffice Module dbaccess (master) 1
charsets.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include <rtl/ustring.hxx>
24
25namespace dbaui
26{
27
28 // OCharsetDisplay
30 class OCharsetDisplay final : protected OCharsetDisplay_Base
31 {
32 private:
34
35 public:
38
41
43
44 // various find operations
45 const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const;
46 const_iterator findIanaName(std::u16string_view _rIanaName) const;
47 const_iterator findDisplayName(const OUString& _rDisplayName) const;
48
50 const_iterator begin() const;
52 const_iterator end() const;
53
54 private:
55 virtual bool approveEncoding( const rtl_TextEncoding _eEncoding, const rtl_TextEncodingInfo& _rInfo ) const override;
56
58 };
59
60 //- CharsetDisplayDerefHelper
63 {
65
67
68 public:
70
71 OUString const & getIanaName() const { return CharsetDisplayDerefHelper_Base::getIanaName(); }
72 const OUString& getDisplayName() const { return m_sDisplayName; }
73
74 private:
75 CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, OUString _sDisplayName);
76 };
77
78 //- OCharsetDisplay::ExtendedCharsetIterator
80 {
81 friend class OCharsetDisplay;
82
83 friend bool operator==(const ExtendedCharsetIterator& lhs, const ExtendedCharsetIterator& rhs);
84 friend bool operator!=(const ExtendedCharsetIterator& lhs, const ExtendedCharsetIterator& rhs) { return !(lhs == rhs); }
85
88
89 protected:
92
93 public:
95
98
99 protected:
100 ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, base_iterator _aPosition );
101 };
102
103} // namespace dbaui
104
105/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & getDisplayName() const
Definition: charsets.hxx:72
OUString const & getIanaName() const
Definition: charsets.hxx:71
CharsetDisplayDerefHelper(const CharsetDisplayDerefHelper &_rSource)
Definition: charsets.cxx:84
friend bool operator==(const ExtendedCharsetIterator &lhs, const ExtendedCharsetIterator &rhs)
Definition: charsets.cxx:124
ExtendedCharsetIterator(const OCharsetDisplay *_pContainer, base_iterator _aPosition)
Definition: charsets.cxx:98
CharsetDisplayDerefHelper operator*() const
Definition: charsets.cxx:105
const ExtendedCharsetIterator & operator++()
prefix increment
Definition: charsets.cxx:116
container::CharsetIterator base_iterator
Definition: charsets.hxx:87
friend bool operator!=(const ExtendedCharsetIterator &lhs, const ExtendedCharsetIterator &rhs)
Definition: charsets.hxx:84
const_iterator findIanaName(std::u16string_view _rIanaName) const
Definition: charsets.cxx:65
const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const
Definition: charsets.cxx:59
virtual bool approveEncoding(const rtl_TextEncoding _eEncoding, const rtl_TextEncodingInfo &_rInfo) const override
Definition: charsets.cxx:38
OUString m_aSystemDisplayName
Definition: charsets.hxx:33
const_iterator findDisplayName(const OUString &_rDisplayName) const
Definition: charsets.cxx:71
ExtendedCharsetIterator const_iterator
Definition: charsets.hxx:40
const_iterator begin() const
get access to the first element of the charset collection
Definition: charsets.cxx:49
ExtendedCharsetIterator iterator
Definition: charsets.hxx:39
const_iterator end() const
get access to the (last + 1st) element of the charset collection
Definition: charsets.cxx:54
const OUString & getIanaName() const
CharsetIterator const_iterator
CharsetIterator(const OCharsetMap *_pContainer, OCharsetMap::TextEncBag::const_iterator _aPos)
CharsetIterator find(const rtl_TextEncoding _eEncoding) const
::dbtools::OCharsetMap OCharsetDisplay_Base
Definition: charsets.hxx:29
::dbtools::CharsetIteratorDerefHelper CharsetDisplayDerefHelper_Base
Definition: charsets.hxx:61