Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: xfa/fxfa/fm2js/xfa_expression.h

Issue 2562833002: Replace CFX_WideStringCArray with std::vector. (Closed)
Patch Set: Pass vectors as rvalue references Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcrt/fx_basic.h ('k') | xfa/fxfa/fm2js/xfa_expression.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FXFA_FM2JS_XFA_EXPRESSION_H_ 7 #ifndef XFA_FXFA_FM2JS_XFA_EXPRESSION_H_
8 #define XFA_FXFA_FM2JS_XFA_EXPRESSION_H_ 8 #define XFA_FXFA_FM2JS_XFA_EXPRESSION_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 22 matching lines...) Expand all
33 uint32_t GetLine() { return m_line; } 33 uint32_t GetLine() { return m_line; }
34 XFA_FM_EXPTYPE GetExpType() const { return m_type; } 34 XFA_FM_EXPTYPE GetExpType() const { return m_type; }
35 35
36 protected: 36 protected:
37 XFA_FM_EXPTYPE m_type; 37 XFA_FM_EXPTYPE m_type;
38 uint32_t m_line; 38 uint32_t m_line;
39 }; 39 };
40 40
41 class CXFA_FMFunctionDefinition : public CXFA_FMExpression { 41 class CXFA_FMFunctionDefinition : public CXFA_FMExpression {
42 public: 42 public:
43 // Takes ownership of |pExpressions|. 43 // Takes ownership of |pArguments| and |pExpressions|.
dsinclair 2016/12/08 21:51:33 Can you either rename these to |arguments| and |ex
Tom Sepez 2016/12/08 23:10:22 Done. They are no longer pointers but rvalue refe
44 CXFA_FMFunctionDefinition( 44 CXFA_FMFunctionDefinition(
45 uint32_t line, 45 uint32_t line,
46 bool isGlobal, 46 bool isGlobal,
47 const CFX_WideStringC& wsName, 47 const CFX_WideStringC& wsName,
48 std::unique_ptr<CFX_WideStringCArray> pArguments, 48 std::vector<CFX_WideStringC>&& arguments,
49 std::vector<std::unique_ptr<CXFA_FMExpression>>&& pExpressions); 49 std::vector<std::unique_ptr<CXFA_FMExpression>>&& expressions);
50 ~CXFA_FMFunctionDefinition() override; 50 ~CXFA_FMFunctionDefinition() override;
51 51
52 void ToJavaScript(CFX_WideTextBuf& javascript) override; 52 void ToJavaScript(CFX_WideTextBuf& javascript) override;
53 void ToImpliedReturnJS(CFX_WideTextBuf&) override; 53 void ToImpliedReturnJS(CFX_WideTextBuf&) override;
54 54
55 private: 55 private:
56 CFX_WideStringC m_wsName; 56 CFX_WideStringC m_wsName;
57 std::unique_ptr<CFX_WideStringCArray> m_pArguments; 57 std::vector<CFX_WideStringC> m_pArguments;
58 std::vector<std::unique_ptr<CXFA_FMExpression>> m_pExpressions; 58 std::vector<std::unique_ptr<CXFA_FMExpression>> m_pExpressions;
59 bool m_isGlobal; 59 bool m_isGlobal;
60 }; 60 };
61 61
62 class CXFA_FMVarExpression : public CXFA_FMExpression { 62 class CXFA_FMVarExpression : public CXFA_FMExpression {
63 public: 63 public:
64 CXFA_FMVarExpression(uint32_t line, 64 CXFA_FMVarExpression(uint32_t line,
65 const CFX_WideStringC& wsName, 65 const CFX_WideStringC& wsName,
66 std::unique_ptr<CXFA_FMExpression> pInit); 66 std::unique_ptr<CXFA_FMExpression> pInit);
67 ~CXFA_FMVarExpression() override; 67 ~CXFA_FMVarExpression() override;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 void ToJavaScript(CFX_WideTextBuf& javascript) override; 205 void ToJavaScript(CFX_WideTextBuf& javascript) override;
206 void ToImpliedReturnJS(CFX_WideTextBuf&) override; 206 void ToImpliedReturnJS(CFX_WideTextBuf&) override;
207 207
208 private: 208 private:
209 CFX_WideStringC m_wsIdentifier; 209 CFX_WideStringC m_wsIdentifier;
210 std::vector<std::unique_ptr<CXFA_FMSimpleExpression>> m_pAccessors; 210 std::vector<std::unique_ptr<CXFA_FMSimpleExpression>> m_pAccessors;
211 std::unique_ptr<CXFA_FMExpression> m_pList; 211 std::unique_ptr<CXFA_FMExpression> m_pList;
212 }; 212 };
213 213
214 #endif // XFA_FXFA_FM2JS_XFA_EXPRESSION_H_ 214 #endif // XFA_FXFA_FM2JS_XFA_EXPRESSION_H_
OLDNEW
« no previous file with comments | « core/fxcrt/fx_basic.h ('k') | xfa/fxfa/fm2js/xfa_expression.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698