xfa_program.h revision 4d3acf4ec42bf6e838f9060103aff98fbf170794
1// Copyright 2014 PDFium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7#ifndef XFA_FXFA_FM2JS_XFA_PROGRAM_H_ 8#define XFA_FXFA_FM2JS_XFA_PROGRAM_H_ 9 10#include <memory> 11 12#include "xfa/fxfa/fm2js/xfa_error.h" 13#include "xfa/fxfa/fm2js/xfa_fmparse.h" 14 15class CXFA_FMProgram { 16 public: 17 explicit CXFA_FMProgram(const CFX_WideStringC& wsFormcalc); 18 ~CXFA_FMProgram(); 19 20 int32_t ParseProgram(); 21 int32_t TranslateProgram(CFX_WideTextBuf& wsJavaScript); 22 23 const CXFA_FMErrorInfo& GetError() const { return m_pErrorInfo; } 24 25 private: 26 CXFA_FMErrorInfo m_pErrorInfo; 27 CXFA_FMParse m_parse; 28 std::unique_ptr<CXFA_FMFunctionDefinition> m_globalFunction; 29}; 30 31#endif // XFA_FXFA_FM2JS_XFA_PROGRAM_H_ 32