IWORKFormula.h Source File documentation

IWORKFormula.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libetonyek 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
10 #ifndef IWORKFORMULA_H_INCLUDED
11 #define IWORKFORMULA_H_INCLUDED
12
13 #include <memory>
14 #include <string>
15
16 #include <boost/optional.hpp>
17
18 #include "IWORKTypes_fwd.h"
19 #include "libetonyek_utils.h"
20
21 namespace libetonyek
22 {
23
24 class IWORKFormula
25 {
26 struct Impl;
27
28 public:
29 IWORKFormula(const boost::optional<unsigned> &hc);
30
31 bool parse(const std::string &formula);
32
33 const std::string str(const boost::optional<unsigned> &hc) const;
34
35 void write(const boost::optional<unsigned> &hc, librevenge::RVNGPropertyListVector &formula, const IWORKTableNameMapPtr_t &tableNameMap) const;
36
37 private:
38 bool computeOffset(const boost::optional<unsigned> &hc, int &offsetColumn, int &offsetRow) const;
39 std::shared_ptr<Impl> m_impl;
40 boost::optional<unsigned> m_hc;
41 };
42
43 } // namespace libetonyek
44
45 #endif // IWORKFORMULA_H_INCLUDED
46
47 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
m_table
KEY1TableElement::TableData & m_table
Definition: KEY1TableElement.cpp:157
libetonyek::IWORKFormula::parse
bool parse(const std::string &formula)
libetonyek::IWORKToken::double_
@ double_
Definition: IWORKToken.h:655
libetonyek::Coord
Definition: IWORKFormula.cpp:35
libetonyek::PrefixOp::m_op
char m_op
Definition: IWORKFormula.cpp:85
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKToken::none
@ none
Definition: IWORKToken.h:666
libetonyek::IWORKToken::formula
@ formula
Definition: IWORKToken.h:224
libetonyek::PostfixOp::m_op
char m_op
Definition: IWORKFormula.cpp:110
libetonyek::KEY1Token::table
@ table
Definition: KEY1Token.h:198
m_tableNameMap
const IWORKTableNameMapPtr_t & m_tableNameMap
Definition: IWORKOutputElements.cpp:334
libetonyek::Function::Function
Function()
Definition: IWORKFormula.cpp:116
libetonyek::IWORKTableNameMapPtr_t
std::shared_ptr< IWORKTableNameMap_t > IWORKTableNameMapPtr_t
Definition: IWORKTypes_fwd.h:34
libetonyek::Coord::Coord
Coord()
Definition: IWORKFormula.cpp:37
libetonyek::TrueOrFalseFunc::m_name
string m_name
Definition: IWORKFormula.cpp:67
libetonyek::AddressRange
std::pair< Address, Address > AddressRange
Definition: IWORKFormula.cpp:59
libetonyek::PrefixOp::m_expr
Expression m_expr
Definition: IWORKFormula.cpp:86
libetonyek::Expression
variant< double, string, TrueOrFalseFunc, Address, AddressRange, recursive_wrapper< PrefixOp >, recursive_wrapper< InfixOp >, recursive_wrapper< PostfixOp >, recursive_wrapper< Function >, recursive_wrapper< PExpr > > Expression
Definition: IWORKFormula.cpp:74
libetonyek::PExpr::PExpr
PExpr()
Definition: IWORKFormula.cpp:127
m_row
boost::optional< unsigned > m_row
Definition: IWORKFormulaElement.cpp:64
libetonyek::Address::m_table
optional< string > m_table
Definition: IWORKFormula.cpp:56
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
libetonyek::IWORKToken::row
@ row
Definition: IWORKToken.h:383
IWORKTypes_fwd.h
libetonyek::InfixOp::m_op
string m_op
Definition: IWORKFormula.cpp:98
libetonyek::IWORKFormula::write
void write(const boost::optional< unsigned > &hc, librevenge::RVNGPropertyListVector &formula, const IWORKTableNameMapPtr_t &tableNameMap) const
libetonyek::TrueOrFalseFunc::TrueOrFalseFunc
TrueOrFalseFunc()
Definition: IWORKFormula.cpp:63
libetonyek::PrefixOp
Definition: IWORKFormula.cpp:78
libetonyek::Address
Definition: IWORKFormula.cpp:46
libetonyek::InfixOp
Definition: IWORKFormula.cpp:89
libetonyek::Function::m_name
string m_name
Definition: IWORKFormula.cpp:121
libetonyek::IWORKFormula::str
const std::string str(const boost::optional< unsigned > &hc) const
m_column
const unsigned m_column
Definition: IWORKTableRecorder.cpp:148
libetonyek::IWORKFormula::IWORKFormula
IWORKFormula(const boost::optional< unsigned > &hc)
libetonyek::IWORKToken::number
@ number
Definition: IWORKToken.h:331
m_formula
const IWORKFormula m_formula
Definition: IWORKOutputElements.cpp:332
libetonyek::IWORKFormula::computeOffset
bool computeOffset(const boost::optional< unsigned > &hc, int &offsetColumn, int &offsetRow) const
libetonyek::IWORKToken::val
@ val
Definition: IWORKToken.h:623
libetonyek::InfixOp::m_left
Expression m_left
Definition: IWORKFormula.cpp:99
libetonyek::IWORKToken::r
@ r
Definition: IWORKToken.h:373
libetonyek::PExpr
Definition: IWORKFormula.cpp:125
libetonyek::InfixOp::m_right
Expression m_right
Definition: IWORKFormula.cpp:100
libetonyek::IWORKToken::string
@ string
Definition: IWORKToken.h:411
libetonyek_utils.h
libetonyek::IWORKToken::column
@ column
Definition: IWORKToken.h:152
libetonyek::PrefixOp::PrefixOp
PrefixOp()
Definition: IWORKFormula.cpp:80
libetonyek::PExpr::m_expr
Expression m_expr
Definition: IWORKFormula.cpp:131
libetonyek::IWORKToken::_1
@ _1
Definition: IWORKToken.h:641
libetonyek::PostfixOp::PostfixOp
PostfixOp()
Definition: IWORKFormula.cpp:105
libetonyek::Address::Address
Address()
Definition: IWORKFormula.cpp:48
libetonyek::Address::m_row
optional< Coord > m_row
Definition: IWORKFormula.cpp:55
libetonyek::Coord::m_absolute
bool m_absolute
Definition: IWORKFormula.cpp:43
libetonyek::PostfixOp::m_expr
Expression m_expr
Definition: IWORKFormula.cpp:111
libetonyek::Address::m_column
optional< Coord > m_column
Definition: IWORKFormula.cpp:54
libetonyek::IWORKToken::end
@ end
Definition: IWORKToken.h:189
libetonyek::Coord::m_coord
unsigned m_coord
Definition: IWORKFormula.cpp:42
libetonyek::TrueOrFalseFunc
Definition: IWORKFormula.cpp:61
libetonyek::InfixOp::InfixOp
InfixOp()
Definition: IWORKFormula.cpp:91
libetonyek::PostfixOp
Definition: IWORKFormula.cpp:103
libetonyek::IWORKFormula::m_impl
std::shared_ptr< Impl > m_impl
Definition: IWORKFormula.h:39
libetonyek::get
const ValueT & get(const detail::IWAFieldImpl< TagV, ValueT, Reader > &field)
Definition: IWAField.h:190
libetonyek::IWORKFormula::m_hc
boost::optional< unsigned > m_hc
Definition: IWORKFormula.h:40
IWORKFormula.h
libetonyek::Function
Definition: IWORKFormula.cpp:114
libetonyek::Function::m_args
vector< Expression > m_args
Definition: IWORKFormula.cpp:122
libetonyek::IWORKFormula
Definition: IWORKFormula.h:24
m_name
boost::optional< std::string > m_name
Definition: KEY1Parser.cpp:1508
libetonyek::IWORKToken::hc
@ hc
Definition: IWORKToken.h:552