Index: xfa/src/fxfa/src/fm2js/xfa_expression.h |
diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.h b/xfa/src/fxfa/src/fm2js/xfa_expression.h |
index 2d2da0cb89f2e9d4c0083ddf9239ca8f31d1c7d1..8fe251271bacc8669c6a13dbf341115d4f9bd360 100644 |
--- a/xfa/src/fxfa/src/fm2js/xfa_expression.h |
+++ b/xfa/src/fxfa/src/fm2js/xfa_expression.h |
@@ -7,6 +7,8 @@ |
#ifndef XFA_SRC_FXFA_SRC_FM2JS_XFA_EXPRESSION_H_ |
#define XFA_SRC_FXFA_SRC_FM2JS_XFA_EXPRESSION_H_ |
+#include <memory> |
+ |
#include "xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h" |
enum XFA_FM_EXPTYPE { |
@@ -19,9 +21,10 @@ enum XFA_FM_EXPTYPE { |
XFA_FM_EXPTYPE_BREAK, |
XFA_FM_EXPTYPE_CONTINUE, |
}; |
+ |
class CXFA_FMExpression { |
public: |
- CXFA_FMExpression(FX_DWORD line); |
+ explicit CXFA_FMExpression(FX_DWORD line); |
CXFA_FMExpression(FX_DWORD line, XFA_FM_EXPTYPE type); |
virtual ~CXFA_FMExpression() {} |
virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
@@ -33,6 +36,7 @@ class CXFA_FMExpression { |
XFA_FM_EXPTYPE m_type; |
FX_DWORD m_line; |
}; |
+ |
class CXFA_FMFunctionDefinition : public CXFA_FMExpression { |
public: |
CXFA_FMFunctionDefinition(FX_DWORD line, |
@@ -40,9 +44,9 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression { |
const CFX_WideStringC& wsName, |
CFX_WideStringCArray* pArguments, |
CFX_PtrArray* pExpressions); |
- virtual ~CXFA_FMFunctionDefinition(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ ~CXFA_FMFunctionDefinition() override; |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
CFX_WideStringC m_wsName; |
@@ -50,98 +54,103 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression { |
CFX_PtrArray* m_pExpressions; |
FX_BOOL m_isGlobal; |
}; |
+ |
class CXFA_FMVarExpression : public CXFA_FMExpression { |
public: |
CXFA_FMVarExpression(FX_DWORD line, |
const CFX_WideStringC& wsName, |
CXFA_FMExpression* pInit); |
- virtual ~CXFA_FMVarExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
CFX_WideStringC m_wsName; |
- CXFA_FMExpression* m_pInit; |
+ std::unique_ptr<CXFA_FMExpression> m_pInit; |
}; |
+ |
class CXFA_FMExpExpression : public CXFA_FMExpression { |
public: |
CXFA_FMExpExpression(FX_DWORD line, CXFA_FMSimpleExpression* pExpression); |
- virtual ~CXFA_FMExpExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
- CXFA_FMSimpleExpression* m_pExpression; |
+ std::unique_ptr<CXFA_FMSimpleExpression> m_pExpression; |
}; |
+ |
class CXFA_FMBlockExpression : public CXFA_FMExpression { |
public: |
CXFA_FMBlockExpression(FX_DWORD line, CFX_PtrArray* pExpressionList); |
- virtual ~CXFA_FMBlockExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ ~CXFA_FMBlockExpression() override; |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
CFX_PtrArray* m_pExpressionList; |
}; |
+ |
class CXFA_FMDoExpression : public CXFA_FMExpression { |
public: |
CXFA_FMDoExpression(FX_DWORD line, CXFA_FMExpression* pList); |
- virtual ~CXFA_FMDoExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
- CXFA_FMExpression* m_pList; |
+ std::unique_ptr<CXFA_FMExpression> m_pList; |
}; |
+ |
class CXFA_FMIfExpression : public CXFA_FMExpression { |
public: |
CXFA_FMIfExpression(FX_DWORD line, |
CXFA_FMSimpleExpression* pExpression, |
CXFA_FMExpression* pIfExpression, |
CXFA_FMExpression* pElseExpression); |
- virtual ~CXFA_FMIfExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
- CXFA_FMSimpleExpression* m_pExpression; |
- CXFA_FMExpression* m_pIfExpression; |
- CXFA_FMExpression* m_pElseExpression; |
+ std::unique_ptr<CXFA_FMSimpleExpression> m_pExpression; |
+ std::unique_ptr<CXFA_FMExpression> m_pIfExpression; |
+ std::unique_ptr<CXFA_FMExpression> m_pElseExpression; |
}; |
+ |
class CXFA_FMLoopExpression : public CXFA_FMExpression { |
public: |
- CXFA_FMLoopExpression(FX_DWORD line) : CXFA_FMExpression(line) {} |
- virtual ~CXFA_FMLoopExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ explicit CXFA_FMLoopExpression(FX_DWORD line) : CXFA_FMExpression(line) {} |
+ ~CXFA_FMLoopExpression() override; |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
}; |
+ |
class CXFA_FMWhileExpression : public CXFA_FMLoopExpression { |
public: |
CXFA_FMWhileExpression(FX_DWORD line, |
CXFA_FMSimpleExpression* pCodition, |
CXFA_FMExpression* pExpression); |
- virtual ~CXFA_FMWhileExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
- CXFA_FMSimpleExpression* m_pCondition; |
- CXFA_FMExpression* m_pExpression; |
+ std::unique_ptr<CXFA_FMSimpleExpression> m_pCondition; |
+ std::unique_ptr<CXFA_FMExpression> m_pExpression; |
}; |
+ |
class CXFA_FMBreakExpression : public CXFA_FMExpression { |
public: |
- CXFA_FMBreakExpression(FX_DWORD line); |
- virtual ~CXFA_FMBreakExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ explicit CXFA_FMBreakExpression(FX_DWORD line); |
+ ~CXFA_FMBreakExpression() override; |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
}; |
+ |
class CXFA_FMContinueExpression : public CXFA_FMExpression { |
public: |
- CXFA_FMContinueExpression(FX_DWORD line); |
- virtual ~CXFA_FMContinueExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ explicit CXFA_FMContinueExpression(FX_DWORD line); |
+ ~CXFA_FMContinueExpression() override; |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
}; |
+ |
class CXFA_FMForExpression : public CXFA_FMLoopExpression { |
public: |
CXFA_FMForExpression(FX_DWORD line, |
@@ -151,32 +160,32 @@ class CXFA_FMForExpression : public CXFA_FMLoopExpression { |
int32_t iDirection, |
CXFA_FMSimpleExpression* pStep, |
CXFA_FMExpression* pList); |
- virtual ~CXFA_FMForExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
CFX_WideStringC m_wsVariant; |
- CXFA_FMSimpleExpression* m_pAssignment; |
- CXFA_FMSimpleExpression* m_pAccessor; |
+ std::unique_ptr<CXFA_FMSimpleExpression> m_pAssignment; |
+ std::unique_ptr<CXFA_FMSimpleExpression> m_pAccessor; |
int32_t m_iDirection; |
- CXFA_FMSimpleExpression* m_pStep; |
- CXFA_FMExpression* m_pList; |
+ std::unique_ptr<CXFA_FMSimpleExpression> m_pStep; |
+ std::unique_ptr<CXFA_FMExpression> m_pList; |
}; |
+ |
class CXFA_FMForeachExpression : public CXFA_FMLoopExpression { |
public: |
CXFA_FMForeachExpression(FX_DWORD line, |
const CFX_WideStringC& wsIdentifier, |
CFX_PtrArray* pAccessors, |
CXFA_FMExpression* pList); |
- virtual ~CXFA_FMForeachExpression(); |
- virtual void ToJavaScript(CFX_WideTextBuf& javascript); |
- virtual void ToImpliedReturnJS(CFX_WideTextBuf&); |
+ ~CXFA_FMForeachExpression() override; |
+ void ToJavaScript(CFX_WideTextBuf& javascript) override; |
+ void ToImpliedReturnJS(CFX_WideTextBuf&) override; |
private: |
CFX_WideStringC m_wsIdentifier; |
CFX_PtrArray* m_pAccessors; |
- CXFA_FMExpression* m_pList; |
+ std::unique_ptr<CXFA_FMExpression> m_pList; |
}; |
#endif // XFA_SRC_FXFA_SRC_FM2JS_XFA_EXPRESSION_H_ |