1 // Copyright 2016 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 FXJS_XFA_CFXJSE_ARGUMENTS_H_ 8 #define FXJS_XFA_CFXJSE_ARGUMENTS_H_ 9 10 #include <memory> 11 12 #include "core/fxcrt/fx_string.h" 13 #include "core/fxcrt/unowned_ptr.h" 14 #include "v8/include/v8.h" 15 16 class CFXJSE_Value; 17 18 class CFXJSE_Arguments { 19 public: 20 CFXJSE_Arguments(const v8::FunctionCallbackInfo<v8::Value>* pInfo, 21 CFXJSE_Value* pRetValue); 22 ~CFXJSE_Arguments(); 23 24 int32_t GetLength() const; 25 std::unique_ptr<CFXJSE_Value> GetValue(int32_t index) const; 26 bool GetBoolean(int32_t index) const; 27 int32_t GetInt32(int32_t index) const; 28 float GetFloat(int32_t index) const; 29 ByteString GetUTF8String(int32_t index) const; 30 CFXJSE_Value* GetReturnValue() const; 31 32 private: 33 UnownedPtr<const v8::FunctionCallbackInfo<v8::Value>> const m_pInfo; 34 UnownedPtr<CFXJSE_Value> const m_pRetValue; 35 }; 36 37 #endif // FXJS_XFA_CFXJSE_ARGUMENTS_H_ 38