LibreOffice Module formula (master) 1
formulahelper.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#ifndef INCLUDED_FORMULA_FORMULAHELPER_HXX
21#define INCLUDED_FORMULA_FORMULAHELPER_HXX
22
23#include <memory>
24#include <vector>
25
27#include <rtl/ustring.hxx>
28#include <sal/types.h>
30
31class CharClass;
32
33namespace formula
34{
35 class IFunctionDescription;
36 class IFunctionManager;
37
39 {
48 public:
49 FormulaHelper(const IFunctionManager* _pFunctionManager);
50
51 const CharClass& GetCharClass() const { return m_rCharClass; }
52
53 sal_Int32 GetCategoryCount() const;
54
55 bool GetNextFunc( const OUString& rFormula,
56 bool bBack,
57 sal_Int32& rFStart, // input and output
58 sal_Int32* pFEnd = nullptr,
59 const IFunctionDescription** ppFDesc = nullptr,
60 ::std::vector< OUString>* pArgs = nullptr ) const;
61
62 sal_Int32 GetFunctionStart( const OUString& rFormula, sal_Int32 nStart,
63 bool bBack, OUString* pFuncName = nullptr ) const;
64
65 sal_Int32 GetFunctionEnd ( std::u16string_view rFormula, sal_Int32 nStart ) const;
66
67 sal_Int32 GetArgStart ( std::u16string_view rFormula, sal_Int32 nStart,
68 sal_uInt16 nArg ) const;
69
70 void GetArgStrings ( ::std::vector< OUString >& _rArgs,
71 std::u16string_view rFormula,
72 sal_Int32 nFuncPos,
73 sal_uInt16 nArgs ) const;
74
75 void FillArgStrings ( std::u16string_view rFormula,
76 sal_Int32 nFuncPos,
77 sal_uInt16 nArgs,
78 ::std::vector< OUString >& _rArgs ) const;
79 };
80
81} // formula
82
83
84#endif // INCLUDED_FORMULA_FORMULAHELPER_HXX
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_Unicode open
const CharClass & m_rCharClass
const sal_Unicode close
const sal_Unicode arrayOpen
const sal_Unicode arrayClose
const CharClass & GetCharClass() const
const IFunctionManager * m_pFunctionManager
const sal_Unicode sep
#define FORMULA_DLLPUBLIC
Definition: formuladllapi.h:28
sal_uInt16 sal_Unicode